forked from SynBioDex/libSBOLj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·129 lines (110 loc) · 4.85 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
<?xml version="1.0"?>
<project name="libSBOLj" default="jar" basedir=".">
<property name="build.dir" value="build" />
<property name="core.src.dir" value="src" />
<property name="core.build.dir" value="${build.dir}/core" />
<property name="core.jar" value="${ant.project.name}.jar" />
<property name="examples.dir" value="examples" />
<property name="examples.src.dir" value="${examples.dir}/src" />
<property name="examples.build.dir" value="${build.dir}/examples" />
<property name="examples.jar" value="${ant.project.name}-examples.jar" />
<property name="test.dir" value="test" />
<property name="test.src.dir" value="${test.dir}" />
<property name="test.lib.dir" value="${test.dir}/lib" />
<property name="test.build.dir" value="${build.dir}/test" />
<property name="lib.dir" value="lib" />
<property name="schema.dir" value="schema" />
<property name="javadoc.dir" value="javadoc" />
<!-- the following will set the org.sbolstandard.core.version property -->
<property file="src/main/resources/version.properties"/>
<property name="zip.dir" value="${ant.project.name}-${org.sbolstandard.core.version}"/>
<property name="zip.name" value="${zip.dir}.zip"/>
<target name="clean" description="Cleans all build artifacts including the jar file">
<delete dir="build" />
<delete dir="${javadoc.dir}" />
<delete file="${core.jar}" />
<delete file="${examples.jar}" />
<delete dir="${zip.dir}" />
<delete file="${zip.name}" />
</target>
<target name="build">
<mkdir dir="${core.build.dir}" />
<javac srcdir="${core.src.dir}" destdir="${core.build.dir}" classpathref="lib.classpath" includeantruntime='false' />
</target>
<target name="jar" depends="build" description="Compiles the source files and creates ${ant.project.name}.jar">
<jar jarfile="${core.jar}">
<fileset dir="${core.build.dir}" />
<fileset dir="${core.src.dir}" includes="version.properties" />
<fileset dir="${schema.dir}" />
<manifest>
<attribute name="Main-Class" value="org.sbolstandard.core.cli.SBOLValidate" />
</manifest>
</jar>
</target>
<target name="examples" depends="jar" description="Builds a jar file containing example programs">
<mkdir dir="${examples.build.dir}" />
<javac srcdir="${examples.src.dir}" destdir="${examples.build.dir}" classpath="${core.jar}" includeantruntime='false' />
<jar jarfile="${examples.jar}">
<fileset dir="${examples.build.dir}" />
<manifest>
<attribute name="Class-Path" value="${core.jar}"/>
</manifest>
</jar>
</target>
<target name="javadoc" depends="build" description="Creates the javadocs">
<javadoc destdir="${javadoc.dir}" access="public" use="true" author="true" version="true" doctitle="${ant.project.name}" windowtitle="${ant.project.name} API">
<link href="http://docs.oracle.com/javase/6/docs/api/" />
<packageset dir="${core.src.dir}" defaultexcludes="yes">
<include name="org/sbolstandard/core/**" />
<exclude name="org/sbolstandard/core/impl/**" />
<exclude name="org/sbolstandard/core/cli/**" />
</packageset>
</javadoc>
</target>
<target name="zip" depends="jar,javadoc" description="Build a zipfile containing source and binaries.">
<mkdir dir="${zip.dir}"/>
<copy todir="${zip.dir}">
<fileset dir="">
<include name="build.xml"/>
<include name="LICENSE"/>
<include name="README.md"/>
<include name="${core.jar}"/>
<include name="${examples.jar}"/>
<include name="${core.src.dir}/**"/>
<include name="${examples.dir}/**"/>
<include name="${schema.dir}/**"/>
<include name="${test.dir}/**"/>
<include name="${javadoc.dir}/**"/>
<include name="${lib.dir}/**"/>
</fileset>
</copy>
<zip destfile="${zip.name}">
<zipfileset prefix="${zip.dir}" dir="${zip.dir}"/>
</zip>
</target>
<path id="test.classpath">
<fileset file="${core.jar}" />
<fileset dir="${test.lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement location="${test.build.dir}" />
</path>
<path id="lib.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<target name="build-test" depends="jar">
<mkdir dir="${test.build.dir}" />
<javac srcdir="${test.src.dir}" classpathref="test.classpath" destdir="${test.build.dir}" includeantruntime='false' />
</target>
<target name="test" depends="build-test" description="Runs the unit tests and ensures correctness">
<junit fork="yes" printsummary="off" haltonfailure="false" failureproperty="sbol.junit.failure">
<test name="org.sbolstandard.core.SBOLTestSuite" />
<formatter type="brief" usefile="false" />
<classpath refid="test.classpath" />
<jvmarg value="-enableassertions" />
</junit>
<fail if="sbol.junit.failure" message="JUnit test failure." />
</target>
</project>