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 | <!-- create a local installDir String -->
|
---|
19 | <path id="installDir.path">
|
---|
20 | <pathelement location="${installDir}"/>
|
---|
21 | </path>
|
---|
22 | <property name="installDir.local" refid="installDir.path"/>
|
---|
23 |
|
---|
24 |
|
---|
25 | <target name="default" depends="">
|
---|
26 |
|
---|
27 | <!-- create the installation directory -->
|
---|
28 | <echo message="Creating Installation directory"/>
|
---|
29 | <echo>basedir: ${basedir}</echo>
|
---|
30 | <echo>installDir: ${installDir}</echo>
|
---|
31 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
32 | <mkdir dir="${installDir}"/>
|
---|
33 |
|
---|
34 | <!-- install binaries -->
|
---|
35 | <echo message="Installing Executable Binaries (bin)"/>
|
---|
36 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="bin/**/*"/></patternset></unzip>
|
---|
37 | <echo/>
|
---|
38 |
|
---|
39 | <echo message="Installing Documentation (docs)"/>
|
---|
40 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="docs/**/*"/></patternset></unzip>
|
---|
41 | <echo/>
|
---|
42 |
|
---|
43 | <echo message="Installing GLI (gli)"/>
|
---|
44 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gli/**/*"/></patternset></unzip>
|
---|
45 | <echo/>
|
---|
46 |
|
---|
47 | <echo message="Installing gs2build (gs2build)"/>
|
---|
48 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gs2build/**/*"/></patternset></unzip>
|
---|
49 | <echo/>
|
---|
50 |
|
---|
51 | <echo message="Installing Libraries (lib)"/>
|
---|
52 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="lib/**/*"/></patternset></unzip>
|
---|
53 | <echo/>
|
---|
54 |
|
---|
55 | <echo message="Installing Web Content (web)"/>
|
---|
56 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="web/**/*"/></patternset></unzip>
|
---|
57 | <echo/>
|
---|
58 |
|
---|
59 | <echo message="Installing Packages (packages)"/>
|
---|
60 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/**/*"/></patternset></unzip>
|
---|
61 | <echo/>
|
---|
62 |
|
---|
63 | <echo message="Installing Resources (resources)"/>
|
---|
64 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="resources/**/*"/></patternset></unzip>
|
---|
65 | <echo/>
|
---|
66 |
|
---|
67 | <echo message="Installing Windows Utility Commands (winutil)"/>
|
---|
68 | <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="winutil/**/*"/></patternset></unzip>
|
---|
69 | <echo/>
|
---|
70 |
|
---|
71 |
|
---|
72 | <echo message="Installing Top Level Files"/>
|
---|
73 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
74 | <patternset>
|
---|
75 | <include name="build.xml"/>
|
---|
76 | <include name="build.properties"/>
|
---|
77 | <include name="gs3-server.bat"/>
|
---|
78 | <include name="gs3-setup.bat"/>
|
---|
79 | <include name="LICENSE.txt"/>
|
---|
80 | <include name="README.txt"/>
|
---|
81 | <include name="server.jar"/>
|
---|
82 | </patternset>
|
---|
83 | </unzip>
|
---|
84 | <echo/>
|
---|
85 |
|
---|
86 | <!-- change the tomcat ports in build.properties -->
|
---|
87 | <echo message="Changing tomcat ports in build.properties"/>
|
---|
88 | <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
|
---|
89 | <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
|
---|
90 |
|
---|
91 | <!-- change the tomcat ports in tomcats server.xml -->
|
---|
92 | <echo message="Changing tomcat ports tomcat's server.xml"/>
|
---|
93 | <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/>
|
---|
94 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@server@" replacement="${tomcat.server}" />
|
---|
95 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" />
|
---|
96 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
|
---|
97 |
|
---|
98 | <!-- copy the greenstone3.xml file to tomcat -->
|
---|
99 | <echo message="Copying greenstone3.xml to tomcat directory"/>
|
---|
100 | <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
|
---|
101 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" />
|
---|
102 |
|
---|
103 | <!-- set up global properties -->
|
---|
104 | <echo message="Setting up global properties"/>
|
---|
105 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
106 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
|
---|
107 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.server@" replacement="${tomcat.server}" />
|
---|
108 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.port@" replacement="${tomcat.port}" />
|
---|
109 |
|
---|
110 | <!-- set up log4j properties-->
|
---|
111 | <echo message="Setting up log4j properties"/>
|
---|
112 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
113 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
|
---|
114 |
|
---|
115 | <!-- get the found JRE_HOME -->
|
---|
116 | <exec executable="search4j.exe" outputproperty="backup.jre.home"><arg line="-m @java.min.version@"/></exec>
|
---|
117 |
|
---|
118 | <!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH, and set the fallback JRE_HOME -->
|
---|
119 | <!--<echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo>
|
---|
120 | <concat destfile="${installDir}/machine.bat" append="yes">
|
---|
121 | set ANT_HOME=${installDir}\packages\ant
|
---|
122 | set PATH=%ANT_HOME%\bin;%PATH%
|
---|
123 | set BACKUP_JAVA_HOME=${backup.jre.home}
|
---|
124 | </concat>-->
|
---|
125 |
|
---|
126 |
|
---|
127 | <!-- delete unneeded files -->
|
---|
128 | <delete dir="${installDir}/resources/icons"/>
|
---|
129 | <delete file="${installDir}/resources/*.png"/>
|
---|
130 |
|
---|
131 | </target>
|
---|
132 |
|
---|
133 | <!-- Source -->
|
---|
134 | <target name="tgsrc" depends="">
|
---|
135 | <echo message="Installing Source Code (src)"/>
|
---|
136 | <mkdir dir="${installDir}/src"/>
|
---|
137 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
138 | <patternset>
|
---|
139 | <include name="src/**/*"/>
|
---|
140 | </patternset>
|
---|
141 | </unzip>
|
---|
142 | </target>
|
---|
143 |
|
---|
144 | <target name="cleanuptarget">
|
---|
145 | </target>
|
---|
146 |
|
---|
147 |
|
---|
148 | </project>
|
---|