forked from ncats/lychi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
130 lines (120 loc) · 3.87 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
<?xml version="1.0"?>
<project name="lychi" default="dist" basedir=".">
<property name="build" value="build"/>
<property name="dist" value="dist"/>
<property name="lib" value="lib"/>
<property name="web" value="web/WEB-INF"/>
<property name="classes" value="${web}/classes"/>
<property name="weblib" value="${web}/lib"/>
<property name="src" value="src"/>
<mkdir dir="${weblib}"/>
<path id="compile.classpath">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${weblib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${dist}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${build}"/>
</path>
<target name="init">
<tstamp>
<format property="touch.time"
pattern="MM/dd/yyyy 'at' HH:mm:ss z"/>
<format property="date" pattern="yyyyMMdd"/>
</tstamp>
<exec executable="git"
outputproperty="commit">
<arg line="rev-parse --short HEAD"/>
</exec>
<property name="jar" value="lychi-${commit}.jar"/>
<!--
this version date should be updated only when the underlying
hash will change!
-->
<property name="version" value="20170222"/>
<echo file="src/lychi/Version.java">package lychi;
public final class Version {
public static final String VERSION = "${version}";
public static final String COMMIT = "${commit}";
public static final String USER = "${user.name}";
public static final String TIMESTAMP = "${touch.time}";
private Version () {}
public static void main (String[] argv) {
System.out.println("LyChI Version: commit="+COMMIT+" version="+VERSION+" timestamp="+TIMESTAMP+" user="+USER);
}
}
</echo>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}"
destdir="${build}"
deprecation="on"
debug="on"
includeantruntime="no"
target="1.6"
source="1.6">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="dist" depends="compile">
<copy todir="${build}">
<fileset dir="${src}" includes="**/resources/**"/>
</copy>
<jar jarfile="${dist}/${jar}"
basedir="${build}"
includes="**">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
</target>
<target name="deploy" depends="dist">
<copy todir="${deploy}">
<fileset dir="${dist}" includes="${jar}"/>
</copy>
</target>
<!-- generate self-contained jar file-->
<target name="all" depends="dist">
<property name="tmp" value="${dist}/tmp"/>
<mkdir dir="${tmp}"/>
<unjar src="${lib}/jchem3.jar" dest="${tmp}"/>
<copy todir="${tmp}">
<fileset dir="${build}" includes="**"/>
</copy>
<jar jarfile="${dist}/lychi-all-${commit}.jar"
basedir="${tmp}"
includes="**">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-class" value="lychi.LyChIStandardizer"/>
</manifest>
</jar>
<delete dir="${tmp}"/>
</target>
<target name="clean">
<delete includeEmptyDirs="true">
<fileset dir="${build}" includes="**/*"/>
</delete>
</target>
<target name="test1" depends="dist">
<echo message="=== Test case 1"/>
<java classname="lychi.LyChIStandardizer" maxmemory="256m"
classpathref="compile.classpath" fork="true">
<arg value="tests/standardizer_case1.smi"/>
</java>
</target>
<target name="run" depends="dist">
<echo message="==== args: ${args}"/>
<java classname="lychi.LyChIStandardizer" maxmemory="256m"
classpathref="compile.classpath" fork="true">
<arg value="${args}"/>
</java>
</target>
</project>