-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
96 lines (71 loc) · 2.29 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright © 2016-2024 Andy Goryachev <[email protected]> -->
<project default="build-all" basedir=".">
<!-- project name -->
<property name="TARGET" value="AppFramework"/>
<property name="MAIN_CLASS" value="demo.appfw.AppFrameworkDemoApp"/>
<!-- libraries -->
<path id="libs">
<!--
<pathelement location="lib/gson/gson-2.8.5.jar" />
-->
</path>
<target name="clean">
<delete includeEmptyDirs="true" dir="build" failonerror="false" />
</target>
<target name="init" depends="clean">
<mkdir dir="build" />
<mkdir dir="build/classes" />
<mkdir dir="build/jars" />
</target>
<target name="compile" depends="init">
<javac
destdir="build/classes"
debug="true"
encoding="utf-8"
fork="true"
nowarn="true"
optimize="false"
source="23"
target="23"
includeantruntime="false"
>
<compilerarg value="-Xlint:none"/>
<src path="src" />
<classpath refid="libs" />
</javac>
</target>
<!-- copy non-java resources -->
<target name="copy-resources" depends="init">
<copy todir="build/classes">
<fileset dir="src" excludes="**/*.java" />
</copy>
</target>
<!-- upack library jars -->
<target name="unpack-jars" depends="init">
<unzip dest="build/classes">
<path refid="libs" />
</unzip>
<delete dir="build/classes/META-INF" />
</target>
<!-- build app jar -->
<target name="make-jar" depends="compile, copy-resources, unpack-jars">
<delete file="build/jars/${TARGET}.jar" />
<jar jarfile="build/jars/${TARGET}.jar" basedir="build/classes" filesonly="true">
<manifest>
<attribute name="Main-Class" value="${MAIN_CLASS}" />
<attribute name="Created-By" value="[email protected]" />
</manifest>
</jar>
</target>
<!-- generate digest -->
<target name="sha-jar" depends="make-jar">
<checksum file="build/jars/${TARGET}.jar" algorithm="sha-256" forceoverwrite="yes" fileext=".sha256.txt" />
</target>
<!-- copy jar to base dir -->
<target name="copy-jar" depends="make-jar">
<copy file="build/jars/${TARGET}.jar" todir="." />
</target>
<!-- build all -->
<target name="build-all" depends="compile, copy-resources, make-jar, sha-jar, copy-jar" />
</project>