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 [${TextProperty}]"/>
|
---|
36 | <echo message="Checkbox Property [${BooleanProperty}]"/>
|
---|
37 | <echo message="File [${SelectedFile}]"/>
|
---|
38 | <!-- this is an exagerated example
|
---|
39 | clearly
|
---|
40 | <unzip src="installpack.zip" dest="${basedir}/temp"/>
|
---|
41 | <replace ...
|
---|
42 | would be sufficient
|
---|
43 | -->
|
---|
44 | <mkdir dir="${basedir}/temp"/>
|
---|
45 | <unzip src="installpack.zip" dest="${basedir}/temp"/>
|
---|
46 | <mkdir dir="${installDir}"/>
|
---|
47 | <mkdir dir="${installDir}/classes"/>
|
---|
48 | <mkdir dir="${installDir}/config"/>
|
---|
49 | <mkdir dir="${installDir}/lib"/>
|
---|
50 | <copy
|
---|
51 | file="${basedir}/temp/bin/run.sh"
|
---|
52 | tofile="${installDir}/run.sh"
|
---|
53 | overwrite="true"/>
|
---|
54 | <copy
|
---|
55 | file="${basedir}/temp/bin/run.cmd"
|
---|
56 | tofile="${installDir}/run.cmd"
|
---|
57 | overwrite="true"/>
|
---|
58 | <chmod file="${installDir}/run.sh" perm="774"/>
|
---|
59 | <copy
|
---|
60 | file="${basedir}/temp/README.txt"
|
---|
61 | todir="${installDir}"
|
---|
62 | overwrite="true"/>
|
---|
63 | <copy
|
---|
64 | todir="${installDir}/classes"
|
---|
65 | overwrite="true">
|
---|
66 | <fileset dir="${basedir}/temp/classes"/>
|
---|
67 | </copy>
|
---|
68 | <copy
|
---|
69 | todir="${installDir}/config"
|
---|
70 | overwrite="true">
|
---|
71 | <fileset dir="${basedir}/temp/config"/>
|
---|
72 | </copy>
|
---|
73 | <replace file="${installDir}/config/example-config.xml">
|
---|
74 | <replacefilter token="@TextProperty@" value="${TextProperty}"/>
|
---|
75 | <replacefilter token="@SelectedFile@" value="${SelectedFile}"/>
|
---|
76 | <replacefilter token="@Colour@" value="${Colour}"/>
|
---|
77 | <replacefilter token="@BooleanProperty@" value="${BooleanProperty}"/>
|
---|
78 | </replace>
|
---|
79 | <replace file="${installDir}/config/demo.properties">
|
---|
80 | <replacefilter token="@TextProperty@" value="${TextProperty}"/>
|
---|
81 | <replacefilter token="@SelectedFile@" value="${SelectedFile}"/>
|
---|
82 | <replacefilter token="@Colour@" value="${Colour}"/>
|
---|
83 | <replacefilter token="@BooleanProperty@" value="${BooleanProperty}"/>
|
---|
84 | </replace>
|
---|
85 | </target>
|
---|
86 |
|
---|
87 | <target name="tgdoc" depends="">
|
---|
88 | <echo message="Installing documentation files"/>
|
---|
89 | <mkdir dir="${installDir}/doc"/>
|
---|
90 | <copy todir="${installDir}/doc" overwrite="true">
|
---|
91 | <fileset dir="${basedir}/temp/doc"/>
|
---|
92 | </copy>
|
---|
93 | </target>
|
---|
94 |
|
---|
95 | <target name="tgsrc" depends="">
|
---|
96 | <echo message="Installing Source files"/>
|
---|
97 | <mkdir dir="${installDir}/src"/>
|
---|
98 | <copy todir="${installDir}/src" overwrite="true">
|
---|
99 | <fileset dir="${basedir}/temp/src"/>
|
---|
100 | </copy>
|
---|
101 | </target>
|
---|
102 |
|
---|
103 | <target name="cleanuptarget" depends="">
|
---|
104 | <delete dir="${basedir}/temp">
|
---|
105 | </delete>
|
---|
106 | </target>
|
---|
107 | </project>
|
---|