[15023] | 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 |
|
---|
[15095] | 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 |
|
---|
[15023] | 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"/>
|
---|
[15095] | 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="@port@" replacement="${tomcat.port}" />
|
---|
| 95 | <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
|
---|
[15023] | 96 |
|
---|
| 97 | <!-- copy the greenstone3.xml file to tomcat -->
|
---|
| 98 | <echo message="Copying greenstone3.xml to tomcat directory"/>
|
---|
| 99 | <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
|
---|
[15095] | 100 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" />
|
---|
[15023] | 101 |
|
---|
| 102 | <!-- set up global properties -->
|
---|
| 103 | <echo message="Setting up global properties"/>
|
---|
| 104 | <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
|
---|
[15095] | 105 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
|
---|
| 106 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.server@" replacement="${tomcat.server}" />
|
---|
| 107 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.port@" replacement="${tomcat.port}" />
|
---|
[15023] | 108 |
|
---|
| 109 | <!-- set up log4j properties-->
|
---|
| 110 | <echo message="Setting up log4j properties"/>
|
---|
| 111 | <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
|
---|
[15095] | 112 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
|
---|
[15023] | 113 |
|
---|
[15053] | 114 | <!-- get the found JRE_HOME -->
|
---|
[15095] | 115 | <exec executable="search4j.exe" outputproperty="backup.jre.home"><arg line="-m @java.min.version@"/></exec>
|
---|
[15053] | 116 |
|
---|
| 117 | <!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH, and set the fallback JRE_HOME -->
|
---|
[15023] | 118 | <echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo>
|
---|
[15095] | 119 | <concat destfile="${installDir}/machine.bat" append="yes">
|
---|
| 120 | set ANT_HOME=${installDir}\packages\ant
|
---|
| 121 | set PATH=%ANT_HOME%\bin;%PATH%
|
---|
| 122 | set BACKUP_JAVA_HOME=${backup.jre.home}
|
---|
| 123 | </concat>
|
---|
| 124 |
|
---|
[15023] | 125 |
|
---|
| 126 | <!-- delete unneeded files -->
|
---|
| 127 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 128 | <delete file="${installDir}/resources/*.png"/>
|
---|
| 129 |
|
---|
| 130 | </target>
|
---|
| 131 |
|
---|
| 132 | <!-- Source -->
|
---|
| 133 | <target name="tgsrc" depends="">
|
---|
| 134 | <echo message="Installing Source Code (src)"/>
|
---|
| 135 | <mkdir dir="${installDir}/src"/>
|
---|
| 136 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 137 | <patternset>
|
---|
| 138 | <include name="src/**/*"/>
|
---|
| 139 | </patternset>
|
---|
| 140 | </unzip>
|
---|
| 141 | </target>
|
---|
| 142 |
|
---|
| 143 | <target name="cleanuptarget">
|
---|
| 144 | </target>
|
---|
| 145 |
|
---|
| 146 |
|
---|
| 147 | </project>
|
---|