-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
167 lines (144 loc) · 6.25 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="bindist" name="iox-api" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<!-- set global properties for this build -->
<property name="src" value="${basedir}/src"/>
<property name="build" value="${basedir}/build"/>
<property name="dist" value="${basedir}/dist"/>
<property file="user.properties" prefix="user."/>
<property name="groupId" value="ch.interlis"/>
<property name="artifactId" value="${ant.project.name}"/>
<property name="release" value=""/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<property name="projectjar" value="${build}/jar/${ant.project.name}.jar"/>
<property name="versionfile" value="${src}/ch/interlis/iox/Version.properties"/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${build}/jar"/>
<mkdir dir="${dist}"/>
</target>
<target depends="init,buildnr" name="pom">
<artifact:pom id="mypomE" groupId="${groupId}" artifactId="${artifactId}" version="${buildnr}" name="ehibasics">
</artifact:pom>
<artifact:writepom pomRefId="mypomE" file="build/pom.xml"/>
<artifact:pom id="mypom" file="build/pom.xml" />
</target>
<target depends="init,pom" name="install">
<!-- artifact:install-provider artifactId="wagon-ftp" version="3.0.0"/ -->
<artifact:install file="build/jar/iox-api.jar">
<artifact:pom refid="mypom"/>
<!-- artifact:attach file="build/jar/ehibasics-0.9-SNAPSHOT.jar" type="jar"/ -->
</artifact:install>
</target>
<target depends="init,pom" name="deploy">
<artifact:install-provider artifactId="wagon-ftp" version="3.0.0"/>
<artifact:deploy file="build/jar/iox-api.jar">
<remoteRepository url="ftp://ftp.interlis.ch">
<authentication username="${user.repos_usr}" password="${user.repos_pwd}"/>
</remoteRepository>
<pom refid="mypom"/>
</artifact:deploy>
</target>
<target depends="init" name="compile">
<!-- Compile the java code from ${src} into ${build}/classes -->
<mkdir dir="${build}/classes"/>
<javac destdir="${build}/classes" includes="**/*.java" excludes="**/bak~/*.java" source="1.6" target="1.6">
<!-- <classpath>
<pathelement location="lib/ili2c.jar"/>
</classpath> -->
<src path="${src}" />
<!-- <src path="${build}/src"/> -->
</javac>
</target>
<target depends="init" name="javadocs">
<mkdir dir="${build}/javadoc"/>
<javadoc Public="true" Windowtitle="${ant.project.name}" destdir="${build}/javadoc" packagenames="ch.interlis.*">
<sourcepath path="${src}"/>
</javadoc>
</target>
<target depends="init,compile" name="jar">
<!-- <propertyfile file="${versionfile}">
<entry key="versionDate" type="date" value="now" pattern="yyyyMMdd"/>
</propertyfile> -->
<delete file="${projectjar}" quiet="true"/>
<jar jarfile="${projectjar}" manifest="other/manifest">
<fileset dir="${build}/classes" excludes="**/Test.class" includes="**/*.class"/>
<!-- <fileset dir="${basedir}/src-hd53/classes" excludes="**/Test.class" includes="**/*.class"/> -->
<fileset dir="${src}" includes="**/*.properties"/>
<fileset dir="${src}" includes="**/*.gif"/>
<fileset dir="${src}" includes="META-INF/**"/>
<!-- <zipfileset src="lib/stax-api-1.0.jar"/> -->
</jar>
</target>
<target depends="init" name="buildnr">
<property file="${versionfile}" prefix="buildnr."/>
<condition property="SNAPSHOT" value="" else="-SNAPSHOT">
<length string="${release}" trim="true" when="greater" length="0"/>
</condition>
<property name="buildnr" value="${buildnr.versionMajor}.${buildnr.versionMinor}.${buildnr.versionMicro}${SNAPSHOT}"/>
<!-- <property name="buildnr" value="${DSTAMP}"/> -->
</target>
<target depends="init,buildnr" name="bindist">
<delete file="${dist}/${ant.project.name}-${buildnr}.zip" quiet="true"/>
<zip zipfile="${dist}/${ant.project.name}-${buildnr}.zip">
<zipfileset dir="." includes="build/jar/${ant.project.name}.jar" fullpath="${ant.project.name}-${buildnr}/${ant.project.name}.jar"/>
<zipfileset dir="." prefix="${ant.project.name}-${buildnr}">
<patternset includes="doc/CHANGES.txt"/>
<patternset includes="doc/README.txt"/>
</zipfileset>
<zipfileset dir="build/javadoc" prefix="${ant.project.name}-${buildnr}/doc/api">
<patternset includes="**/*"/>
</zipfileset>
<zipfileset dir="doc" prefix="${ant.project.name}-${buildnr}">
<patternset includes="LICENSE.*"/>
</zipfileset>
</zip>
</target>
<target depends="init,buildnr" name="srcdist">
<delete file="${dist}/${ant.project.name}-${buildnr}.src.zip" quiet="true"/>
<zip zipfile="${dist}/${ant.project.name}-${buildnr}.src.zip">
<zipfileset dir="." prefix="${ant.project.name}-${buildnr}">
<patternset includes="src/**" excludes="**/CVS/*;**/bak~/*"/>
<patternset includes="build.xml"/>
<patternset includes="other/manifest"/>
<patternset includes="lib/**"/>
<patternset includes="doc/**"/>
<patternset includes="model/**"/>
</zipfileset>
</zip>
</target>
<target name="clean">
<delete dir="${build}"/>
</target>
<target depends="init" name="reszip">
<delete file="${dist}/resources-${buildnr}.zip" quiet="true"/>
<zip zipfile="${dist}/resources-${buildnr}.zip">
<zipfileset dir="resources">
<!-- <patternset includes="**/comments.txt"/> -->
<patternset includes="**/*.properties"/>
</zipfileset>
</zip>
</target>
<target depends="init" name="copyresfr">
<copy toDir="${basedir}/resources/fr">
<mapper type="glob" from="*.properties" to="*_fr.properties"/>
<fileset dir="${src}" includes="**/*.properties"/>
</copy>
</target>
<target depends="init" name="cleanres">
<delete>
<fileset dir="${build}/classes" includes="**/*.properties"/>
<fileset dir="${build}/classes" includes="**/*.gif"/>
<fileset dir="${build}/classes" includes="**/*.jpg"/>
</delete>
</target>
<target depends="init" name="saveres">
<mkdir dir="res-${DSTAMP}"/>
<copy toDir="res-${DSTAMP}">
<fileset dir="${src}" includes="**/*.properties"/>
<fileset dir="${src}" includes="**/*.gif"/>
<fileset dir="${src}" includes="**/*.jpg"/>
</copy>
</target>
</project>