2010-02-21 18:45:18 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
|
|
<!-- $This file is distributed under the terms of the license in /doc/license.txt$
-->
|
|
|
|
|
|
|
|
<!-- ======================================================================
|
|
|
|
Build script for the Vivo Products.
|
|
|
|
|
|
|
|
jeb228
|
|
|
|
======================================================================
-->
|
|
|
|
<project name="vivoProduct" default="describe">
|
|
|
|
|
|
|
|
<!--
|
|
|
|
This script should not be run on its own.
|
|
|
|
It should only be run from the build script of an individual Product.
|
|
|
|
-->
|
|
|
|
<fail>
|
|
|
|
<condition>
|
|
|
|
<equals arg1="${ant.file.vivoProduct}" arg2="${ant.file}" />
|
|
|
|
</condition>
|
|
|
|
This script should not be run by itself.
|
|
|
|
It should be invoked from the build script of a Vivo product.
|
|
|
|
</fail>
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
2010-02-21 20:47:07 +00:00
|
|
|
properties
|
2010-02-21 18:45:18 +00:00
|
|
|
|
2010-02-21 20:47:07 +00:00
|
|
|
File paths are based on this file's parent directory, so we can find
|
|
|
|
the files even when this script is included into an individual
|
|
|
|
Product build script.
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
2010-02-21 18:45:18 +00:00
|
|
|
<dirname property="vivoProduct.basedir" file="${ant.file.vivoProduct}" />
|
|
|
|
<import file="${vivoProduct.basedir}/build.xml" />
|
|
|
|
|
|
|
|
<!-- 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}" />
|
|
|
|
|
2010-02-21 20:47:07 +00:00
|
|
|
<!-- Is there a modifications directory in the product? -->
|
|
|
|
<property name="product.modifications.dir" location="./modifications" />
|
|
|
|
<available property="product.modifications.exist" file="${product.modifications.dir}" />
|
|
|
|
|
2010-02-21 18:45:18 +00:00
|
|
|
<path id="product.compile.classpath">
|
|
|
|
<pathelement location="${classes.dir}" />
|
2010-02-22 13:32:29 +00:00
|
|
|
|
2010-02-21 20:47:07 +00:00
|
|
|
<!-- These come before the core classpath, so our local mods can override -->
|
|
|
|
<fileset dir="${product.modifications.dir}/WEB-INF/lib">
|
|
|
|
<include name="**/*.jar" />
|
|
|
|
</fileset>
|
2010-02-22 13:32:29 +00:00
|
|
|
|
2010-02-21 18:45:18 +00:00
|
|
|
<path refid="compile.classpath" />
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<path id="product.test.compile.classpath">
|
|
|
|
<path refid="test.compile.classpath" />
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<path id="product.test.run.classpath">
|
|
|
|
<path refid="test.run.classpath" />
|
|
|
|
</path>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: describe
|
|
|
|
================================= -->
|
2010-02-22 13:32:29 +00:00
|
|
|
<target name="describe" description="--> Describe the targets (this is the default).">
|
2010-02-21 18:45:18 +00:00
|
|
|
<echo>
|
|
|
|
all - Runs "clean", then "deploy".
|
|
|
|
clean - Delete all artifacts so the next build will be from scratch.
|
|
|
|
compile - Compile the Java source files.
|
|
|
|
test - Compile and run the JUnit tests.
|
|
|
|
war - Assemble everything into a deployable WAR file.
|
|
|
|
deploy - Deploy the application directly into the Tomcat webapps directory.
|
|
|
|
</echo>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: all
|
|
|
|
================================= -->
|
2010-02-22 13:32:29 +00:00
|
|
|
<target name="all" depends="clean, deploy" description="--> Run 'clean', then 'deploy'" />
|
2010-02-21 18:45:18 +00:00
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: clean
|
|
|
|
================================= -->
|
|
|
|
<target name="clean" depends="vitroCore.clean" description="--> Delete all artifacts.">
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: compile
|
|
|
|
================================= -->
|
|
|
|
<target name="compile"
|
|
|
|
depends="vitroCore.compile, productCompile"
|
|
|
|
description="--> Compile Java sources.">
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: test
|
|
|
|
================================= -->
|
2010-03-04 18:40:06 +00:00
|
|
|
<target name="test"
|
|
|
|
depends="vitroCore.test, productTest"
|
|
|
|
unless="skiptests"
|
|
|
|
description="--> Run JUnit tests">
|
2010-02-21 18:45:18 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: deploy
|
|
|
|
================================= -->
|
2010-02-22 13:32:29 +00:00
|
|
|
<target name="deploy"
|
|
|
|
depends="productCopy, vitroCore.deploy"
|
|
|
|
description="--> Build the app and install in Tomcat">
|
2010-02-21 18:45:18 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: productCopy
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
|
|
|
<target name="productCopy" depends="copyEtc, test">
|
2010-02-22 16:45:54 +00:00
|
|
|
<copy todir="${build.dir}/war/themes" overwrite="true">
|
2010-02-21 18:45:18 +00:00
|
|
|
<fileset dir="${product.themes.dir}" />
|
|
|
|
</copy>
|
|
|
|
|
2010-02-22 16:45:54 +00:00
|
|
|
<copy todir="${build.dir}/war" overwrite="true">
|
2010-02-21 20:47:07 +00:00
|
|
|
<fileset dir="${product.modifications.dir}" />
|
2010-02-21 18:45:18 +00:00
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: productCompile
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
|
|
|
<target name="productCompile" depends="vitroCore.compile" if="product.sources.exist">
|
|
|
|
<!-- deletes all files that depend on changed .java files -->
|
|
|
|
<depend srcdir="${product.source.dir}"
|
2010-02-21 20:47:07 +00:00
|
|
|
destdir="${build.dir}/war/WEB-INF/classes"
|
2010-02-21 18:45:18 +00:00
|
|
|
closure="false"
|
|
|
|
cache="${build.dir}/.depcache">
|
|
|
|
<classpath refid="product.compile.classpath" />
|
|
|
|
</depend>
|
|
|
|
|
|
|
|
<javac srcdir="${product.source.dir}"
|
2010-02-21 20:47:07 +00:00
|
|
|
destdir="${build.dir}/war/WEB-INF/classes"
|
2010-02-21 18:45:18 +00:00
|
|
|
debug="true"
|
|
|
|
deprecation="true"
|
|
|
|
optimize="true"
|
|
|
|
source="1.5">
|
|
|
|
<classpath refid="product.compile.classpath" />
|
|
|
|
</javac>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: productTest
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
2010-03-04 18:40:06 +00:00
|
|
|
<target name="productTest" depends="vitroCore.test" if="product.tests.exist" unless="skiptests">
|
2010-02-21 18:45:18 +00:00
|
|
|
<javac srcdir="${product.test.dir}"
|
|
|
|
destdir="${test.classes.dir}"
|
|
|
|
debug="true"
|
|
|
|
deprecation="true"
|
|
|
|
optimize="false"
|
|
|
|
source="1.5">
|
|
|
|
<classpath refid="product.test.compile.classpath" />
|
|
|
|
</javac>
|
|
|
|
|
|
|
|
<java classname="edu.cornell.mannlib.vitro.testing.VitroTestRunner"
|
|
|
|
fork="yes"
|
|
|
|
failonerror="true">
|
|
|
|
<classpath refid="product.test.run.classpath" />
|
|
|
|
<arg file="${product.test.dir}" />
|
|
|
|
<arg value="${testlevel}" />
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
</project>
|