-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
107 lines (98 loc) · 3.68 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="all" name="ocular-ocr">
<property file="local.build.properties"/>
<property file="build.properties"/>
<condition property="git.commit" value="${git.commit}" else="">
<isset property="git.commit"/>
</condition>
<property name="project.version" value="0.1"/>
<property name="project.lib.version" value="0.2-SNAPSHOT"/>
<property name="project.app" value="ocular-ocr"/>
<property name="project.app.jar" value="exist-${project.app}-${project.version}${git.commit}.jar"/>
<property name="project.lib.jar" value="exist-${project.app}-${project.lib.version}-jar-with-dependencies.jar"/>
<property name="build.dir" value="build"/>
<property name="build.compiler" value="extJavac"/>
<property name="java.src" value="java/src"/>
<property name="java.classes" value="${build.dir}/classes"/>
<property name="java.libs" value="java/lib"/>
<property name="scripts" value="resources/scripts"/>
<path id="classpath">
<fileset dir="${exist.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${exist.dir}/lib/core">
<include name="*.jar"/>
</fileset>
<fileset dir="${exist.dir}/lib/optional">
<include name="*.jar"/>
</fileset>
<fileset dir="${exist.dir}/tools/jetty/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${java.libs}">
<include name="*.jar"/>
</fileset>
</path>
<target name="all" depends="xar"/>
<target name="rebuild" depends="clean,all"/>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${java.classes}"/>
<delete file="expath-pkg.xml"/>
<delete file="exist.xml"/>
</target>
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${java.classes}"/>
</target>
<target name="compile" depends="prepare">
<javac srcdir="${java.src}" destdir="${java.classes}" optimize="true" debug="true" target="1.8" source="1.8">
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<jar basedir="${java.classes}" jarfile="${build.dir}/exist-${project.app}-${project.version}.jar">
<manifest>
<attribute name="Project-Name" value="${project.app}"/>
<attribute name="Project-Version" value="${project.version}"/>
<attribute name="Project-Build" value="${DSTAMP}"/>
</manifest>
</jar>
</target>
<target name="xar" depends="jar">
<copy file="expath-pkg.xml.tmpl" tofile="expath-pkg.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.version" value="${project.version}"/>
</filterset>
</copy>
<copy file="exist.xml.tmpl" tofile="exist.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.version" value="${project.version}"/>
<filter token="project.app.jar" value="${project.app.jar}"/>
<filter token="project.lib.jar" value="${project.lib.jar}"/>
</filterset>
</copy>
<zip destfile="${build.dir}/${project.app}-${project.version}${git.commit}.xar">
<fileset dir=".">
<include name="*.*"/>
<include name="modules/**"/>
<include name="templates/**"/>
<include name="resources/**"/>
<exclude name=".git*"/>
<exclude name="build.*"/>
<exclude name="*.tmpl"/>
<exclude name="*.properties"/>
</fileset>
<zipfileset dir="${build.dir}" includes="*.jar" prefix="content"/>
<zipfileset dir="${java.libs}" includes="*.jar" prefix="content"/>
</zip>
<delete dir="${build.dir}/classes"/>
<delete>
<fileset dir="${build.dir}">
<include name="*.jar"/>
</fileset>
</delete>
</target>
</project>