forked from eriwen/cheqlist
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
108 lines (96 loc) · 5.08 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
97
98
99
100
101
102
103
104
105
106
107
108
<?xml version="1.0" encoding="UTF-8"?>
<project name="Cheqlist" default="default" basedir=".">
<description>Builds, tests, and runs the project Cheqlist.</description>
<import file="nbproject/build-impl.xml"/>
<target name="-pre-init">
<property name="ignore.failing.tests" value="true" />
</target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init"
name="-init-check">
<fail unless="src.dir">Must set src.dir</fail>
<fail unless="test.src.dir">Must set test.src.dir</fail>
<fail unless="build.dir">Must set build.dir</fail>
<fail unless="build.generated.dir">Must set build.generated.dir</fail>
<fail unless="build.classes.dir">Must set build.classes.dir</fail>
<fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
<fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
<fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
</target>
<target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
<mkdir dir="${build.test.classes.dir}"/>
</target>
<target name="-pre-compile-test"></target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test">
<javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
<copy todir="${build.test.classes.dir}">
<fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
</target>
<target name="-post-compile-test"></target>
<target name="compile-test" depends="init,compile,-pre-pre-compile-test,-do-compile-test">
<taskdef name="groovyc"
classname="org.codehaus.groovy.ant.Groovyc"
classpathref="${run.test.classpath}"/>
<groovyc srcdir="${test.src.dir}" destdir="${build.test.classes.dir}"
classpath="${run.test.classpath}"/>
</target>
<target depends="init" if="have.tests" name="-pre-test-run">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
</target>
<target depends="init" if="have.tests" name="test-report"/>
<target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
<target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
<junit showoutput="true" fork="true" dir="${basedir}" forkmode="once"
failureproperty="tests.failed" errorproperty="tests.failed">
<batchtest todir="${build.test.results.dir}">
<fileset dir="${build.test.classes.dir}" includes="**/*Test.class" />
</batchtest>
<classpath>
<path path="${build.test.classes.dir}"/>
<path path="${run.test.classpath}"/>
<path path="${groovy.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg line="${run.jvmargs}"/>
</junit>
</target>
<target name="package-for-store" depends="jar">
<property name="store.jar.name" value="Cheqlist0.1"/>
<property name="store.dir" value="store"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>
<delete dir="${store.dir}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
<zipgroupfileset dir="dist" includes="*.jar"/>
<zipgroupfileset dir="dist/lib" includes="*.jar"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
<zip destfile="${store.jar}">
<zipfileset src="${store.dir}/temp_final.jar"
excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
</zip>
<delete file="${store.dir}/temp_final.jar"/>
<exec executable="jarsigner">
<arg line="-keystore" />
<arg file="${jarsign.keystore}" />
<arg line="-storepass ${jarsign.storepass}" />
<arg line="-keypass ${jarsign.keypass}" />
<arg file="${store.jar}"/>
<arg line="${jarsign.alias}" />
</exec>
<echo>Signed Jar '${store.jar}' created</echo>
</target>
</project>