1 | <?xml version="1.0"?>
|
---|
2 | <!--
|
---|
3 | This is a normal Ant build file to build the release for sourceforge
|
---|
4 | -->
|
---|
5 | <project name="Installation Build" default="build" basedir="..">
|
---|
6 |
|
---|
7 | <!-- Project properties -->
|
---|
8 | <property name="prepareDir" value="artifacts/prepare"/>
|
---|
9 |
|
---|
10 | <!-- Classpaths - start -->
|
---|
11 | <!-- Classpaths for compilation - start -->
|
---|
12 | <path id="project.cp">
|
---|
13 | <fileset dir="antlib" includes="ant.jar,ant-launcher.jar"/>
|
---|
14 | </path>
|
---|
15 | <path id="project.ext.cp">
|
---|
16 | <fileset dir="lib">
|
---|
17 | <include name="ant-installer.jar"/>
|
---|
18 | </fileset>
|
---|
19 | <fileset dir="antlib" includes="ant.jar,ant-launcher.jar"/>
|
---|
20 | </path>
|
---|
21 | <!-- Classpaths for compilation - end -->
|
---|
22 |
|
---|
23 | <path id="taskdef.cp">
|
---|
24 | <fileset dir="./lib">
|
---|
25 | <include name="ant-installer-ext.jar"/>
|
---|
26 | <include name="ant-installer.jar"/>
|
---|
27 | </fileset>
|
---|
28 | </path>
|
---|
29 | <!-- Classpaths - end -->
|
---|
30 |
|
---|
31 |
|
---|
32 | <!-- Task definitions - start -->
|
---|
33 | <!-- AntInstaller installer task definition.
|
---|
34 | Defined within target as it depends upon files that aren't
|
---|
35 | available at the start of a clean build -->
|
---|
36 | <target name="_set-installer-taskdef" unless="installer.taskdef.defined">
|
---|
37 | <taskdef
|
---|
38 | name="installer"
|
---|
39 | classname="org.tp23.antinstaller.taskdefs.Installer"
|
---|
40 | classpathref="taskdef.cp"/>
|
---|
41 | <property name="installer.taskdef.defined" value="true"/>
|
---|
42 | </target>
|
---|
43 | <!-- Task definitions - end -->
|
---|
44 |
|
---|
45 |
|
---|
46 | <!-- =============================== -->
|
---|
47 | <!-- ==== Public Runnable Targets == -->
|
---|
48 | <!-- =============================== -->
|
---|
49 |
|
---|
50 | <target name="clean-build" depends="clean, _build-ai-jars, clean-demo, _build-demo">
|
---|
51 | <!-- this build is pretty much everything other than the installers -->
|
---|
52 | </target>
|
---|
53 |
|
---|
54 | <target name="build" depends="_build-ai-jars, _build-demo">
|
---|
55 | <!-- this build should be enough to run the unittests without having to build a release package -->
|
---|
56 | </target>
|
---|
57 |
|
---|
58 | <target name="clean" description="Clean out compiled and generated files">
|
---|
59 | <echo message="*** *** Cleaning artifacts *** *** "/>
|
---|
60 | <echo message="*** ***"/>
|
---|
61 | <delete dir="${prepareDir}"/>
|
---|
62 | <delete file="./lib/ant-installer.jar"/>
|
---|
63 | <delete file="./lib/ant-installer-ext.jar"/>
|
---|
64 | </target>
|
---|
65 |
|
---|
66 | <target name="clean-demo" description="Clean out demo files">
|
---|
67 | <ant dir="demo" antfile="build-demo.xml" target="clean">
|
---|
68 | <property name="${installDir}" value="demo"/>
|
---|
69 | </ant>
|
---|
70 | </target>
|
---|
71 |
|
---|
72 |
|
---|
73 | <!-- =============================== -->
|
---|
74 | <!-- ======= Internal Targets ====== -->
|
---|
75 | <!-- =============================== -->
|
---|
76 |
|
---|
77 | <!--
|
---|
78 | tests that the following has been run locally
|
---|
79 | This does not need to be run repeatedly but unittests depend on it
|
---|
80 | # ant -buildfile demo/build-demo.xml
|
---|
81 | -->
|
---|
82 | <target name="_check-demo">
|
---|
83 | <condition property="installpack.missing">
|
---|
84 | <not>
|
---|
85 | <available file="demo/artifacts/installpack.zip" type="file"/>
|
---|
86 | </not>
|
---|
87 | </condition>
|
---|
88 | </target>
|
---|
89 |
|
---|
90 | <target name="_build-demo" if="installpack.missing" depends="_check-demo">
|
---|
91 | <echo message="requires demo build: ${installpack.missing}"/>
|
---|
92 | <ant dir="demo" antfile="build-demo.xml" target="selfextract">
|
---|
93 | <property name="${installDir}" value="demo"/>
|
---|
94 | </ant>
|
---|
95 | </target>
|
---|
96 |
|
---|
97 |
|
---|
98 | <target name="_build-ai-jars" depends="_ant-installer.jar, _ant-installer-ext.jar">
|
---|
99 | <!-- AntInstaller JARs are built in ./lib-->
|
---|
100 | <!-- (checked-in) JARs should not be used -->
|
---|
101 | </target>
|
---|
102 |
|
---|
103 | <target name="_ant-installer.jar">
|
---|
104 | <echo message="*** *** Building ant-installer.jar *** *** "/>
|
---|
105 | <echo message="*** ***"/>
|
---|
106 | <echo message="Initing the build directory - ${prepareDir}"/>
|
---|
107 | <mkdir dir="${prepareDir}/classes"/>
|
---|
108 |
|
---|
109 | <echo message="*** Building ant-installer.jar ***"/>
|
---|
110 | <mkdir dir="./lib"/>
|
---|
111 | <javac destdir="${prepareDir}/classes" srcdir="src" classpathref="project.cp" debug="true"/>
|
---|
112 | <jar file="./lib/ant-installer.jar" whenempty="fail">
|
---|
113 | <fileset dir="./src/resources">
|
---|
114 | <include name="LICENSE-ant-install.txt"/>
|
---|
115 | </fileset>
|
---|
116 | <fileset dir="${prepareDir}/classes"/>
|
---|
117 | <fileset dir="./src">
|
---|
118 | <include name="**/*.dtd"/>
|
---|
119 | <include name="**/*.properties"/>
|
---|
120 | <include name="**/*.fconfig"/>
|
---|
121 | <include name="resources/extract-image.png"/>
|
---|
122 | <include name="resources/gkmain_inv.png"/>
|
---|
123 | <include name="resources/antbar.png"/>
|
---|
124 | </fileset>
|
---|
125 | <manifest>
|
---|
126 | <attribute name="AntInstaller-Version" value="${ant.install.version}"/>
|
---|
127 | </manifest>
|
---|
128 | </jar>
|
---|
129 | </target>
|
---|
130 |
|
---|
131 | <target name="_ant-installer-ext.jar">
|
---|
132 | <echo message="*** *** Building ant-installer-ext.jar *** *** "/>
|
---|
133 | <echo message="*** ***"/>
|
---|
134 | <mkdir dir="${prepareDir}/classes_ext"/>
|
---|
135 | <javac destdir="${prepareDir}/classes_ext" srcdir="src_ext" classpathref="project.ext.cp" debug="true"/>
|
---|
136 | <jar file="./lib/ant-installer-ext.jar" whenempty="fail">
|
---|
137 | <fileset dir="./src/resources">
|
---|
138 | <include name="LICENSE-ant-install.txt"/>
|
---|
139 | </fileset>
|
---|
140 | <fileset dir="${prepareDir}/classes_ext"/>
|
---|
141 | <manifest>
|
---|
142 | <attribute name="AntInstaller-Version" value="${ant.install.version}"/>
|
---|
143 | </manifest>
|
---|
144 | </jar>
|
---|
145 | </target>
|
---|
146 |
|
---|
147 | </project>
|
---|