-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
82 lines (68 loc) · 2.47 KB
/
build.xml
File metadata and controls
82 lines (68 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?xml version="1.0"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="FXEditor" basedir="." default="run">
<property name="src.dir" value="src"/>
<property name="classes.dir" value="classes"/>
<property name="res.dir" value="resources"/>
<property name="dist.dir" value="dist"/>
<property name="lib.dir" value="lib"/>
<property name="classname" value="fxeditor.Main"/>
<path id="libpath">
<!-- <fileset dir="${lib.dir}" includes="**/*.jar"/> -->
</path>
<path id="classpath">
<path refid="libpath"/>
<pathelement path="${classes.dir}"/>
</path>
<path id="modulepath">
<pathelement path="/home/shootingstar/Jinhung/lib/javafx-sdk-11.0.1/lib"/>
</path>
<target name="retrieve">
<ivy:retrieve/>
</target>
<target name="init" description="Initilize the directory structure.">
<mkdir dir="${src.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="clean" description="Clean the old classes.">
<delete includeemptydirs="true">
<fileset dir="${classes.dir}" includes="**/*"/>
<fileset dir="${dist.dir}" includes="**/*"/>
</delete>
</target>
<target name="copy-resources" depends="clean" description="Copy the resources.">
<copy todir="${classes.dir}">
<fileset dir="." includes="${res.dir}/**"/>
</copy>
</target>
<target name="compile" depends="copy-resources" description="Compile the source code.">
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${classes.dir}">
<modulepath refid="modulepath"/>
<classpath refid="classpath"/>
<compilerarg line="--add-modules javafx.controls"/>
</javac>
</target>
<target name="run" depends="compile" description="Run the program.">
<java dir="${classes.dir}" fork="true" classname="${classname}">
<modulepath refid="modulepath"/>
<classpath refid="classpath"/>
<jvmarg line="--add-modules javafx.controls,javafx.fxml"/>
</java>
</target>
<target name="run-jar" depends="jar" description="Run the executable jar.">
<java dir="${dist.dir}" jar="${dist.dir}/${ant.project.name}.jar" fork="true"/>
</target>
<target name="jar" depends="compile,unzip-lib" description="Build an executable jar.">
<jar basedir="${classes.dir}" destfile="${dist.dir}/${ant.project.name}.jar">
<manifest>
<attribute name="Main-Class" value="${classname}"/>
</manifest>
</jar>
</target>
<target name="unzip-lib">
<unzip dest="${classes.dir}">
<path refid="libpath"/>
</unzip>
<delete dir="${classes.dir}/META-INF"/>
</target>
</project>