-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.xml
115 lines (115 loc) · 5.18 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="MX" default="compile" basedir=".">
<!-- properties -->
<property name="full-name" value="MX - Essential Cheminformatics" />
<property name="unix-name" value="mx" />
<property name="version" value="1.0-beta-3" />
<property name="source.dir" location="src" />
<property name="resource.dir" location="resources" />
<property name="lib.dir" location="lib" />
<property name="build.dir" location="build" />
<property name="class.dir" location="${build.dir}/classes" />
<property name="jar.dir" location="${build.dir}/jar" />
<property name="tgz.dir" location="${build.dir}/tgz" />
<property name="doc.dir" location="${build.dir}/doc" />
<property name="dist.dir" location="${build.dir}/dist" />
<property name="test.dir" location="${build.dir}/test" />
<property name="molfile.dir" location="${resource.dir}/molfiles" />
<property name="testenv.dir" location ="testenv" />
<property name="lib-licenses.file" location="${lib.dir}/LICENSES" />
<property name="license.file" location="LICENSE" />
<property name="readme.file" location="README" />
<property name="junit.lib" value="${lib.dir}/junit-4.5.jar" />
<property name="mockito.lib" value="${lib.dir}/mockito-all-1.7.jar" />
<property name="test.class" value = "com.metamolecular.mx.test.MXTest" />
<!-- filesets -->
<fileset dir="${lib.dir}" id="libs">
<include name="**/*.jar" />
</fileset>
<!-- targets -->
<target name="init" description="Create build directories." >
<mkdir dir="${build.dir}" />
<mkdir dir="${class.dir}" />
<mkdir dir="${jar.dir}" />
<mkdir dir="${doc.dir}" />
<mkdir dir="${tgz.dir}" />
<mkdir dir="${test.dir}" />
</target>
<target name="clean" description="Remove build directories.">
<delete dir="${build.dir}" />
<delete dir="${doc.dir}" />
</target>
<target name="compile" depends="init" description="Compile sources.">
<javac srcdir="${source.dir}" destdir="${class.dir}" includes="com/metamolecular/mx/**/*.java" debug="on" source="1.5" target="1.5">
<classpath>
<fileset refid="libs" />
</classpath>
</javac>
<copy file="${resource.dir}/atomic_system.xml" todir="${class.dir}/com/metamolecular/mx/model" />
</target>
<target name="testenv" depends="jar" description="Create a test environment in this directory.">
<copy todir="${testenv.dir}">
<fileset dir="${resource.dir}/testenv" />
</copy>
<copy todir="${testenv.dir}/lib">
<fileset dir="${lib.dir}" includes="*.jar" />
</copy>
<copy todir="${testenv.dir}/lib">
<fileset dir="${jar.dir}" includes="*.jar" />
</copy>
</target>
<target name="test" depends="compile" description="Run JUnit tests.">
<java classname="${test.class}" fork = "true" dir="${build.dir}">
<classpath>
<pathelement path="${class.dir}" />
<fileset refid="libs" />
</classpath>
</java>
</target>
<target name="doc" depends="compile" description="Create Java Doc.">
<javadoc sourcepath="${source.dir}" packagenames="*" destdir="${doc.dir}" windowtitle="${full-name} API" excludepackagenames="com.metamolecular.mx.test">
<doctitle>${full-name} v${version}</doctitle>
<header>${full-name} v${version}</header>
<classpath>
<fileset refid="libs" />
</classpath>
<bottom><![CDATA[<i>Copyright © 2007-2009 <a href="http://metamolecular.com">Metamolecular, LLC</a> and others. All Rights Reserved.</i>]]>
</bottom>
</javadoc>
</target>
<target name="jar" depends="compile" description="Create the jarfile.">
<jar jarfile="${jar.dir}/${unix-name}-${version}.jar" basedir="${class.dir}" excludes="com/metamolecular/mx/test/**" >
</jar>
</target>
<target name="dist" depends="init,compile,doc" description="Create the source distribution.">
<mkdir dir="${dist.dir}/lib" />
<mkdir dir="${dist.dir}/src" />
<mkdir dir="${dist.dir}/doc" />
<mkdir dir="${dist.dir}/resources" />
<mkdir dir="${dist.dir}/resources/molfiles" />
<copy file="${junit.lib}" todir="${dist.dir}/lib" />
<copy file="${mockito.lib}" todir="${dist.dir}/lib" />
<copy file="${lib-licenses.file}" todir="${dist.dir}/lib" />
<copy file="${license.file}" todir="${dist.dir}" />
<copy file="${readme.file}" todir="${dist.dir}" />
<copy todir="${dist.dir}/src">
<fileset dir="${source.dir}" includes="com/metamolecular/mx/**/*.java" />
</copy>
<copy todir="${dist.dir}/doc">
<fileset dir="${doc.dir}" />
</copy>
<copy todir="${dist.dir}/resources/molfiles">
<fileset dir="${molfile.dir}" />
</copy>
<copy file="${resource.dir}/atomic_system.pdf" todir="${dist.dir}/resources" />
<copy file="${resource.dir}/atomic_system.xml" todir="${dist.dir}/resources" />
<copy file="${resource.dir}/pubchem_sample_33.sdf" todir="${dist.dir}/resources" />
<copy file="build.xml" todir="${dist.dir}" />
</target>
<target name="tgz" depends="dist" description="Create a compressed distribution tarfile.">
<tar destfile="${tgz.dir}/${unix-name}-${version}-src.tar.gz" compression="gzip">
<tarfileset dir="${dist.dir}" prefix="${unix-name}-${version}-src">
</tarfileset>
</tar>
</target>
</project>