2010-02-21 18:45:18 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2010-01-29 22:13:57 +00:00
|
|
|
|
|
|
|
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
|
|
|
|
2010-02-21 18:45:18 +00:00
|
|
|
<!-- ======================================================================
|
|
|
|
Build script for the Vitro core webapp.
|
|
|
|
|
2010-08-03 18:53:55 +00:00
|
|
|
This can be used on its own, or invoked from a Product build script.
|
2010-02-21 18:45:18 +00:00
|
|
|
====================================================================== -->
|
|
|
|
|
|
|
|
<project name="vitroCore" default="describe">
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
properties
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
2011-09-09 19:11:51 +00:00
|
|
|
<dirname property="corebase.dir" file="${ant.file.vitroCore}" />
|
2011-09-09 17:13:35 +00:00
|
|
|
|
2011-09-12 19:44:32 +00:00
|
|
|
<!-- A product script will override appbase.dir, but not corebase.dir -->
|
2011-09-09 17:13:35 +00:00
|
|
|
<property name="appbase.dir" location="${corebase.dir}" />
|
2011-09-12 19:44:32 +00:00
|
|
|
|
2010-02-21 18:45:18 +00:00
|
|
|
<property name="build.dir" location=".build" />
|
2011-09-09 17:13:35 +00:00
|
|
|
<property name="deploy.properties.file" location="config/deploy.properties" />
|
2010-02-21 18:45:18 +00:00
|
|
|
|
2011-09-12 19:44:32 +00:00
|
|
|
<property name="utilities.base.dir" location="${corebase.dir}/../utilities/buildutils" />
|
|
|
|
<property name="utilities.source.dir" location="${utilities.base.dir}/src" />
|
|
|
|
<property name="utilities.lib.dir" location="${utilities.base.dir}/lib" />
|
|
|
|
|
2010-08-03 18:53:55 +00:00
|
|
|
<property name="war.dir" location="${build.dir}/war" />
|
2011-09-12 19:44:32 +00:00
|
|
|
<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="revisionInfo.build.file" location="${war.resources.dir}/revisionInfo.txt" />
|
2010-02-22 13:32:29 +00:00
|
|
|
|
2011-09-12 19:44:32 +00:00
|
|
|
<property name="test.classes.dir" location="${build.dir}/testClasses" />
|
|
|
|
<property name="utility.classes.dir" location="${build.dir}/utilityClasses" />
|
2010-02-21 18:45:18 +00:00
|
|
|
|
2011-10-18 20:29:21 +00:00
|
|
|
<property name="solr.build.dir" location="${build.dir}/solr" />
|
|
|
|
|
2011-04-22 16:40:49 +00:00
|
|
|
<property name="javac.deprecation" value="true" />
|
2010-02-21 18:45:18 +00:00
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
paths: for compiling and running
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
|
|
|
<path id="compile.classpath">
|
2011-09-12 19:44:32 +00:00
|
|
|
<fileset dir="${appbase.dir}/lib" includes="*.jar" />
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<path id="utility.compile.classpath">
|
|
|
|
<fileset dir="${utilities.lib.dir}" includes="*.jar" />
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<path id="utility.run.classpath">
|
|
|
|
<pathelement location="${utility.classes.dir}" />
|
|
|
|
<path refid="utility.compile.classpath" />
|
2010-02-21 18:45:18 +00:00
|
|
|
</path>
|
2010-01-29 22:13:57 +00:00
|
|
|
|
2010-02-21 18:45:18 +00:00
|
|
|
<path id="test.compile.classpath">
|
2011-09-12 19:44:32 +00:00
|
|
|
<pathelement location="${war.classes.dir}" />
|
2010-02-21 18:45:18 +00:00
|
|
|
<path refid="compile.classpath" />
|
|
|
|
</path>
|
2010-01-29 22:13:57 +00:00
|
|
|
|
2010-02-21 18:45:18 +00:00
|
|
|
<path id="test.run.classpath">
|
2011-09-09 17:13:35 +00:00
|
|
|
<pathelement location="${appbase.dir}/test" />
|
2011-09-12 19:44:32 +00:00
|
|
|
<pathelement location="${test.classes.dir}" />
|
2010-02-21 18:45:18 +00:00
|
|
|
<path refid="test.compile.classpath" />
|
2011-09-12 19:44:32 +00:00
|
|
|
<path refid="utility.run.classpath" />
|
2010-01-29 22:13:57 +00:00
|
|
|
</path>
|
|
|
|
|
2010-02-21 18:45:18 +00:00
|
|
|
<!-- =================================
|
|
|
|
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.
|
2011-03-03 15:53:41 +00:00
|
|
|
war - Create a WAR file to be deployed in a servlet container.
|
2010-02-21 18:45:18 +00:00
|
|
|
deploy - Deploy the application directly into the Tomcat webapps directory.
|
|
|
|
</echo>
|
2010-01-29 22:13:57 +00:00
|
|
|
</target>
|
2010-02-21 18:45:18 +00:00
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
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: properties
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
|
|
|
<target name="properties">
|
|
|
|
<fail message="You must create a "${deploy.properties.file}" file.">
|
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<available file="${deploy.properties.file}" />
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
|
|
|
|
|
|
|
<property file="${deploy.properties.file}" />
|
|
|
|
|
2011-10-12 20:54:34 +00:00
|
|
|
<fail unless="tomcat.home" message="${deploy.properties.file} must contain a value for tomcat.home" />
|
|
|
|
<fail unless="webapp.name" message="${deploy.properties.file} must contain a value for webapp.name" />
|
|
|
|
<fail unless="vitro.home.directory" message="${deploy.properties.file} must contain a value for vitro.home.directory" />
|
|
|
|
<fail unless="Vitro.defaultNamespace" message="${deploy.properties.file} must contain a value for Vitro.defaultNamespace" />
|
|
|
|
<fail unless="VitroConnection.DataSource.url" message="${deploy.properties.file} must contain a value for VitroConnection.DataSource.url" />
|
|
|
|
<fail unless="VitroConnection.DataSource.username" message="${deploy.properties.file} must contain a value for VitroConnection.DataSource.username" />
|
|
|
|
<fail unless="VitroConnection.DataSource.password" message="${deploy.properties.file} must contain a value for VitroConnection.DataSource.password" />
|
|
|
|
<fail unless="rootUser.emailAddress" message="${deploy.properties.file} must contain a value for rootUser.emailAddress" />
|
2010-02-21 18:45:18 +00:00
|
|
|
|
2011-07-11 18:32:46 +00:00
|
|
|
<fail message="The vitro.home.directory "${vitro.home.directory}" does not exist.">
|
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<available file="${vitro.home.directory}" />
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
2011-09-08 17:17:16 +00:00
|
|
|
|
2011-09-09 17:13:35 +00:00
|
|
|
<property name="solr.home.dir" location="${vitro.home.directory}/solr" />
|
2011-07-11 18:32:46 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: clean
|
|
|
|
================================= -->
|
|
|
|
<target name="clean" depends="properties" description="--> Delete all artifacts.">
|
|
|
|
<delete dir="${build.dir}" />
|
2011-09-09 17:13:35 +00:00
|
|
|
<delete dir="${solr.home.dir}" excludes="data/**/*" includeemptydirs="true" />
|
2010-02-21 18:45:18 +00:00
|
|
|
</target>
|
|
|
|
|
2011-09-12 19:44:32 +00:00
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: compileUtilities
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
|
|
|
<target name="compileUtilities">
|
|
|
|
<mkdir dir="${utility.classes.dir}" />
|
2011-10-12 20:54:34 +00:00
|
|
|
<javac srcdir="${utilities.source.dir}" destdir="${utility.classes.dir}" debug="true" deprecation="${javac.deprecation}" encoding="UTF8" includeantruntime="false" optimize="false" source="1.6">
|
2011-09-12 19:44:32 +00:00
|
|
|
<classpath refid="utility.compile.classpath" />
|
|
|
|
</javac>
|
|
|
|
|
2011-10-12 20:54:34 +00:00
|
|
|
<typedef name="dirDifference" classname="edu.cornell.mannlib.vitro.utilities.anttasks.DirDifferenceFileSet" classpathref="utility.run.classpath" />
|
2011-09-12 19:44:32 +00:00
|
|
|
</target>
|
|
|
|
|
2010-02-21 18:45:18 +00:00
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: prepare
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
2011-09-12 19:44:32 +00:00
|
|
|
<target name="prepare" depends="properties, compileUtilities">
|
2010-02-21 18:45:18 +00:00
|
|
|
<mkdir dir="${build.dir}" />
|
2011-09-12 19:44:32 +00:00
|
|
|
<mkdir dir="${war.classes.dir}" />
|
|
|
|
<mkdir dir="${war.resources.dir}" />
|
|
|
|
<mkdir dir="${test.classes.dir}" />
|
2010-02-21 18:45:18 +00:00
|
|
|
|
2011-09-11 15:45:04 +00:00
|
|
|
<!-- copy all sorts of web stuff into the war directory. -->
|
2010-08-03 18:53:55 +00:00
|
|
|
<copy todir="${war.dir}">
|
2011-09-12 19:44:32 +00:00
|
|
|
<fileset dir="${appbase.dir}/web" />
|
|
|
|
<fileset dir="${appbase.dir}" includes="themes/**/*" />
|
2010-02-21 18:45:18 +00:00
|
|
|
</copy>
|
2010-01-29 22:13:57 +00:00
|
|
|
|
2011-09-12 19:44:32 +00:00
|
|
|
<copy todir="${war.webinf.dir}">
|
2011-09-09 17:13:35 +00:00
|
|
|
<fileset dir="${appbase.dir}">
|
2011-09-08 17:17:16 +00:00
|
|
|
<!-- copy the JARs into the war directory -->
|
|
|
|
<include name="lib/*" />
|
|
|
|
<!-- these are already in Tomcat: we mustn't conflict. -->
|
|
|
|
<exclude name="lib/jsp-api.jar" />
|
|
|
|
<exclude name="lib/servlet-api.jar" />
|
|
|
|
</fileset>
|
2010-03-29 16:23:00 +00:00
|
|
|
</copy>
|
|
|
|
|
2010-06-07 15:47:43 +00:00
|
|
|
<!-- use the production Log4J properties, unless a debug version exists. -->
|
2011-10-12 20:54:34 +00:00
|
|
|
<available file="${appbase.dir}/config/debug.log4j.properties" property="debug.log4j.exists" />
|
2011-09-12 19:44:32 +00:00
|
|
|
<copy tofile="${war.classes.dir}/log4j.properties" filtering="true" overwrite="true">
|
2011-09-09 17:13:35 +00:00
|
|
|
<fileset dir="${appbase.dir}/config">
|
2010-06-07 15:47:43 +00:00
|
|
|
<include name="default.log4j.properties" unless="debug.log4j.exists" />
|
|
|
|
<include name="debug.log4j.properties" if="debug.log4j.exists" />
|
|
|
|
</fileset>
|
2010-02-21 18:45:18 +00:00
|
|
|
<filterchain>
|
|
|
|
<expandproperties />
|
|
|
|
</filterchain>
|
|
|
|
</copy>
|
|
|
|
|
2011-09-12 19:44:32 +00:00
|
|
|
<copy todir="${war.classes.dir}">
|
2011-09-08 17:17:16 +00:00
|
|
|
<!-- copy the deploy.properties into the war directory -->
|
2010-02-21 18:45:18 +00:00
|
|
|
<fileset file="${deploy.properties.file}" />
|
|
|
|
|
2011-09-08 17:17:16 +00:00
|
|
|
<!-- copy any xml files from source tree to the war directory -->
|
2011-09-09 17:13:35 +00:00
|
|
|
<fileset dir="${appbase.dir}/src" includes="**/*.xml" />
|
2010-08-03 18:53:55 +00:00
|
|
|
</copy>
|
|
|
|
|
|
|
|
<!-- copy the context file into the war directory -->
|
2011-09-09 17:13:35 +00:00
|
|
|
<copy file="${appbase.dir}/context.xml" tofile="${war.dir}/META-INF/context.xml" />
|
2011-09-11 16:48:21 +00:00
|
|
|
|
2010-08-03 18:53:55 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: compile
|
|
|
|
================================= -->
|
|
|
|
<target name="compile" depends="prepare" description="--> Compile Java sources">
|
|
|
|
<!-- deletes all files that depend on changed .java files -->
|
2011-10-12 20:54:34 +00:00
|
|
|
<depend srcdir="${appbase.dir}/src" destdir="${war.classes.dir}" closure="false" cache="${build.dir}/.depcache">
|
2010-08-03 18:53:55 +00:00
|
|
|
<classpath refid="compile.classpath" />
|
|
|
|
</depend>
|
|
|
|
|
2011-10-12 20:54:34 +00:00
|
|
|
<javac srcdir="${appbase.dir}/src" destdir="${war.classes.dir}" debug="true" deprecation="${javac.deprecation}" encoding="UTF8" includeantruntime="false" optimize="true" source="1.6">
|
2010-08-03 18:53:55 +00:00
|
|
|
<classpath refid="compile.classpath" />
|
|
|
|
</javac>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- =================================
|
|
|
|
target: test
|
|
|
|
================================= -->
|
|
|
|
<target name="test" depends="compile" unless="skiptests" description="--> Run JUnit tests">
|
2011-10-12 20:54:34 +00:00
|
|
|
<javac srcdir="${appbase.dir}/test" destdir="${test.classes.dir}" debug="true" deprecation="${javac.deprecation}" encoding="UTF8" includeantruntime="false" optimize="false" source="1.6">
|
2010-08-03 18:53:55 +00:00
|
|
|
<classpath refid="test.compile.classpath" />
|
|
|
|
</javac>
|
|
|
|
|
2011-10-12 20:54:34 +00:00
|
|
|
<java classname="edu.cornell.mannlib.vitro.utilities.testing.VitroTestRunner" fork="yes" failonerror="true">
|
2010-08-03 18:53:55 +00:00
|
|
|
<classpath refid="test.run.classpath" />
|
2011-09-09 17:13:35 +00:00
|
|
|
<arg file="${appbase.dir}/test" />
|
2010-08-03 18:53:55 +00:00
|
|
|
<arg value="${testlevel}" />
|
|
|
|
</java>
|
2010-01-29 22:13:57 +00:00
|
|
|
</target>
|
|
|
|
|
2011-09-12 16:55:39 +00:00
|
|
|
<!-- =================================
|
|
|
|
target: jar
|
|
|
|
================================= -->
|
|
|
|
<target name="jar" depends="test" description="--> Compile the Java, and build a JAR file">
|
2011-09-12 19:44:32 +00:00
|
|
|
<jar basedir="${war.classes.dir}" destfile="${build.dir}/${ant.project.name}.jar" />
|
2011-09-12 16:55:39 +00:00
|
|
|
</target>
|
|
|
|
|
2010-10-22 15:13:06 +00:00
|
|
|
<!-- =================================
|
|
|
|
target: revisionInfo
|
|
|
|
================================= -->
|
2011-10-12 20:54:34 +00:00
|
|
|
<target name="revisionInfo" depends="test" unless="skipinfo" description="--> Store revision info in build">
|
2010-10-22 15:13:06 +00:00
|
|
|
<tstamp>
|
|
|
|
<format property="revisionInfo.timestamp" pattern="yyyy-MM-dd HH:mm:ss" />
|
|
|
|
</tstamp>
|
|
|
|
<echo file="${revisionInfo.build.file}">${revisionInfo.timestamp}
|
|
|
|
</echo>
|
|
|
|
|
2011-09-11 16:48:21 +00:00
|
|
|
<addRevisionInfoLine productName="vitroCore" productCheckoutDir="${corebase.dir}/.." />
|
2010-10-22 15:13:06 +00:00
|
|
|
</target>
|
|
|
|
|
2011-07-11 18:32:46 +00:00
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: prepareSolr
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
2011-10-18 20:29:21 +00:00
|
|
|
<target name="prepareSolr" depends="properties" unless="skipsolr">
|
|
|
|
<mkdir dir="${solr.home.dir}" />
|
|
|
|
<mkdir dir="${solr.build.dir}" />
|
|
|
|
|
2011-09-09 19:11:51 +00:00
|
|
|
<property name="solr.distrib.dir" location="${corebase.dir}/../solr" />
|
2011-07-11 18:32:46 +00:00
|
|
|
<property name="solr.example.dir" location="${solr.distrib.dir}/exampleSolr" />
|
2011-10-18 20:36:39 +00:00
|
|
|
<property name="solr.context.template.file" location="${solr.distrib.dir}/template.context.xml" />
|
2011-10-18 20:29:21 +00:00
|
|
|
<property name="solr.distrib.war" location="${solr.distrib.dir}/apache-solr-3.1.0.war" />
|
|
|
|
|
|
|
|
<property name="solr.context.file" location="${solr.build.dir}/context.xml" />
|
|
|
|
<property name="solr.context.temp.file" location="${solr.build.dir}/context.temp.xml" />
|
|
|
|
<property name="solr.build.war" location="${solr.build.dir}/solr.war" />
|
2011-07-11 18:32:46 +00:00
|
|
|
|
|
|
|
<property name="solr.context.name" value="${webapp.name}solr" />
|
2011-10-18 20:29:21 +00:00
|
|
|
<property name="solr.deployed.war" value="${tomcat.home}/webapps/${solr.context.name}.war" />
|
|
|
|
|
|
|
|
<!-- if no mask is defined, leave Solr unsecured. -->
|
|
|
|
<property name="vitro.local.solr.ipaddress.mask" value=".*" />
|
2011-07-11 18:32:46 +00:00
|
|
|
|
2011-09-09 17:13:35 +00:00
|
|
|
<!-- Create and copy the example directory to the solr.home.dir directory. -->
|
|
|
|
<copy todir="${solr.home.dir}">
|
2011-07-11 18:32:46 +00:00
|
|
|
<fileset dir="${solr.example.dir}" includes="**/*" />
|
|
|
|
</copy>
|
|
|
|
|
2011-10-18 20:29:21 +00:00
|
|
|
<!-- Create the context configuration XML with expanded properties. Store it in a temp file for now. -->
|
|
|
|
<copy tofile="${solr.context.temp.file}" filtering="true" overwrite="true">
|
2011-10-18 20:36:39 +00:00
|
|
|
<fileset file="${solr.context.template.file}" />
|
2011-07-11 18:32:46 +00:00
|
|
|
<filterchain>
|
|
|
|
<expandproperties />
|
|
|
|
</filterchain>
|
|
|
|
</copy>
|
2011-10-18 20:29:21 +00:00
|
|
|
|
|
|
|
<!-- If the WAR is up to date and the context file hasn't changed, we can skip the deploy. -->
|
|
|
|
<condition property="skipsolr">
|
|
|
|
<and>
|
|
|
|
<uptodate targetfile="${solr.build.war}">
|
|
|
|
<srcfiles file="${solr.distrib.war}" />
|
|
|
|
<srcfiles dir="${appbase.dir}/config/solr/" />
|
|
|
|
</uptodate>
|
|
|
|
<filesmatch file1="${solr.context.temp.file}" file2="${solr.context.file}" />
|
|
|
|
</and>
|
|
|
|
</condition>
|
2011-07-11 18:32:46 +00:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- - - - - - - - - - - - - - - - - -
|
|
|
|
target: deploySolr
|
|
|
|
- - - - - - - - - - - - - - - - - -->
|
2011-10-18 20:29:21 +00:00
|
|
|
<target name="deploySolr" depends="prepareSolr" unless="skipsolr">
|
|
|
|
<!-- save the new context file, so we can compare against it next time. -->
|
|
|
|
<copy file="${solr.context.temp.file}" tofile="${solr.context.file}" />
|
|
|
|
|
|
|
|
<war destfile="${solr.build.war}" needxmlfile="false">
|
|
|
|
<zipfileset src="${solr.distrib.war}" />
|
|
|
|
<classes dir="${appbase.dir}/config/solr" />
|
|
|
|
<metainf file="${solr.context.file}" />
|
|
|
|
</war>
|
|
|
|
|
|
|
|
<!-- deploy the new WAR -->
|
|
|
|
<unwar src="${solr.build.war}" dest="${tomcat.home}/webapps/${solr.context.name}" />
|
2011-07-11 18:32:46 +00:00
|
|
|
</target>
|
|
|
|
|
2010-02-21 18:45:18 +00:00
|
|
|
<!-- =================================
|
|
|
|
target: deploy
|
|
|
|
================================= -->
|
2011-10-12 20:54:34 +00:00
|
|
|
<target name="deploy" depends="revisionInfo, deploySolr" description="--> Build the app and install in Tomcat">
|
2010-02-21 18:45:18 +00:00
|
|
|
<property name="webapp.deploy.home" value="${tomcat.home}/webapps/${webapp.name}" />
|
|
|
|
|
|
|
|
<mkdir dir="${webapp.deploy.home}" />
|
|
|
|
|
2010-08-03 18:53:55 +00:00
|
|
|
<sync todir="${webapp.deploy.home}" includeemptydirs="true">
|
2010-02-21 18:45:18 +00:00
|
|
|
<fileset dir="${build.dir}/war" />
|
2010-06-01 19:58:17 +00:00
|
|
|
</sync>
|
2010-02-21 18:45:18 +00:00
|
|
|
</target>
|
2011-07-11 18:32:46 +00:00
|
|
|
|
2011-03-03 15:53:41 +00:00
|
|
|
<!-- =================================
|
|
|
|
target: war
|
|
|
|
================================= -->
|
2011-07-11 18:32:46 +00:00
|
|
|
<target name="war" depends="revisionInfo" description="--> Build the app and create a WAR file">
|
|
|
|
<jar basedir="${build.dir}/war" destfile="${build.dir}/${webapp.name}.war" />
|
2011-03-03 15:53:41 +00:00
|
|
|
</target>
|
2010-01-29 22:13:57 +00:00
|
|
|
|
2011-07-28 22:22:00 +00:00
|
|
|
|
|
|
|
|
2010-04-15 20:20:14 +00:00
|
|
|
<!-- =================================
|
|
|
|
target: licenser
|
|
|
|
|
|
|
|
In regular use, checks that all appropriate source files have license tags.
|
|
|
|
At release time, applies license text to source files.
|
|
|
|
================================= -->
|
|
|
|
<target name="licenser" description="--> Check source files for licensing tags">
|
2011-10-12 20:54:34 +00:00
|
|
|
<property name="licenser.properties.file" location="${corebase.dir}/config/licenser/licenser.properties" />
|
2011-09-11 16:48:21 +00:00
|
|
|
<runLicenserScript productname="Vitro core" propertiesfile="${licenser.properties.file}" />
|
|
|
|
</target>
|
2010-04-15 20:20:14 +00:00
|
|
|
|
2011-10-12 20:54:34 +00:00
|
|
|
<!-- =================================
|
|
|
|
target: jarlist
|
|
|
|
================================= -->
|
|
|
|
<target name="jarlist" depends="jar" description="Figure out what JARs are not needed">
|
|
|
|
<java classname="edu.cornell.mannlib.vitro.utilities.jarlist.JarLister" fork="no" failonerror="true">
|
|
|
|
<classpath refid="utility.run.classpath" />
|
|
|
|
<arg value="${build.dir}/${ant.project.name}.jar" />
|
|
|
|
<arg value="${appbase.dir}/lib" />
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
2011-09-12 16:55:39 +00:00
|
|
|
|
2011-09-11 16:48:21 +00:00
|
|
|
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
MACROS
|
|
|
|
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
2010-04-15 20:20:14 +00:00
|
|
|
|
2011-09-11 16:48:21 +00:00
|
|
|
<!--
|
|
|
|
Run the licenser script.
|
|
|
|
-->
|
|
|
|
<macrodef name="runLicenserScript">
|
|
|
|
<attribute name="productName" />
|
|
|
|
<attribute name="propertiesFile" />
|
|
|
|
<sequential>
|
|
|
|
<echo message="Checking license tags on @{productName}" />
|
|
|
|
|
|
|
|
<exec executable="ruby" dir="${corebase.dir}/../utilities/licenser" failonerror="true">
|
|
|
|
<arg value="licenser.rb" />
|
|
|
|
<arg value="@{propertiesFile}" />
|
|
|
|
<redirector outputproperty="licenser.test.output" alwayslog="true" />
|
|
|
|
</exec>
|
|
|
|
</sequential>
|
|
|
|
</macrodef>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Add a line to the revisionInfo file.
|
|
|
|
-->
|
|
|
|
<macrodef name="addRevisionInfoLine">
|
|
|
|
<attribute name="productName" />
|
|
|
|
<attribute name="productCheckoutDir" />
|
|
|
|
<sequential>
|
2011-10-12 20:54:34 +00:00
|
|
|
<java classname="edu.cornell.mannlib.vitro.utilities.revisioninfo.RevisionInfoBuilder" fork="no" failonerror="true">
|
2011-09-12 19:44:32 +00:00
|
|
|
<classpath refid="utility.run.classpath" />
|
2011-09-11 16:48:21 +00:00
|
|
|
<arg value="@{productName}" />
|
|
|
|
<arg file="@{productCheckoutDir}" />
|
|
|
|
<arg file="${revisionInfo.build.file}" />
|
|
|
|
</java>
|
|
|
|
</sequential>
|
|
|
|
</macrodef>
|
2010-06-02 20:30:17 +00:00
|
|
|
|
2010-01-29 22:13:57 +00:00
|
|
|
</project>
|