| 1 |
<?xml version="1.0"?> |
| 2 |
<!-- |
| 3 |
This Ant script is used to package parts of the demo app to create an installer |
| 4 |
the selfextract target shows an example of creating a self extracting jar for the demo app |
| 5 |
run with ... |
| 6 |
ant -Dmaven.local.repo=XXX -buildfile build-demo.xml |
| 7 |
|
| 8 |
--> |
| 9 |
|
| 10 |
<project name="Create PAL Portal Installer Zip Build" default="selfextract" basedir="."> |
| 11 |
|
| 12 |
<target name="selfextract" depends="copystuff,buildZipPack"> |
| 13 |
|
| 14 |
<copy todir="${dist.selfextract.dir}"> |
| 15 |
<fileset dir="${installer.resources.dir}/installclasspath"> |
| 16 |
<include name="resources/*"/> |
| 17 |
</fileset> |
| 18 |
</copy> |
| 19 |
<copy todir="${dist.selfextract.dir}"> |
| 20 |
<fileset dir="${installer.resources.dir}"> |
| 21 |
<include name="build.xml"/> |
| 22 |
</fileset> |
| 23 |
<fileset file="${dist.installpack.file}"/> |
| 24 |
<fileset dir="${dist.build.dir}"> |
| 25 |
<include name="antinstall-config.xml"/> |
| 26 |
</fileset> |
| 27 |
<!--fileset dir="${dist.portlets.dir}"/--> |
| 28 |
</copy> |
| 29 |
<!--copy todir="${dist.selfextract.dir}/portlet_apps"> |
| 30 |
<fileset dir="${dist.portlets.dir}"/> |
| 31 |
</copy--> |
| 32 |
<copy todir="${dist.selfextract.dir}/temp"> |
| 33 |
<fileset dir="${dist.temp.dir}"/> |
| 34 |
</copy> |
| 35 |
<copy todir="${dist.selfextract.dir}/database"> |
| 36 |
<fileset dir="${dist.database.dir}"/> |
| 37 |
</copy> |
| 38 |
<echo message="Building PAL Portal ${portal.version} SELFEXTRACT"/> |
| 39 |
<jar file="${dist.dir}/${dist.name.prefix}-install-${portal.version}.jar" compress="true"> |
| 40 |
<manifest> |
| 41 |
<attribute name="Manifest-Version" value="1.0"/> |
| 42 |
<attribute name="Main-Class" value="org.tp23.antinstaller.selfextract.SelfExtractor"/> |
| 43 |
<attribute name="Look-And-Feel" value="org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel"/> |
| 44 |
</manifest> |
| 45 |
<fileset dir="${dist.selfextract.dir}"> |
| 46 |
<include name="**/*"/> |
| 47 |
</fileset> |
| 48 |
<zipgroupfileset dir="${installer.resources.dir}/installlib" includes="*.jar"/> |
| 49 |
</jar> |
| 50 |
</target> |
| 51 |
|
| 52 |
<target name="copystuff" > |
| 53 |
<!-- this target assumes we're located in the top level of jetspeed-2 --> |
| 54 |
<!-- get the base tomcat install --> |
| 55 |
<!-- first download the zip files --> |
| 56 |
<echo> now downloading tomcat installs.. this may take a while </echo> |
| 57 |
<get usetimestamp="true" dest="${dist.tomcat.base.file}" src="${dist.tomcat.base.url}" /> |
| 58 |
<get usetimestamp="true" dest="${dist.tomcat.compat.file}" src="${dist.tomcat.compat.url}" /> |
| 59 |
<!-- now unzip them --> |
| 60 |
<echo> done with downloads, now unzipping </echo> |
| 61 |
<unzip src="${dist.tomcat.base.file}" dest="${dist.tomcat.base.dir}" /> |
| 62 |
<unzip src="${dist.tomcat.compat.file}" dest="${dist.tomcat.compat.dir}" /> |
| 63 |
<copy todir="${dist.portal.dir}" > |
| 64 |
<fileset dir="${dist.tomcat.base.dir}/apache-tomcat-${dist.tomcat.version}" > |
| 65 |
<include name="**/*" /> |
| 66 |
</fileset> |
| 67 |
<fileset dir="${dist.tomcat.compat.dir}/apache-tomcat-${dist.tomcat.version}" > |
| 68 |
<include name="**/*" /> |
| 69 |
</fileset> |
| 70 |
</copy> |
| 71 |
|
| 72 |
<echo> updating server configuration </echo> |
| 73 |
<copy file="${installer.resources.dir}/server.xml" tofile="${dist.portal.dir}/conf/server.xml" overwrite="true" /> |
| 74 |
<echo> updating tomcat users </echo> |
| 75 |
<copy file="${installer.resources.dir}/tomcat-users.xml" tofile="${dist.portal.dir}/conf/tomcat-users.xml" overwrite="true" /> |
| 76 |
<echo> replacing startup files with ones with larger heap size </echo> |
| 77 |
<copy file="${installer.resources.dir}/catalina.sh" tofile="${dist.portal.dir}/bin/catalina.sh" overwrite="true" /> |
| 78 |
<copy file="${installer.resources.dir}/catalina.bat" tofile="${dist.portal.dir}/bin/catalina.bat" overwrite="true" /> |
| 79 |
<echo> done with tomcat users </echo> |
| 80 |
<mkdir dir="${dist.temp.dir}" /> |
| 81 |
<copy todir="${dist.temp.dir}" > |
| 82 |
<fileset dir="${portal.dir}/etc/conf/tomcat/" > |
| 83 |
<filename name="**/jetspeed-tomcat-5.5.xml" /> |
| 84 |
</fileset> |
| 85 |
<fileset dir="${installer.resources.dir}" > |
| 86 |
<filename name="administration.xml" /> |
| 87 |
</fileset> |
| 88 |
</copy> |
| 89 |
|
| 90 |
<mkdir dir="${dist.portal.dir}/temp" /> |
| 91 |
<mkdir dir="${dist.portal.dir}/shared/classes" /> |
| 92 |
<mkdir dir="${dist.portal.dir}/shared/lib" /> |
| 93 |
<touch file="${dist.portal.dir}/logs/catalina.out" /> |
| 94 |
<touch file="${dist.portal.dir}/temp/zipsucks" /> |
| 95 |
<!--touch file="${dist.portal.dir}/webapps/${org.apache.jetspeed.portal.artifactId}/WEB-INF/deploy/zipsucks" /--> |
| 96 |
|
| 97 |
<!-- get the database scripts --> |
| 98 |
<copy todir="${dist.database.dir}" > |
| 99 |
<fileset dir="${portal.dir}/etc/sql" > |
| 100 |
<include name="**/*.sql" /> |
| 101 |
</fileset> |
| 102 |
</copy> |
| 103 |
<copy file='${dist.database.dir}/populate-userinfo-for-default-psml.sql' |
| 104 |
tofile="${dist.database.dir}/derby/populate-userinfo-for-default-psml.sql"/> |
| 105 |
</target> |
| 106 |
|
| 107 |
<!-- N.B. |
| 108 |
this target does nothing in the deployed version |
| 109 |
and exists for preparing the files to deploy to sourceforge |
| 110 |
--> |
| 111 |
<target name="buildZipPack" depends="copystuff" > |
| 112 |
<zip file="${dist.installpack.file}"> |
| 113 |
<zipfileset dir="${dist.portal.dir}"> |
| 114 |
<!-- |
| 115 |
<include name="bin/**/*"/> |
| 116 |
<include name="classes/**/*"/> |
| 117 |
<include name="config/**/*"/> |
| 118 |
<include name="doc/**/*"/> |
| 119 |
<include name="src/**/*"/> |
| 120 |
<include name="README.txt"/> |
| 121 |
<include name="DEMO-README.txt"/> |
| 122 |
<exclude name="**/CVS/*"/> |
| 123 |
--> |
| 124 |
</zipfileset> |
| 125 |
</zip> |
| 126 |
</target> |
| 127 |
|
| 128 |
<target name="cleanDLs" > |
| 129 |
<delete file="${dist.tomcat.base.file}" failonerror="false" /> |
| 130 |
<delete file="${dist.tomcat.compat.file}" failonerror="false" /> |
| 131 |
</target> |
| 132 |
|
| 133 |
<target name="clean"> |
| 134 |
<delete dir="${dist.portal.dir}" failonerror="false" /> |
| 135 |
<delete dir="${dist.temp.dir}" failonerror="false" /> |
| 136 |
<delete file="${dist.installpack.file}" failonerror="false" /> |
| 137 |
<delete dir="${dist.tomcat.base.dir}" failonerror="false" /> |
| 138 |
<delete dir="${dist.tomcat.compat.dir}" failonerror="false" /> |
| 139 |
<delete dir="${dist.selfextract.dir}" failonerror="false" /> |
| 140 |
<delete dir="${dist.database.dir}" failonerror="false" /> |
| 141 |
<delete dir="${dist.portlets.dir}" failonerror="false" /> |
| 142 |
</target> |
| 143 |
|
| 144 |
<target name="build.portletpack"> |
| 145 |
<zip file="${dist.portletpack.file}-${portal.version}.zip"> |
| 146 |
<zipfileset dir="${dist.portlets.dir}" |
| 147 |
includes="*.war" |
| 148 |
excludes="${dist.porletpack.excludes}" |
| 149 |
/> |
| 150 |
</zip> |
| 151 |
</target> |
| 152 |
|
| 153 |
<target name="build.allportletpack"> |
| 154 |
<zip file="${dist.portletpack.file}-all-${portal.version}.zip"> |
| 155 |
<zipfileset dir="${dist.portlets.dir}"> |
| 156 |
<include name="*.war"/> |
| 157 |
</zipfileset> |
| 158 |
</zip> |
| 159 |
</target> |
| 160 |
|
| 161 |
</project> |