-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
96 lines (89 loc) · 3.76 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
<project name="CompanyDemo" default="dist" basedir=".">
<!-- set global properties for this build -->
<property name="jarname" value="companydemo"/>
<property name="version" value="0.3.1"/>
<property name="javasrc" location="src/java/main"/>
<property name="sqlsrc" location="sql"/>
<property name="shellsrc" location="src/shell"/>
<property name="docsrc" location="doc"/>
<property name="lib" location="lib"/>
<property name="doc" location="doc"/>
<property name="resources" location="resources"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="javadoc" location="${build}/javadoc"/>
<property name="buildclasses" location="${build}/classes"/>
<property name="buildlib" location="${build}/lib"/>
<path id="project.class.path">
<pathelement location="${basedir}/lib/db4o-8.0.184.15484-all-java5.jar"/>
<pathelement location="${basedir}/lib/mysql-connector-java-5.0.8-bin.jar"/>
<pathelement location="${basedir}/lib/hibernate3.jar"/>
<pathelement location="${basedir}/lib/mongo-java-driver-3.8.2.jar"/>
<pathelement path="${java.class.path}/"/>
<pathelement path="${buildclasses}/"/>
</path>
<target name="init">
<replace dir="${javasrc}" value="${version}">
<include name="**/*.java"/>
<replacetoken>@{version}</replacetoken>
</replace>
<tstamp/>
<mkdir dir="${build}"/>
<mkdir dir="${buildclasses}"/>
<mkdir dir="${buildlib}"/>
</target>
<target name="javac" depends="init" description="compile the java sources">
<javac destdir="${buildclasses}">
<src path="${javasrc}"/>
<classpath refid="project.class.path"/>
<include name="net/gumbix/dba/companydemo/**/*.java"/>
</javac>
</target>
<target name="jar" depends="javac" description="generate the distribution">
<jar jarfile="${buildlib}/${jarname}-${version}.jar" basedir="${buildclasses}"/>
</target>
<target name="dist" depends="jar" description="generate the distribution">
<mkdir dir="${build}/doc"/>
<mkdir dir="${dist}"/>
<copydir dest="${build}/doc" src="${docsrc}">
<exclude name="~*"/>
<exclude name="*~"/>
<!--
<include name="DBA*.pdf"/>
<include name="DBA*.docx"/>
<include name="DBA*.dia"/>
-->
</copydir>
<copydir dest="${build}/shell" src="${shellsrc}">
<include name="*.bat"/>
<include name="*.sh"/>
</copydir>
<replace dir="${build}/shell" value="${version}">
<include name="**/*.bat"/>
<include name="**/*.sh"/>
<replacetoken>@{version}</replacetoken>
</replace>
<zip zipfile="${dist}/${jarname}-${version}.zip">
<zipfileset dir="${basedir}">
<include name="gpl-2.0.txt"/>
<include name="readme.txt"/>
</zipfileset>
<zipfileset dir="${buildlib}" prefix="lib"/>
<fileset dir="${build}/shell"/>
<zipfileset dir="${javasrc}" prefix="src"/>
<zipfileset dir="${resources}" prefix="resources"/>
<zipfileset dir="${sqlsrc}" prefix="sql">
<exclude name="*.bak"/>
</zipfileset>
<zipfileset dir="${build}/doc" prefix="doc"/>
<!-- <zipfileset dir="${build}/scaladoc" prefix="scaladoc"/> -->
<zipfileset dir="${lib}" prefix="lib">
<exclude name="scala-*"/>
</zipfileset>
</zip>
</target>
<target name="clean" description="clean up">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>