-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathbuild.xml
129 lines (109 loc) · 4.1 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="edsdk4j" default="jar" basedir=".">
<property name="version" value="snapshot" />
<property name="src" value="src/main/java"/>
<property name="lib" value="lib"/>
<property name="build" value="build"/>
<property name="dist" value="dist"/>
<property name="edsdk.dir" value="${basedir}/EDSDK"/>
<property name="edsdk64.dir" value="${basedir}/EDSDK_64"/>
<property name="distver" value="${dist}/edsdk4j-${version}"/>
<!-- javaver >= 1.6 -->
<property name="javaver" value="1.6"/>
<!-- point javart.path to the rt.jar file that corresponds to javaver
or a warning about 'bootstrap class path not set in conjunction
with -source' will occur during compile -->
<property name="javart.path" value=""/>
<property name="jar.file" value="${distver}/edsdk4j.jar"/>
<property environment="env"/>
<property name="jnaerator.lib" value="${lib}/jnaerator-0.11-shaded.jar"/>
<fileset id="jna.libs" dir="${lib}">
<include name="jna*.jar"/>
</fileset>
<fileset id="imgscalr.libs" dir="${lib}">
<include name="imgscalr*.jar"/>
</fileset>
<fileset id="edsdk.libs" dir="${edsdk.dir}">
<include name="**/*.*"/>
</fileset>
<fileset id="edsdk64.libs" dir="${edsdk64.dir}">
<include name="**/*.*"/>
</fileset>
<path id="compile.path">
<fileset refid="jna.libs"/>
<fileset refid="imgscalr.libs"/>
</path>
<target name="setup">
<tstamp>
<format property="build.current.date" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/>
</tstamp>
</target>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="generate-wrapper">
<!-- if this yields strange errors make sure there's no BOM in
the header files. if there are run this in the headers directory:
grep -rl $'\xEF\xBB\xBF' . | xargs perl -i -pe 's{\xEF\xBB\xBF}{}'
-->
<exec logerror="true" executable="java">
<env key="EDSDK_HOME" value="${edsdk.dir}"/>
<arg line="-jar ${jnaerator.lib} config.jnaerator"/>
</exec>
</target>
<target name="compile" depends="setup">
<mkdir dir="${build}/classes" />
<javac
encoding="UTF-8"
includeantruntime="false"
srcdir="${src}"
destdir="${build}/classes"
source="${javaver}"
target="${javaver}"
bootclasspath="${javart.path}"
debug="on">
<classpath refid="compile.path"/>
</javac>
</target>
<!-- create a property containing all .jar files, prefix lib/, and seperated with a space -->
<pathconvert property="libs.classpath" pathsep=" ">
<mapper>
<chainedmapper>
<!-- remove absolute path -->
<flattenmapper />
<!-- add lib/ prefix -->
<globmapper from="*" to="lib/*" />
</chainedmapper>
</mapper>
<path>
<fileset refid="jna.libs"/>
<fileset refid="imgscalr.libs"/>
</path>
</pathconvert>
<target name="jar" depends="compile">
<mkdir dir="${distver}"/>
<jar destfile="${jar.file}">
<manifest>
<attribute name="Class-Path" value="${libs.classpath}"/>
<attribute name="Build-Creator" value="${user.name}"/>
<attribute name="Build-Date" value="${build.current.date}"/>
<attribute name="Specification-Title" value="EdSdk4J API Spec"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Implementation-Title" value="EdSdk4J"/>
<attribute name="Implementation-Version" value="${version} build ${build.current.revision}"/>
</manifest>
<fileset dir="${build}/classes"/>
</jar>
<copy todir="${distver}/lib" overwrite="true">
<fileset refid="jna.libs"/>
<fileset refid="imgscalr.libs"/>
</copy>
<copy todir="${distver}/EDSDK" overwrite="true">
<fileset refid="edsdk.libs"/>
</copy>
<copy todir="${distver}/EDSDK_64" overwrite="true">
<fileset refid="edsdk64.libs"/>
</copy>
</target>
</project>