NIHVIVO-2811 getting closer - need a way of "copying" a directory that may not exist.
This commit is contained in:
parent
def608dcda
commit
11239bf040
9 changed files with 565 additions and 226 deletions
|
@ -13,29 +13,30 @@
|
|||
<!-- - - - - - - - - - - - - - - - - -
|
||||
properties
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<property name="corebase.dir" location="." />
|
||||
|
||||
<!--
|
||||
If calling from a Product build script, these properties already point to
|
||||
the product-related locations, so setting them here has no effect.
|
||||
-->
|
||||
<property name="appbase.dir" location="${corebase.dir}" />
|
||||
<property name="build.dir" location=".build" />
|
||||
<property name="webapp.dir" location="." />
|
||||
<property name="deploy.properties.file" location="config/deploy.properties" />
|
||||
|
||||
<property name="war.dir" location="${build.dir}/war" />
|
||||
<property name="war-webinf.dir" location="${war.dir}/WEB-INF" />
|
||||
<property name="war-classes.dir" location="${war-webinf.dir}/classes" />
|
||||
<property name="war-resources.dir" location="${war-webinf.dir}/resources" />
|
||||
<property name="war-lib.dir" location="${war-webinf.dir}/lib" />
|
||||
|
||||
<property name="test-classes.dir" location="${build.dir}/testclasses" />
|
||||
|
||||
<property name="servletjars.dir" location="${build.dir}/servletjars" />
|
||||
|
||||
<property name="javac.deprecation" value="true" />
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
paths: for compiling and running
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<path id="compile.classpath">
|
||||
<fileset dir="${war-lib.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${servletjars.dir}">
|
||||
<fileset dir="${appbase.dir}/lib">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
@ -46,9 +47,7 @@
|
|||
</path>
|
||||
|
||||
<path id="test.run.classpath">
|
||||
<!-- This holds data files and a special log4j.properties -->
|
||||
<pathelement location="${webapp.dir}/test" />
|
||||
|
||||
<pathelement location="${appbase.dir}/test" />
|
||||
<pathelement location="${test-classes.dir}" />
|
||||
<path refid="test.compile.classpath" />
|
||||
</path>
|
||||
|
@ -77,12 +76,6 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
target: properties
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="properties">
|
||||
<!--
|
||||
If calling from a Product build script, then this property
|
||||
already points to the deploy.properties file of the Product.
|
||||
-->
|
||||
<property name="deploy.properties.file" location="config/deploy.properties" />
|
||||
|
||||
<fail message="You must create a "${deploy.properties.file}" file.">
|
||||
<condition>
|
||||
<not>
|
||||
|
@ -118,7 +111,7 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
</condition>
|
||||
</fail>
|
||||
|
||||
<property name="solr.home" location="${vitro.home.directory}/solr" />
|
||||
<property name="solr.home.dir" location="${vitro.home.directory}/solr" />
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
|
@ -126,7 +119,7 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
================================= -->
|
||||
<target name="clean" depends="properties" description="--> Delete all artifacts.">
|
||||
<delete dir="${build.dir}" />
|
||||
<delete dir="${solr.home}" excludes="data/**/*" includeemptydirs="true" />
|
||||
<delete dir="${solr.home.dir}" excludes="data/**/*" includeemptydirs="true" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
|
@ -140,7 +133,7 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
|
||||
<!-- copy all sorts of web stuff (with or without themes) into the war directory. -->
|
||||
<copy todir="${war.dir}">
|
||||
<fileset dir="${webapp.dir}/web">
|
||||
<fileset dir="${appbase.dir}/web">
|
||||
<!--
|
||||
If a product doesn't want the core themes, it can
|
||||
set this property and they will be skipped.
|
||||
|
@ -150,7 +143,7 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
</copy>
|
||||
|
||||
<copy todir="${war-webinf.dir}">
|
||||
<fileset dir="${webapp.dir}">
|
||||
<fileset dir="${appbase.dir}">
|
||||
<!-- copy the JARs into the war directory -->
|
||||
<include name="lib/*" />
|
||||
<!-- these are already in Tomcat: we mustn't conflict. -->
|
||||
|
@ -160,10 +153,10 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
</copy>
|
||||
|
||||
<!-- use the production Log4J properties, unless a debug version exists. -->
|
||||
<available file="${webapp.dir}/config/debug.log4j.properties"
|
||||
<available file="${appbase.dir}/config/debug.log4j.properties"
|
||||
property="debug.log4j.exists" />
|
||||
<copy tofile="${war-classes.dir}/log4j.properties" filtering="true" overwrite="true">
|
||||
<fileset dir="${webapp.dir}/config">
|
||||
<fileset dir="${appbase.dir}/config">
|
||||
<include name="default.log4j.properties" unless="debug.log4j.exists" />
|
||||
<include name="debug.log4j.properties" if="debug.log4j.exists" />
|
||||
</fileset>
|
||||
|
@ -177,19 +170,11 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
<fileset file="${deploy.properties.file}" />
|
||||
|
||||
<!-- copy any xml files from source tree to the war directory -->
|
||||
<fileset dir="${webapp.dir}/src" includes="**/*.xml" />
|
||||
</copy>
|
||||
|
||||
<!-- copy the servlet JARs into their own directory, to compile against. -->
|
||||
<copy todir="${servletjars.dir}">
|
||||
<fileset dir="${webapp.dir}/lib">
|
||||
<include name="jsp-api.jar" />
|
||||
<include name="servlet-api.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${appbase.dir}/src" includes="**/*.xml" />
|
||||
</copy>
|
||||
|
||||
<!-- copy the context file into the war directory -->
|
||||
<copy file="${webapp.dir}/context.xml" tofile="${war.dir}/META-INF/context.xml" />
|
||||
<copy file="${appbase.dir}/context.xml" tofile="${war.dir}/META-INF/context.xml" />
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
|
@ -197,14 +182,14 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
================================= -->
|
||||
<target name="compile" depends="prepare" description="--> Compile Java sources">
|
||||
<!-- deletes all files that depend on changed .java files -->
|
||||
<depend srcdir="${webapp.dir}/src"
|
||||
<depend srcdir="${appbase.dir}/src"
|
||||
destdir="${war-classes.dir}"
|
||||
closure="false"
|
||||
cache="${build.dir}/.depcache">
|
||||
<classpath refid="compile.classpath" />
|
||||
</depend>
|
||||
|
||||
<javac srcdir="${webapp.dir}/src"
|
||||
<javac srcdir="${appbase.dir}/src"
|
||||
destdir="${war-classes.dir}"
|
||||
debug="true"
|
||||
deprecation="${javac.deprecation}"
|
||||
|
@ -220,7 +205,7 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
target: test
|
||||
================================= -->
|
||||
<target name="test" depends="compile" unless="skiptests" description="--> Run JUnit tests">
|
||||
<javac srcdir="${webapp.dir}/test"
|
||||
<javac srcdir="${appbase.dir}/test"
|
||||
destdir="${test-classes.dir}"
|
||||
debug="true"
|
||||
deprecation="${javac.deprecation}"
|
||||
|
@ -235,7 +220,7 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
fork="yes"
|
||||
failonerror="true">
|
||||
<classpath refid="test.run.classpath" />
|
||||
<arg file="${webapp.dir}/test" />
|
||||
<arg file="${appbase.dir}/test" />
|
||||
<arg value="${testlevel}" />
|
||||
</java>
|
||||
</target>
|
||||
|
@ -258,7 +243,7 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
<echo file="${revisionInfo.build.file}">${revisionInfo.timestamp}
|
||||
</echo>
|
||||
|
||||
<javac srcdir="${webapp.dir}/../utilities/buildutils/revisioninfo"
|
||||
<javac srcdir="${appbase.dir}/../utilities/buildutils/revisioninfo"
|
||||
destdir="${test-classes.dir}"
|
||||
debug="true"
|
||||
deprecation="${javac.deprecation}"
|
||||
|
@ -282,19 +267,19 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
target: prepareSolr
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="prepareSolr" depends="properties">
|
||||
<property name="solr.distrib.dir" location="${webapp.dir}/../solr" />
|
||||
<property name="solr.distrib.dir" location="${appbase.dir}/../solr" />
|
||||
<property name="solr.example.dir" location="${solr.distrib.dir}/exampleSolr" />
|
||||
<property name="solr.context.config.example"
|
||||
location="${solr.distrib.dir}/exampleSolrContext.xml" />
|
||||
<property name="solr.war" location="${solr.distrib.dir}/apache-solr-3.1.0.war" />
|
||||
|
||||
<property name="solr.docbase" location="${solr.home}/solr.war" />
|
||||
<property name="solr.docbase" location="${solr.home.dir}/solr.war" />
|
||||
<property name="solr.context.name" value="${webapp.name}solr" />
|
||||
<property name="solr.context.config" location="${solr.home}/${solr.context.name}.xml" />
|
||||
<property name="solr.context.config" location="${solr.home.dir}/${solr.context.name}.xml" />
|
||||
|
||||
<!-- Create and copy the example directory to the solr.home directory. -->
|
||||
<mkdir dir="${solr.home}" />
|
||||
<copy todir="${solr.home}">
|
||||
<!-- Create and copy the example directory to the solr.home.dir directory. -->
|
||||
<mkdir dir="${solr.home.dir}" />
|
||||
<copy todir="${solr.home.dir}">
|
||||
<fileset dir="${solr.example.dir}" includes="**/*" />
|
||||
</copy>
|
||||
|
||||
|
@ -303,7 +288,7 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
<fileset file="${solr.war}" />
|
||||
</copy>
|
||||
<war destfile="${solr.docbase}" update="true">
|
||||
<classes dir="${webapp.dir}/config/solr/" />
|
||||
<classes dir="${appbase.dir}/config/solr/" />
|
||||
</war>
|
||||
|
||||
<!-- if no mask is define, go with an unsecured installation. -->
|
||||
|
@ -360,12 +345,12 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
|||
================================= -->
|
||||
<target name="licenser" description="--> Check source files for licensing tags">
|
||||
<property name="licenser.properties.file"
|
||||
location="${webapp.dir}/config/licenser/licenser.properties" />
|
||||
location="${appbase.dir}/config/licenser/licenser.properties" />
|
||||
<property name="licenser.label" value="Vitro core" />
|
||||
|
||||
<echo message="Checking license tags on ${licenser.label}" />
|
||||
|
||||
<exec executable="ruby" dir="${webapp.dir}/../utilities/licenser" failonerror="true">
|
||||
<exec executable="ruby" dir="${appbase.dir}/../utilities/licenser" failonerror="true">
|
||||
<arg value="licenser.rb" />
|
||||
<arg value="${licenser.properties.file}" />
|
||||
<redirector outputproperty="licenser.test.output" alwayslog="true" />
|
||||
|
|
|
@ -29,56 +29,60 @@
|
|||
Everything else hangs from the build directory.
|
||||
-->
|
||||
<property name="build.dir" location="./.build" />
|
||||
<property name="war.dir" location="${build.dir}/war" />
|
||||
<property name="war-webinf.dir" location="${war.dir}/WEB-INF" />
|
||||
<property name="war-classes.dir" location="${war-webinf.dir}/classes" />
|
||||
<property name="war-resources.dir" location="${war-webinf.dir}/resources" />
|
||||
<property name="war-lib.dir" location="${war-webinf.dir}/lib" />
|
||||
<property name="test-classes.dir" location="${build.dir}/testclasses" />
|
||||
<property name="servletjars.dir" location="${build.dir}/servletjars" />
|
||||
|
||||
<property name="javac.deprecation" value="true" />
|
||||
<property name="appbase.dir" location="${build.dir}/appBase" />
|
||||
|
||||
|
||||
<!-- Is there a "src" directory in the product? -->
|
||||
<property name="product.source.dir" location="./src" />
|
||||
<available property="product.sources.exist" file="${product.source.dir}" />
|
||||
|
||||
<!-- Is there a "test" directory in the product? -->
|
||||
<property name="product.test.dir" location="./test" />
|
||||
<available property="product.tests.exist" file="${product.test.dir}" />
|
||||
|
||||
<!-- Is there a "themes" directory in the product? -->
|
||||
<property name="product.themes.dir" location="./themes" />
|
||||
<available property="product.themes.exist" file="${product.themes.dir}" />
|
||||
|
||||
<!-- Is there a modifications directory in the product? -->
|
||||
<property name="product.modifications.dir" location="./modifications" />
|
||||
<available property="product.modifications.exist" file="${product.modifications.dir}" />
|
||||
<dirname property="vivoProduct.basedir" file="${ant.file.vivoProduct}" />
|
||||
<path id="anttasks.classpath">
|
||||
<pathelement location="${vivoProduct.basedir}/../utilities/anttasks/classes" />
|
||||
</path>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
paths: for compiling and running
|
||||
custom Ant types
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<path id="compile.classpath">
|
||||
<fileset dir="${war-lib.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${servletjars.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
<typedef name="dirDifference"
|
||||
classname="edu.cornell.mannlib.vitro.utilities.anttasks.DirDifferenceResourceCollection"
|
||||
classpathref="anttasks.classpath" />
|
||||
|
||||
<path id="test.compile.classpath">
|
||||
<pathelement location="${product.test.dir}"/>
|
||||
<pathelement location="${war-classes.dir}" />
|
||||
<path refid="compile.classpath" />
|
||||
</path>
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: product-prepare
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="product-prepare" depends="product-prepare-lib">
|
||||
<mkdir dir="${appbase.dir}" />
|
||||
<mkdir dir="${appbase.dir}/web" />
|
||||
<mkdir dir="${appbase.dir}/src" />
|
||||
|
||||
<path id="test.run.classpath">
|
||||
<pathelement location="${test-classes.dir}" />
|
||||
<path refid="test.compile.classpath" />
|
||||
</path>
|
||||
<copy todir="${appbase.dir}/web">
|
||||
<dirDifference primary="${inner.basedir}/web" blocking="${product.modifications.dir}" />
|
||||
</copy>
|
||||
<copy todir="${appbase.dir}/web">
|
||||
<fileset dir="${product.modifications.dir}" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${appbase.dir}/config">
|
||||
<fileset dir="${inner.basedir}/config" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${appbase.dir}/src">
|
||||
<dirDifference primary="${inner.basedir}/src"
|
||||
blocking="./src"
|
||||
blockingOptional="true" />
|
||||
</copy>
|
||||
<copy todir="${appbase.dir}/src">
|
||||
<fileset dir="./src" />
|
||||
</copy>
|
||||
|
||||
<copy tofile="${appbase.dir}/context.xml" file="${inner.basedir}/context.xml" />
|
||||
</target>
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: product-prepare-lib
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="product-prepare-lib">
|
||||
<mkdir dir="${appbase.dir}/lib" />
|
||||
|
||||
<available property="product.lib.exist" file="./lib" />
|
||||
<mergedirs suffix="lib" flag="${product.lib.exist}" />
|
||||
<copydir suffix="lib" flag="${product.lib.exist}" />
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: describe
|
||||
|
@ -99,6 +103,121 @@
|
|||
<innercall target="clean" />
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: deploy
|
||||
================================= -->
|
||||
<target name="deploy"
|
||||
depends="product-prepare"
|
||||
description="--> Build the app and install in Tomcat">
|
||||
<innercall target="deploy" />
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: compile
|
||||
================================= -->
|
||||
<target name="compile" depends="product-prepare" description="--> Compile Java sources.">
|
||||
<innercall target="compile" />
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: test
|
||||
================================= -->
|
||||
<target name="test" depends="product-prepare" description="--> Run JUnit tests">
|
||||
<innercall target="test" />
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: revisionInfo
|
||||
================================= -->
|
||||
<target name="revisionInfo"
|
||||
depends="product-prepare"
|
||||
description="--> Store revision info in build">
|
||||
<innercall target="revisionInfo" />
|
||||
<antcall target="productRevisionInfo" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: productRevisionInfo
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="productRevisionInfo" unless="skipinfo">
|
||||
<property name="revisionInfo.product.dir" location="${ant.file}/.." />
|
||||
<property name="revisionInfo.build.file" location="${war-resources.dir}/revisionInfo.txt" />
|
||||
|
||||
<java classname="edu.cornell.mannlib.vitro.utilities.revisioninfo.RevisionInfoBuilder"
|
||||
fork="no"
|
||||
failonerror="true">
|
||||
<classpath refid="test.run.classpath" />
|
||||
<arg value="${ant.project.name}" />
|
||||
<arg file="${revisionInfo.product.dir}" />
|
||||
<arg file="${revisionInfo.build.file}" />
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: war
|
||||
================================= -->
|
||||
<target name="war"
|
||||
depends="product-prepare"
|
||||
description="--> Build the app and create a WAR file">
|
||||
<innercall target="war" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
MACROS
|
||||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
|
||||
<!--
|
||||
Call a target in the inner script.
|
||||
-->
|
||||
<macrodef name="mergedirs">
|
||||
<attribute name="suffix" />
|
||||
<attribute name="flag" />
|
||||
<sequential>
|
||||
<copy todir="${appbase.dir}/web">
|
||||
<dirDifference primary="${inner.basedir}/web" blocking="${product.modifications.dir}" />
|
||||
</copy>
|
||||
<copy todir="${appbase.dir}/web">
|
||||
<fileset dir="${product.modifications.dir}" />
|
||||
</copy>
|
||||
<ant dir="${inner.basedir}" inheritall="false">
|
||||
<!-- pass the properties that are needed. -->
|
||||
<propertyset>
|
||||
<propertyref name="build.dir" />
|
||||
<propertyref name="skip.core.themes" />
|
||||
<propertyref name="deploy.properties.file" />
|
||||
</propertyset>
|
||||
<additionalProperties />
|
||||
<target name="@{target}" />
|
||||
</ant>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<!--
|
||||
===========================================================================
|
||||
===========================================================================
|
||||
===========================================================================
|
||||
NOT YET USING ANYTHING BELOW HERE
|
||||
===========================================================================
|
||||
===========================================================================
|
||||
===========================================================================
|
||||
-->
|
||||
|
||||
<!-- Is there a "src" directory in the product? -->
|
||||
<property name="product.source.dir" location="./src" />
|
||||
<available property="product.sources.exist" file="${product.source.dir}" />
|
||||
|
||||
<!-- Is there a "test" directory in the product? -->
|
||||
<property name="product.test.dir" location="./test" />
|
||||
<available property="product.tests.exist" file="${product.test.dir}" />
|
||||
|
||||
<!-- Is there a "themes" directory in the product? -->
|
||||
<property name="product.themes.dir" location="./themes" />
|
||||
<available property="product.themes.exist" file="${product.themes.dir}" />
|
||||
|
||||
<!-- Is there a modifications directory in the product? -->
|
||||
<property name="product.modifications.dir" location="./modifications" />
|
||||
<available property="product.modifications.exist" file="${product.modifications.dir}" />
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: productPrepare
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
|
@ -126,146 +245,12 @@
|
|||
</target>
|
||||
|
||||
|
||||
<!-- =================================
|
||||
target: compile
|
||||
================================= -->
|
||||
<target name="compile" description="--> Compile Java sources.">
|
||||
<innercall target="compile" />
|
||||
<antcall target="productCompile" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: productCompile
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="productCompile" depends="productPrepare" if="product.sources.exist">
|
||||
<property name="product.classes.dir" value="${build.dir}/${ant.project.name}/classes" />
|
||||
<mkdir dir="${product.classes.dir}" />
|
||||
<javac srcdir="${product.source.dir}"
|
||||
destdir="${product.classes.dir}"
|
||||
debug="true"
|
||||
deprecation="${javac.deprecation}"
|
||||
encoding="UTF8"
|
||||
includeantruntime="false"
|
||||
optimize="true"
|
||||
source="1.6">
|
||||
<classpath>
|
||||
<path refid="compile.classpath" />
|
||||
<pathelement location="${build.dir}/war/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
</javac>
|
||||
<copy todir="${build.dir}/war/WEB-INF/classes" overwrite="true">
|
||||
<fileset dir="${product.classes.dir}" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: test
|
||||
================================= -->
|
||||
<target name="test" description="--> Run JUnit tests">
|
||||
<innercall target="test" />
|
||||
<antcall target="productTest" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: productTest
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="productTest" depends="productCompile" if="product.tests.exist" unless="skiptests">
|
||||
<javac srcdir="${product.test.dir}"
|
||||
destdir="${test-classes.dir}"
|
||||
debug="true"
|
||||
deprecation="true"
|
||||
encoding="UTF8"
|
||||
includeantruntime="false"
|
||||
optimize="false"
|
||||
source="1.6">
|
||||
<classpath refid="test.compile.classpath" />
|
||||
</javac>
|
||||
|
||||
<java classname="edu.cornell.mannlib.vitro.testing.VitroTestRunner"
|
||||
fork="yes"
|
||||
failonerror="true">
|
||||
<classpath refid="test.run.classpath" />
|
||||
<arg file="${product.test.dir}" />
|
||||
<arg value="${testlevel}" />
|
||||
</java>
|
||||
</target>
|
||||
<!-- =================================
|
||||
target: revisionInfo
|
||||
================================= -->
|
||||
<target name="revisionInfo" description="--> Store revision info in build">
|
||||
<innercall target="revisionInfo" />
|
||||
<antcall target="productRevisionInfo" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: productRevisionInfo
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="productRevisionInfo" depends="productTest" unless="skipinfo">
|
||||
<property name="revisionInfo.product.dir" location="${ant.file}/.." />
|
||||
<property name="revisionInfo.build.file" location="${war-resources.dir}/revisionInfo.txt" />
|
||||
|
||||
<java classname="edu.cornell.mannlib.vitro.utilities.revisioninfo.RevisionInfoBuilder"
|
||||
fork="no"
|
||||
failonerror="true">
|
||||
<classpath refid="test.run.classpath" />
|
||||
<arg value="${ant.project.name}" />
|
||||
<arg file="${revisionInfo.product.dir}" />
|
||||
<arg file="${revisionInfo.build.file}" />
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: deploySolr
|
||||
|
||||
This must be visible so a second-level product like CornellVivo can call it.
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="deploySolr" >
|
||||
<innercall target="deploySolr" />
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: deploy
|
||||
================================= -->
|
||||
<target name="deploy" description="--> Build the app and install in Tomcat">
|
||||
<!-- the inner "deploy" would just do a sync that will be done by productDeploy -->
|
||||
<innercall target="revisionInfo" />
|
||||
<antcall target="deploySolr" />
|
||||
<antcall target="productDeploy" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: productDeploy
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="productDeploy" depends="productRevisionInfo">
|
||||
<property name="webapp.deploy.home" value="${tomcat.home}/webapps/${webapp.name}" />
|
||||
|
||||
<mkdir dir="${webapp.deploy.home}" />
|
||||
|
||||
<sync todir="${webapp.deploy.home}" includeemptydirs="true">
|
||||
<fileset dir="${build.dir}/war" />
|
||||
</sync>
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: war
|
||||
================================= -->
|
||||
<target name="war" description="--> Build the app and create a WAR file">
|
||||
<innercall target="revisionInfo" />
|
||||
<antcall target="productWar" />
|
||||
</target>
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - -
|
||||
target: productWar
|
||||
- - - - - - - - - - - - - - - - - -->
|
||||
<target name="productWar" depends="productRevisionInfo">
|
||||
<jar basedir="${build.dir}/war" destfile="${build.dir}/${webapp.name}.war"/>
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
target: jar
|
||||
================================= -->
|
||||
<target name="jar" depends="revisionInfo" description="--> Build the app and create a JAR file">
|
||||
<jar basedir="${build.dir}/war/WEB-INF/classes" destfile="${build.dir}/${webapp.name}.jar" />
|
||||
<jar basedir="${build.dir}/war/WEB-INF/classes"
|
||||
destfile="${build.dir}/${webapp.name}.jar" />
|
||||
</target>
|
||||
|
||||
<!-- =================================
|
||||
|
@ -310,6 +295,7 @@
|
|||
<!-- pass the properties that are needed. -->
|
||||
<propertyset>
|
||||
<propertyref name="build.dir" />
|
||||
<propertyref name="appbase.dir" />
|
||||
<propertyref name="skip.core.themes" />
|
||||
<propertyref name="deploy.properties.file" />
|
||||
</propertyset>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue