-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
156 lines (130 loc) · 6.11 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
<project name="YajHFC-Console" default="dist" basedir=".">
<description>
YajHFC console application build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="java1-src" location="java1-src"/>
<property name="jar-extra" location="jar"/>
<property name="dist-extra" location="dist"/>
<property name="build.compiler" value="modern"/>
<property name="build.sysclasspath" value="ignore"/>
<property file="build.properties"/>
<property name="yajhfc-jar" location="../yajhfc/build/yajhfc.jar"/>
<property name="build" location="build"/>
<property name="i18n-bin" location="i18n/bin"/>
<property name="jar-output" location="${build}/yajhfc-console.jar"/>
<property name="srczip-output" location="${build}/yajhfc-console-src.zip"/>
<property name="binzip-output" location="${build}/yajhfc-console.zip"/>
<property name="exewrapper.config" location="${src}/launch4j.cfg.xml"/>
<property name="exewrapper.target" location="${build}/cyajhfc.exe"/>
<property name="launch4j.dir" location="/opt/launch4j" />
<property name="yajhfc.version" value="0.5.3" />
<pathconvert property="yajhfc.version.numeric" dirsep="" pathsep="" description="Make an all numeric version and assign value to new property">
<path path="${yajhfc.version}full999" />
<!--Pathconvert will try to add the root directory to the "path", so replace with empty string -->
<map from="${basedir}" to="" />
<regexpmapper from="(\d+\.\d+\.\d+)[a-zA-Z]*(\d*)" to="\1.\2"/>
</pathconvert>
<target name="init">
<echo>YajHFC version: ${yajhfc.version}; numeric version: ${yajhfc.version.numeric}</echo>
<fail message="YajHFC jar not found. Edit build.properties to specify the correct location.">
<condition>
<not>
<available file="${yajhfc-jar}"/>
</not>
</condition>
</fail>
<!-- Find out if we have valid, precompiled translations -->
<uptodate property="i18n.havePrecompiled">
<srcfiles dir="i18n" includes="*_*.po,CommandLineOpts.po"/>
<compositemapper>
<mapper type="glob" from="Messages*.po" to="${i18n-bin}/yajhfc/console/i18n/Messages*.class" />
<mapper type="glob" from="Messages*.po" to="${i18n-bin}/yajhfc/console/i18n/Messages*$1.class" />
<mapper type="glob" from="CommandLine*.po" to="${i18n-bin}/yajhfc/console/i18n/CommandLine*.properties" />
</compositemapper>
</uptodate>
<!-- Find out if we need to recompile the exe wrapper -->
<uptodate property="exewrapper.isUpToDate"
srcfile="${exewrapper.config}"
targetfile="${build}/cyajhfc.exe"/>
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="i18n" unless="i18n.havePrecompiled" depends="init" description="compile the translations">
<exec executable="/bin/sh" dir="i18n" osfamily="unix">
<arg value="./fmtall.sh"/>
</exec>
</target>
<target name="compile" depends="init" description="compile the source code" >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" includes="**/*.java" destdir="${build}" source="1.6" target="1.6" encoding="utf-8" debug="true" debuglevel="lines,source">
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="${yajhfc-jar}"/>
</classpath>
</javac>
<!-- the parts of the source code compatible to Java 1.1-->
<javac srcdir="${java1-src}" includes="yajhfc/**/*.java" destdir="${build}" source="1.3" target="1.1" encoding="utf-8" debug="true" debuglevel="lines,source">
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="${yajhfc-jar}"/>
<pathelement location="${build}"/>
</classpath>
</javac>
</target>
<target name="exewrapper" depends="init" description="generate the exe wrapper for Windows" unless="exewrapper.isUpToDate">
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar
:${launch4j.dir}/lib/xstream.jar" />
<launch4j configFile="${exewrapper.config}" outfile="${exewrapper.target}"
fileVersion="${yajhfc.version.numeric}" productVersion="${yajhfc.version.numeric}"
txtFileVersion="${yajhfc.version}" txtProductVersion="${yajhfc.version}" />
</target>
<target name="dist" depends="compile,i18n,exewrapper" description="generate the distribution" >
<jar jarfile="${jar-output}" manifest="${src}/MANIFEST.MF">
<fileset dir="${build}" includes="yajhfc/**,org/**,de/**"/>
<fileset dir="${jar-extra}" />
<fileset dir="${i18n-bin}" />
<!-- <fileset dir="${src}" includes="COPYING,README*.txt,yajhfc/*.png,yajhfc/images/*,doc/*.html,doc/*.css,yajhfc/faxcover/*.ps"/> -->
</jar>
<zip destfile="${binzip-output}">
<zipfileset dir="${build}" includes="*.jar,*.exe" />
<zipfileset dir="${dist-extra}" excludes="**/*.sh"/>
<zipfileset dir="${dist-extra}" includes="**/*.sh" filemode="0755"/>
<!-- <zipfileset file="${yajhfc-jar}"/> -->
</zip>
</target>
<target name="sourcedist" depends="init,i18n" description="generate the source distribution" >
<zip destfile="${srczip-output}">
<zipfileset dir="." prefix="yajhfc-console/">
<exclude name="bin/"/>
<exclude name="build/"/>
<exclude name="**/*.jar"/>
<exclude name="**/*.log"/>
<exclude name="**/*~"/>
<exclude name="**/.hg/**"/>
</zipfileset>
<!-- <zipfileset dir="${src}" prefix="yajhfc/">
<include name="doc/faq-src/.latex2html-init"/>
<include name="doc/faq-src/*.tex"/>
<include name="doc/faq-src/*.sh"/>
<include name="yajhfc/i18n/*.class"/>
</zipfileset> -->
</zip>
</target>
<target name="fulldist" depends="dist,sourcedist" description="generate both source and binary distributions"/>
<target name="clean" description="clean up" >
<!-- Delete the ${build} directory tree and the jar file -->
<delete dir="${build}"/>
<delete file="${jar-output}"/>
</target>
<target name="merge-po" description="Run xgettext and merge po files">
<exec executable="/bin/sh" dir="i18n" osfamily="unix">
<arg value="./mergeall.sh"/>
</exec>
</target>
</project>