1 | <?xml version="1.0"?>
|
---|
2 | <!--
|
---|
3 | This is the build.xml run by AntInstaller for the installer
|
---|
4 | -->
|
---|
5 |
|
---|
6 | <project name="Installation" default="" basedir="${basedir}">
|
---|
7 |
|
---|
8 | <!-- this is required to pick up the properties generated during the install pages -->
|
---|
9 | <property file="${basedir}/ant.install.properties"/>
|
---|
10 |
|
---|
11 | <path id="project.classpath">
|
---|
12 | <pathelement path="${antinstaller.jar}"/>
|
---|
13 | </path>
|
---|
14 |
|
---|
15 | <!-- custom tasks -->
|
---|
16 | <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
|
---|
17 |
|
---|
18 | <target name="default" depends="">
|
---|
19 |
|
---|
20 | <!-- create the installation directory -->
|
---|
21 | <echo message="Creating Installation directory"/>
|
---|
22 | <echo>basedir: ${basedir}</echo>
|
---|
23 | <echo>installDir: ${installDir}</echo>
|
---|
24 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
25 | <mkdir dir="${installDir}"/>
|
---|
26 |
|
---|
27 | <!-- install binaries -->
|
---|
28 | <echo message="Installing Executable Binaries (bin)"/>
|
---|
29 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="bin/**/*"/></patternset></unzip>
|
---|
30 | <echo/>
|
---|
31 |
|
---|
32 | <echo message="Installing Documentation (docs)"/>
|
---|
33 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="docs/**/*"/></patternset></unzip>
|
---|
34 | <echo/>
|
---|
35 |
|
---|
36 | <echo message="Installing GLI (gli)"/>
|
---|
37 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gli/**/*"/></patternset></unzip>
|
---|
38 | <echo/>
|
---|
39 |
|
---|
40 | <echo message="Installing gs2build (gs2build)"/>
|
---|
41 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gs2build/**/*"/></patternset></unzip>
|
---|
42 | <echo/>
|
---|
43 |
|
---|
44 | <echo message="Installing Libraries (lib)"/>
|
---|
45 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="lib/**/*"/></patternset></unzip>
|
---|
46 | <echo/>
|
---|
47 |
|
---|
48 | <echo message="Installing Web Content (web)"/>
|
---|
49 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="web/**/*"/></patternset></unzip>
|
---|
50 | <echo/>
|
---|
51 |
|
---|
52 | <echo message="Installing Packages (packages)"/>
|
---|
53 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/**/*"/></patternset></unzip>
|
---|
54 | <echo/>
|
---|
55 |
|
---|
56 | <echo message="Installing Resources (resources)"/>
|
---|
57 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="resources/**/*"/></patternset></unzip>
|
---|
58 | <echo/>
|
---|
59 |
|
---|
60 | <echo message="Installing Windows Utility Commands (winutil)"/>
|
---|
61 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="winutil/**/*"/></patternset></unzip>
|
---|
62 | <echo/>
|
---|
63 |
|
---|
64 |
|
---|
65 | <echo message="Installing Top Level Files"/>
|
---|
66 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
67 | <patternset>
|
---|
68 | <include name="build.xml"/>
|
---|
69 | <include name="build.properties"/>
|
---|
70 | <include name="gs3-server.bat"/>
|
---|
71 | <include name="gs3-setup.bat"/>
|
---|
72 | <include name="LICENSE.txt"/>
|
---|
73 | <include name="README.txt"/>
|
---|
74 | <include name="server.jar"/>
|
---|
75 | </patternset>
|
---|
76 | </unzip>
|
---|
77 | <echo/>
|
---|
78 |
|
---|
79 | <!-- change the tomcat ports in build.properties -->
|
---|
80 | <echo message="Changing tomcat ports in build.properties"/>
|
---|
81 | <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
|
---|
82 | <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
|
---|
83 |
|
---|
84 | <!-- change the tomcat ports in tomcats server.xml -->
|
---|
85 | <echo message="Changing tomcat ports tomcat's server.xml"/>
|
---|
86 | <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
|
---|
87 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
88 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
|
---|
89 |
|
---|
90 | <!-- copy the greenstone3.xml file to tomcat -->
|
---|
91 | <echo message="Copying greenstone3.xml to tomcat directory"/>
|
---|
92 | <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
|
---|
93 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
|
---|
94 |
|
---|
95 | <!-- set up global properties -->
|
---|
96 | <echo message="Setting up global properties"/>
|
---|
97 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
98 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
99 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
|
---|
100 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
|
---|
101 |
|
---|
102 | <!-- set up log4j properties-->
|
---|
103 | <echo message="Setting up log4j properties"/>
|
---|
104 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
105 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
|
---|
106 |
|
---|
107 | <!-- get the found JRE_HOME -->
|
---|
108 | <exec executable="cmd" dir="${installDir}" outputproperty="backup.jre.home"><arg line="/C launch-installer.exe -find"/></exec>
|
---|
109 |
|
---|
110 | <!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH, and set the fallback JRE_HOME -->
|
---|
111 | <echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo>
|
---|
112 | <exec executable="cmd" output="${installDir}/machine.bat" append="true"><arg line="/C echo set ANT_HOME=${installDir}/packages/ant"/></exec>
|
---|
113 | <exec executable="cmd" output="${installDir}/machine.bat" append="true"><arg line="/C echo set PATH=\%ANT_HOME\%/bin:\%PATH\%"/></exec>
|
---|
114 | <exec executable="cmd" output="${installDir}/machine.bat" append="true"><arg line="/C echo set BACKUP_JRE_HOME=${backup.jre.home}"/></exec>
|
---|
115 |
|
---|
116 | <!-- delete unneeded files -->
|
---|
117 | <delete dir="${installDir}/resources/icons"/>
|
---|
118 | <delete file="${installDir}/resources/*.png"/>
|
---|
119 |
|
---|
120 | </target>
|
---|
121 |
|
---|
122 | <!-- Source -->
|
---|
123 | <target name="tgsrc" depends="">
|
---|
124 | <echo message="Installing Source Code (src)"/>
|
---|
125 | <mkdir dir="${installDir}/src"/>
|
---|
126 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
127 | <patternset>
|
---|
128 | <include name="src/**/*"/>
|
---|
129 | </patternset>
|
---|
130 | </unzip>
|
---|
131 | </target>
|
---|
132 |
|
---|
133 | <target name="cleanuptarget">
|
---|
134 | </target>
|
---|
135 |
|
---|
136 |
|
---|
137 | </project>
|
---|