forked from BioLockJ-Dev-Team/BioLockJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·136 lines (121 loc) · 4.33 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
<project name="BioLockJ" default="build-jar" basedir="..">
<loadfile property="blj_version" srcfile=".version">
<filterchain><striplinebreaks/></filterchain>
</loadfile>
<available file=".git" type="dir" property="git.present"/>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib/ant-contrib-0.6.jar"/>
</classpath>
</taskdef>
<taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" classpath="lib/ant-contrib-0.6.jar"/>
<path id="lib.path">
<fileset dir="lib"/>
</path>
<target name="clear-bin">
<if><available file="bin"/>
<then>
<delete includeemptydirs="true">
<fileset dir="bin" includes="**/*"/>
</delete>
</then>
</if>
</target>
<target name="init" depends="clear-bin">
<if><available file="bin"/>
<then>
<delete includeemptydirs="true">
<fileset dir="bin" includes="**/*"/>
</delete>
</then>
</if>
<if><available file="dist/BioLockJ.jar"/>
<then>
<delete file="dist/BioLockJ.jar"/>
</then>
</if>
<property name="release_tar" value="dist/BioLockJ-${blj_version}.tar.gz"/>
</target>
<target name="compile-source" depends="init">
<mkdir dir="bin" />
<javac includeantruntime="false" debug="on" srcdir="src" destdir="bin" classpathref="lib.path"/>
<copy file="resources/log4j.properties" todir="bin"/>
</target>
<target name="git.revision" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="--long"/>
<arg value="HEAD"/>
</exec>
</target>
<target name="build-jar" depends="compile-source,git.revision">
<jar destfile="dist/BioLockJ.jar">
<zipgroupfileset dir="lib" includes="*.jar"/>
<fileset dir="bin"/>
<fileset dir="src" includes="biolockj/module/**/*.md"/>
<manifest>
<attribute name="Specification-Title" value="BioLockJ"/>
<attribute name="Specification-Version" value="${blj_version}"/>
<attribute name="Specification-Vendor" value="UNCC Fodor Lab"/>
<attribute name="Implementation-Title" value="BioLockJ"/>
<attribute name="Implementation-Version" value="${git.revision}"/>
<attribute name="Implementation-Vendor" value="UNCC Fodor Lab"/>
<attribute name="Version" value="${blj_version}"/>
<attribute name="Main-Class" value="biolockj.BioLockJ"/>
</manifest>
</jar>
</target>
<target name="javadoc" depends="build-jar">
<javadoc classpathref="lib.path" access="package" author="true" destdir="javadocs" doctitle="BioLockJ" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.8" sourcepath="src" splitindex="true" use="true" version="true">
<tag name="blj.web_desc" description="GUI Module Name" />
<link href="https://docs.oracle.com/javase/8/docs/api/"/>
<link href="http://docs.oracle.com/javase/8/javafx/api/"/>
</javadoc>
</target>
<target name="buildDocs" depends="build-jar">
<delete includeemptydirs="true">
<fileset dir="mkdocs/user-guide/docs/GENERATED" includes="**/*"/>
</delete>
<exec executable="java">
<arg value="-cp"/>
<arg value="dist/BioLockJ.jar"/>
<arg value="biolockj.api.BuildDocs"/>
<arg value="mkdocs/user-guide/docs/GENERATED"/>
</exec>
</target>
<target name="userguide" depends="buildDocs,javadoc">
<exec executable="mkdocs" dir="mkdocs/user-guide">
<arg value="build"/>
<arg value="--site-dir"/>
<arg value="../../docs"/>
</exec>
<move file="javadocs" tofile="docs/javadocs"/>
</target>
<target name="deploy" depends="userguide">
<delete>
<fileset dir="dist" includes="*gz"/>
</delete>
<if><available file="bin"/>
<then>
<delete includeemptydirs="true">
<fileset dir="bin" includes="**/*"/>
</delete>
</then>
</if>
<tar compression="gzip" destfile="${release_tar}" longfile="gnu">
<tarfileset dir="." filemode="770" dirmode="770" prefix="BioLockJ">
<exclude name="/bin"/>
<exclude name="${release_tar}"/>
<exclude name="*.yml"/>
<exclude name="*.md"/>
<exclude name=".DS_Store"/>
<exclude name=".git*"/>
<exclude name=".project"/>
<exclude name=".classpath"/>
</tarfileset>
</tar>
<chmod file="${release_tar}" perm="770"/>
</target>
</project>