-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
90 lines (82 loc) · 3.64 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
<project name="Synthuse" default="dist" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description> Simple build file for Synthuse </description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="lib" location="lib"/>
<property name="dist" location="dist"/>
<property name="main.class" value="org.synthuse.SynthuseDlg"/>
<property name="jarname" value="synthuse.jar"/>
<target name="bootstrap" description="Installs apche ivy">
<mkdir dir="${user.home}/.ant/lib"/>
<get dest="${user.home}/.ant/lib/ivy.jar" src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar"/>
</target>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${lib}"/>
<echo>basedir: ${basedir}</echo>
<echo>VM: ${java.vm.name}</echo>
<echo>VM Version: ${java.vm.specification.version}</echo>
<echo>VM Vendor: ${java.vm.vendor}</echo>
<echo>VM Build: ${java.vm.version}</echo>
<echo>Username: ${user.name}</echo>
</target>
<!-- downloadable dependencies are listed in ivy.xml file and are downloaded to the lib/ivy directory. -->
<target name="resolve" depends="init" description="--> retreive dependencies with ivy">
<ivy:retrieve pattern="${lib}/[artifact]-[revision].[ext]"/>
<ivy:report todir="${build}"/>
</target>
<target name="clean" description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
<!-- <delete dir="${lib}"/> -->
</target>
<target name="compile" depends="init" description="compile the source including jars from lib directory" >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" includeantruntime="false" source="1.6" target="1.6">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="dist" depends="compile" description="generate the DISTribution jar file" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Put everything from ${build} and ${lib} into the output .jar file -->
<jar jarfile="${dist}/${jarname}" basedir="${build}">
<zipgroupfileset dir="${lib}" includes="*.jar"/> <!-- includes lib jars -->
<fileset dir="${src}"> <!-- includes images -->
<include name="**/*.png" />
</fileset>
<fileset dir="native/uiabridge/bin"> <!-- includes native jni dlls -->
<include name="**/*.dll" />
</fileset>
<fileset dir="native/MsgHook/bin"> <!-- includes native jni dlls -->
<include name="**/*.dll" />
</fileset>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Class-Path" value="${mf.classpath}"/>
</manifest>
</jar>
</target>
<target name="run" depends="dist" description="runs our generated jar file">
<java jar="${dist}/${jarname}" fork="true"/>
</target>
<target name="jni" depends="dist" description="compile the source including jars from lib directory" >
<!-- makes a JNI header of the named class -->
<javah destdir="${build}" verbose="yes" classpath="${dist}/${jarname}">
<class name="org.synthuse.UiaBridge"/>
</javah>
<javah destdir="${build}" verbose="yes" classpath="${dist}/${jarname}">
<class name="org.synthuse.MsgHook"/>
</javah>
</target>
</project>