-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
59 lines (51 loc) · 2.23 KB
/
build.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="ija-app" default="compile">
<property name="source.dir" location="src"/> <!-- zlozka so zdrojovymi subormi -->
<property name="doc.dir" location="doc"/> <!-- zlozka pre generovanie dokumentacie -->
<property name="dest.dir" location="dest"/> <!-- zlozka pre vysledny .jar -->
<property name="build.dir" location="build"/> <!-- zlozka pre .class subory -->
<property name="lib.dir" location="lib"/> <!-- zlozka s kniznicami -->
<property name="jar.name" value="ija-app"/>
<path id="gson">
<pathelement location="${lib.dir}/gson-2.9.0.jar"/>
</path>
<!-- ZMAZANIE ZLOŽLIEK BUILD A DEST -->
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dest.dir}"/>
</target>
<!-- VYTVORENIE ADRESÁROVEJ ŠTRUKTÚRY -->
<target name="createFileStructure">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dest.dir}"/>
</target>
<!-- KOMPILÁCIA A VYTVORENIE SPUSTITEĽNÉHO .JAR -->
<target name="compile" depends="clean, createFileStructure">
<javac srcdir="${source.dir}" destdir="${build.dir}" includeantruntime="false" encoding="utf-8">
<classpath>
<pathelement path="${source.dir}"/>
<path refid="gson"/>
<pathelement location="${build.dir}" />
</classpath>
</javac>
<jar destfile="${dest.dir}\${jar.name}.jar" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="main.java.run"/>
</manifest>
<zipgroupfileset dir="${lib.dir}" includes="gson-2.9.0.jar"/>
</jar>
<copy todir="${dest.dir}\data">
<fileset dir="data"/>
</copy>
</target>
<!-- GENERACIA PROGRAMOVEJ DOKUMENTACIE -->
<target name="doc" depends="compile" description="generate documentation">
<javadoc encoding="UTF-8" sourcepath="${source.dir}" destdir="${doc.dir}">
<fileset dir="${source.dir}" includes="**/*.java"/>
</javadoc>
</target>
<!-- SPUSTENIE .JAR -->
<target name="run" depends="compile">
<java jar="${dest.dir}/${jar.name}.jar" dir="${dest.dir}" fork="true"/>
</target>
</project>