1 | <?xml version="1.0"?>
|
---|
2 | <!--
|
---|
3 |
|
---|
4 | This is the build.xml run by AntInstaller for the demo app
|
---|
5 |
|
---|
6 | It is a normal Ant build script, but remember that it is run in a similar
|
---|
7 | way to running
|
---|
8 | > ant -buildfile build.xml default,tgdoc,tgsrc
|
---|
9 |
|
---|
10 | this is targets selected in the selector page have dependencies those
|
---|
11 | dependencies may be run once for each target selected
|
---|
12 | e.g. if tgdoc had depends="default" and the installer passed
|
---|
13 | default,tgdoc ant would run default then default again then tgdoc
|
---|
14 |
|
---|
15 | To avoid this problem targets can be forced in the gui using the following
|
---|
16 | input in the page to choose components to install
|
---|
17 | <input
|
---|
18 | type="target"
|
---|
19 | displayText="Core components"
|
---|
20 | target="default"
|
---|
21 | defaultValue="true"
|
---|
22 | force="true"/>
|
---|
23 |
|
---|
24 | -->
|
---|
25 |
|
---|
26 | <project name="Installation Build" default="" basedir="${basedir}">
|
---|
27 |
|
---|
28 | <!-- this is required to pick up the properties generated during the install pages -->
|
---|
29 | <property file="${basedir}/ant.install.properties"/>
|
---|
30 |
|
---|
31 |
|
---|
32 | <target name="default" depends="">
|
---|
33 | <echo message="Colour selected [${colour}]"/>
|
---|
34 | <echo message="Installation Directory [${installDir}]"/>
|
---|
35 | <echo message="Entered Property [${myProperty}]"/>
|
---|
36 | <echo message="Checkbox Property [${truefalseprop}]"/>
|
---|
37 | <echo message="File [${selectedfile}]"/>
|
---|
38 | <mkdir dir="${basedir}/temp"/>
|
---|
39 | <unzip src="installpack.zip" dest="${basedir}/temp"/>
|
---|
40 | <mkdir dir="${installDir}"/>
|
---|
41 | <mkdir dir="${installDir}/classes"/>
|
---|
42 | <mkdir dir="${installDir}/config"/>
|
---|
43 | <mkdir dir="${installDir}/lib"/>
|
---|
44 | <copy file="${basedir}/temp/bin/run.sh" tofile="${installDir}/run.sh"/>
|
---|
45 | <copy file="${basedir}/temp/bin/run.cmd" tofile="${installDir}/run.cmd"/>
|
---|
46 | <chmod file="${installDir}/run.sh" perm="774">
|
---|
47 | </chmod>
|
---|
48 | <copy file="${basedir}/temp/README.txt" tofile="${installDir}"/>
|
---|
49 | <copy todir="${installDir}/classes">
|
---|
50 | <fileset dir="${basedir}/temp/classes"/>
|
---|
51 | </copy>
|
---|
52 | <copy todir="${installDir}/config">
|
---|
53 | <fileset dir="${basedir}/temp/config"/>
|
---|
54 | </copy>
|
---|
55 | <replace file="${installDir}/config/example-config.xml">
|
---|
56 | <replacefilter token="@TextProperty@" value="${myProperty}"/>
|
---|
57 | <replacefilter token="@SelectedFile@" value="${selectedfile}"/>
|
---|
58 | <replacefilter token="@Colour@" value="${colour}"/>
|
---|
59 | <replacefilter token="@Boolean@" value="${truefalseprop}"/>
|
---|
60 | </replace>
|
---|
61 | <replace file="${installDir}/config/demo.properties">
|
---|
62 | <replacefilter token="@TextProperty@" value="${myProperty}"/>
|
---|
63 | <replacefilter token="@SelectedFile@" value="${selectedfile}"/>
|
---|
64 | <replacefilter token="@Colour@" value="${colour}"/>
|
---|
65 | <replacefilter token="@Boolean@" value="${truefalseprop}"/>
|
---|
66 | </replace>
|
---|
67 | </target>
|
---|
68 |
|
---|
69 | <target name="tgdoc" depends="">
|
---|
70 | <echo message="Installing documentation files"/>
|
---|
71 | <mkdir dir="${installDir}/doc"/>
|
---|
72 | <copy todir="${installDir}/doc">
|
---|
73 | <fileset dir="${basedir}/temp/doc"/>
|
---|
74 | </copy>
|
---|
75 | </target>
|
---|
76 |
|
---|
77 | <target name="tgsrc" depends="">
|
---|
78 | <echo message="Installing Source files"/>
|
---|
79 | <mkdir dir="${installDir}/src"/>
|
---|
80 | <copy todir="${installDir}/src">
|
---|
81 | <fileset dir="${basedir}/temp/src"/>
|
---|
82 | </copy>
|
---|
83 | </target>
|
---|
84 |
|
---|
85 | <target name="cleanuptarget" depends="">
|
---|
86 | <delete dir="${basedir}/temp">
|
---|
87 | </delete>
|
---|
88 | </target>
|
---|
89 | </project>
|
---|