-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.xml
148 lines (129 loc) · 5.34 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<project name="sqlpower_library" default="jar" basedir=".">
<property name="dist.dir" value="dist"/>
<property name="src" value="src/main/java"/>
<property name="resources" value="src/main/resources"/>
<property name="src.apt" value="src/apt/java"/>
<property name="build" value="build"/>
<property name="build.apt" value="build_apt"/>
<property name="build_tmp" value="build_tmp"/>
<property name="build.tests" value="build_tests"/>
<property name="lib" value="lib"/>
<property name="generated" value="generated"/>
<property name="dist.jar" value="sqlpower_library.jar"/>
<property name="test.jar" value="sqlpower_library-tests.jar"/>
<property name="apt.jar" value="sqlpower_library-apt.jar"/>
<property name="tests" value="src/test/java"/>
<property name="tests-resources" value="src/test/resources"/>
<property name="reports.dir" value="${dist.dir}/reports"/>
<property name="build.compiler" value="modern"/>
<path id="compile.classpath">
<fileset dir="${lib}/main">
<include name="*.jar"/>
</fileset>
</path>
<path id="apt.classpath">
<pathelement location="${build}"/>
<pathelement location="${build.apt}"/>
<fileset dir="${lib}/main">
<include name="*.jar"/>
</fileset>
</path>
<path id="test.classpath">
<pathelement location="${build}"/>
<path refid="compile.classpath"/>
<fileset dir="${lib}/test">
<include name="*.jar"/>
</fileset>
</path>
<target name="init">
<mkdir dir="${build}"/>
<mkdir dir="${build.apt}"/>
<mkdir dir="${build_tmp}"/>
<mkdir dir="${generated}"/>
<mkdir dir="${build.tests}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="dist" depends="jar, test">
<!-- just a metatarget that brings the dependencies together -->
</target>
<target name="clean" description="Cleans...">
<delete dir="${build}" includeemptydirs="true"/>
<delete dir="${build.apt}" includeemptydirs="true"/>
<delete dir="${build_tmp}" includeemptydirs="true"/>
<delete dir="${dist.dir}" includeemptydirs="true"/>
<delete dir="${generated}" includeemptydirs="true"/>
<delete dir="${build.tests}" includeemptydirs="true"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${build}" classpathref="compile.classpath" debug="true"/>
<javac
srcdir="${src.apt}"
destdir="${build.apt}"
classpathref="apt.classpath"
debug="true"/>
<javac srcdir="${src}" destdir="${build_tmp}" classpathref="apt.classpath" debug="true">
<compilerarg value="-proc:only" />
<compilerarg value="-processor" />
<compilerarg value="ca.sqlpower.object.annotation.SPAnnotationProcessor" />
<compilerarg value="-s" />
<compilerarg value="${generated}" />
</javac>
<javac srcdir="${generated}" destdir="${build}" classpathref="compile.classpath" debug="true"/>
<copy flatten="false" todir="${build}">
<fileset dir="${resources}">
<include name="**/*"/>
</fileset>
</copy>
<delete dir="${build_tmp}"/>
</target>
<target name="jar" depends="compile-tests" description="Generates JAR archives.">
<jar jarfile="${dist.dir}/${dist.jar}" basedir="${build}" />
<jar jarfile="${dist.dir}/${test.jar}" basedir="${build.tests}" />
<jar jarfile="${dist.dir}/${apt.jar}" basedir="${build.apt}" />
</target>
<target name="compile-tests" depends="compile">
<javac srcdir="${tests}" destdir="${build.tests}" classpathref="test.classpath" debug="true"/>
<copy flatten="false" todir="${build.tests}">
<fileset dir="${tests-resources}">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="test" depends="compile-tests" description="Runs the test suite.">
<property name="reports.junit" value="${reports.dir}/junit"/>
<mkdir dir="${reports.junit}"/>
<!-- Output all System.out and System.err messages -->
<junit printsummary="on" showoutput="no" maxmemory="1024m" dir=".">
<sysproperty key="ca.sqlpower.architect.test.dir" value="${build.tests}"/>
<sysproperty key="ca.sqlpower.SKIP_DODGY_TESTS" value="${ca.sqlpower.SKIP_DODGY_TESTS}" />
<sysproperty key="java.util.prefs.PreferencesFactory" value="prefs.PreferencesFactory"/>
<classpath>
<path refid="test.classpath"/>
<path path="${build.tests}"/>
</classpath>
<batchtest fork="yes" todir="${reports.junit}">
<fileset dir="${tests}">
<include name="**/*Test*.java"/>
<!-- Exclude abstract test classes and non-JUnit tests -->
<exclude name="ca/sqlpower/dao/PersisterTest.java"/>
<exclude name="ca/sqlpower/sqlobject/BaseSQLObjectTestCase.java"/>
<exclude name="ca/sqlpower/sqlobject/DatabaseConnectedTestCase.java"/>
<exclude name="ca/sqlpower/sqlobject/TestingSQLObjectListener.java"/>
<exclude name="ca/sqlpower/object/PersistedSPObjectTest.java"/>
<exclude name="ca/sqlpower/swingui/table/BaseRendererTest.java"/>
<exclude name="ca/sqlpower/util/CacheTest.java"/>
<exclude name="ca/sqlpower/util/ZealousURLEncoderTest.java"/>
<exclude name="ca/sqlpower/util/reservoir/TestingReservoirDataSource.java"/>
</fileset>
</batchtest>
<formatter type="xml"/>
</junit>
<!-- Generate HTML report -->
<junitreport todir="${reports.junit}">
<fileset dir="${reports.junit}">
<include name="TEST-*.xml" />
</fileset>
<report todir="${reports.junit}" />
</junitreport>
</target>
</project>