The data:
D:\>type build.xml
<project name="XHTML" default="package">
<property name="outputDir" value="D:\java\classes\" />
<property name="sourceDir" value="D:\java\src\atreides\xhtml\" />
<property name="mainClass" value="HelloWorldSwing" />
<target name="clean">
<delete dir="${outputDir}" />
</target>
<target name="prepare" depends="clean">
<mkdir dir="${outputDir}" />
</target>
<target name="compile" depends="prepare">
<javac srcdir="${sourceDir}" destdir="${outputDir}" />
</target>
<target name="manifest" depends="compile">
<manifest file="${outputDir}/MANIFEST.MF">
<attribute name="Main-Class"
value="atreides.xhtml.${mainClass}" />
</manifest>
</target>
<target name="package" depends="manifest">
<jar jarfile="${outputDir}/${mainClass}.jar"
basedir="${outputDir}"
manifest="${outputDir}/MANIFEST.MF" />
</target>
</project>
D:\>type java\src\atreides\xhtml\HelloWorldSwing.java
package atreides.xhtml;
import javax.swing.*;
public class HelloWorldSwing {
/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI() {
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
JFrame frame = new JFrame("HelloWorldSwing");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Add the ubiquitous "Hello World" label.
JLabel label = new JLabel("Hello World");
frame.getContentPane().add(label);
//Display the window.
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
D:\>type java\classes\MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: 1.5.0_02-b09 (Sun Microsystems Inc.)
Main-Class: atreides.xhtml.HelloWorldSwing
D:\>
I want a variable with the value of "atreides.xhtml." so that
<target name="manifest" depends="compile">
<manifest file="${outputDir}/MANIFEST.MF">
<attribute name="Main-Class"
value="atreides.xhtml.${mainClass}" />
</manifest>
</target>
can be changed to:
<target name="manifest" depends="compile">
<manifest file="${outputDir}/MANIFEST.MF">
<attribute name="Main-Class"
value="${someVar}${mainClass}" />
</manifest>
</target>
does that seem a good, or "standard," technique?
thanks,
Thufir
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]