Author: juanpablo
Date: Thu Aug 9 18:51:10 2012
New Revision: 1371378
URL: http://svn.apache.org/viewvc?rev=1371378&view=rev
Log:
* dependencies are downloaded from Central repo whenever is possible, in
order to avoid
the mantainance of a libraries' svn directory.
* ${libs.opt} set to tests/libs-opt in order to avoid download opt files
every time a
clean is made
* added clean-deps target to remove all lib's directories. Useful to remove
old jars
if the dependencies get updated.
* get rid off maven-ant-tasks to download opt-libs: too many jars get
downloaded, we're
having to ways of doing same thing and, as there are some libraries not
present in
Central repo, seems better to download all files the same way. clean-deps
target
needs to be run to ensure that maven-ant-task jar doesn't keep messing
around.
Modified:
incubator/jspwiki/trunk/build.xml
Modified: incubator/jspwiki/trunk/build.xml
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/build.xml?rev=1371378&r1=1371377&r2=1371378&view=diff
==============================================================================
--- incubator/jspwiki/trunk/build.xml (original)
+++ incubator/jspwiki/trunk/build.xml Thu Aug 9 18:51:10 2012
@@ -108,7 +108,9 @@
<!-- dirs holding libs -->
<property name="libs.main" value="lib" />
<property name="libs.tests" value="tests/lib" />
- <property name="libs.opt" value="${tests.build}/libs-opt" />
+ <property name="libs.opt" value="tests/libs-opt" />
+
+ <property name="central.url" value="http://repo.maven.apache.org/maven2" />
<!-- Web unit test properties -->
<property name="webtests.browser" value="*firefox" />
@@ -157,17 +159,25 @@
<path id="path.tests">
<pathelement location="${jarfile}" />
<pathelement location="${testjarfile}" />
- <pathelement location="${java.home}/../lib/tools.jar" />
+ <pathelement location="${java.home}/../lib/tools.jar" />
<fileset dir="${libs.main}">
<include name="*.jar" />
</fileset>
<fileset dir="${libs.tests}">
<include name="*.jar" />
- <exclude name="maven-ant-tasks-2.1.3.jar" />
</fileset>
<pathelement path="${tests.src}/etc" />
</path>
+ <!-- Path holding (L)GPL jars and their dependencies -->
+ <path id="path.optional">
+ <fileset dir="${libs.opt}">
+ <include name="*.jar" />
+ </fileset>
+ <path refid="path.base" />
+ <path refid="path.tests" />
+ </path>
+
<!-- The prefix to use when reading environment variables -->
<property environment="env" />
@@ -185,66 +195,87 @@
<mkdir dir="${@tests.pagedir@}" />
<mkdir dir="${libs.main}" />
<mkdir dir="${libs.tests}" />
- <antcall target="download-deps" />
+ <mkdir dir="${libs.opt}" />
+ <download-deps />
</target>
<target name="test-file-exists">
- <echo message="Testing for ${download-file}" level="debug"/>
- <available file="${download-file}" property="exists" />
+ <echo message="Testing for ${download-to-file}" level="debug"/>
+ <available file="${download-to-file}" property="exists" />
</target>
-
+
<target name="download-lib" unless="exists" depends="test-file-exists">
- <get src="${svn.repository}/libs/${download-file}"
dest="${download-file}" />
+ <get src="${download-url}" dest="${download-to-file}" />
</target>
- <target name="download-deps">
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/activation-1.1.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/akismet-java-1.02.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/commons-codec-1.3.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/commons-fileupload-1.2.1.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/commons-httpclient-3.0.1.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/commons-io-1.4.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/commons-lang-2.6.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/commons-logging-api-1.0.4.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/ecs-1.4.2.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/freshcookies-security-0.60.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/jakarta-tablibs-standard-1.1.2.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/jakarta-taglibs-jstl-1.1.2.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/jaxen-1.1-beta-6.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/jdom-1.0.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/jrcs-diff-0.2.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/jsonrpc-1.0.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/jsp-api-2.0.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/log4j-1.2.14.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/lucene-core-3.6.0.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/lucene-highlighter-3.6.0.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/lucene-memory-3.6.0.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/mail-1.4.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/nekohtml-0.9.4.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/oro-2.0.7.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/oscache-2.3.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/sandler-0.5.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/servlet-api-2.4.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.main}/xmlrpc-2.0.1.jar"/></antcall>
-
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/commons-el-1.0.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/custom_rhino-0.4.3.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/hsqldb-1.8.0.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/jasper-compiler-5.5.25.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/jasper-runtime-5.5.25.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/jetty-jmx-5.1.14.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/jetty-plus-5.1.14.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/jetty-servlet-5.1.14.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/junit-3.8.2.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/maven-ant-tasks-2.1.3.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/selenium-java-client-driver-1.0-beta1.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/selenium-server-1.0-beta1.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/stripes-1.5.7.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/xercesImpl-2.6.2.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/xml-apis-1.0.b2.jar"/></antcall>
- <antcall target="download-lib"><param name="download-file"
value="${libs.tests}/yuicompressor-2.4.2.jar"/></antcall>
- </target>
+ <macrodef name="get-element">
+ <attribute name="to-file" />
+ <attribute name="url" />
+ <sequential>
+ <antcall target="download-lib">
+ <param name="download-to-file" value="@{to-file}"/>
+ <param name="download-url" value="@{url}" />
+ </antcall>
+ </sequential>
+ </macrodef>
+ <macrodef name="download-deps">
+ <sequential>
+ <!-- main dependencies -->
+ <get-element to-file="${libs.main}/activation-1.1.jar"
url="${central.url}/javax/activation/activation/1.1/activation-1.1.jar" />
+ <get-element to-file="${libs.main}/akismet-java-1.02.jar"
url="${svn.repository}/libs/${libs.main}/akismet-java-1.02.jar" />
+ <get-element to-file="${libs.main}/commons-codec-1.3.jar"
url="${central.url}/commons-codec/commons-codec/1.3/commons-codec-1.3.jar" />
+ <get-element to-file="${libs.main}/commons-fileupload-1.2.1.jar"
url="${central.url}/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar"
/>
+ <get-element to-file="${libs.main}/commons-httpclient-3.0.1.jar"
url="${central.url}/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"
/>
+ <get-element to-file="${libs.main}/commons-io-1.4.jar"
url="${central.url}/commons-io/commons-io/1.4/commons-io-1.4.jar" />
+ <get-element to-file="${libs.main}/commons-lang-2.6.jar"
url="${central.url}/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" />
+ <get-element to-file="${libs.main}/commons-logging-api-1.0.4.jar"
url="${central.url}/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar"
/>
+ <get-element to-file="${libs.main}/ecs-1.4.2.jar"
url="${central.url}/ecs/ecs/1.4.2/ecs-1.4.2.jar" />
+ <get-element to-file="${libs.main}/freshcookies-security-0.60.jar"
url="${svn.repository}/libs/${libs.main}/freshcookies-security-0.60.jar" />
+ <get-element to-file="${libs.main}/jakarta-tablibs-standard-1.1.2.jar"
url="${svn.repository}/libs/${libs.main}/jakarta-tablibs-standard-1.1.2.jar" />
+ <get-element to-file="${libs.main}/jakarta-taglibs-jstl-1.1.2.jar"
url="${svn.repository}/libs/${libs.main}/jakarta-taglibs-jstl-1.1.2.jar" />
+ <get-element to-file="${libs.main}/jaxen-1.1-beta-6.jar"
url="${central.url}/jaxen/jaxen/1.1-beta-6/jaxen-1.1-beta-6.jar" />
+ <get-element to-file="${libs.main}/jdom-1.0.jar"
url="${central.url}/jdom/jdom/1.0/jdom-1.0.jar" />
+ <get-element to-file="${libs.main}/jrcs-diff-0.2.jar"
url="${svn.repository}/libs/${libs.main}/jrcs-diff-0.2.jar" />
+ <get-element to-file="${libs.main}/jsonrpc-1.0.jar"
url="${svn.repository}/libs/${libs.main}/jsonrpc-1.0.jar" />
+ <get-element to-file="${libs.main}/jsp-api-2.0.jar"
url="${central.url}/javax/servlet/jsp/jsp-api/2.0/jsp-api-2.0.jar" />
+ <get-element to-file="${libs.main}/log4j-1.2.14.jar"
url="${central.url}/log4j/log4j/1.2.14/log4j-1.2.14.jar" />
+ <get-element to-file="${libs.main}/lucene-core-3.6.0.jar"
url="${central.url}/org/apache/lucene/lucene-core/3.6.0/lucene-core-3.6.0.jar"
/>
+ <get-element to-file="${libs.main}/lucene-highlighter-3.6.0.jar"
url="${central.url}/org/apache/lucene/lucene-highlighter/3.6.0/lucene-highlighter-3.6.0.jar"
/>
+ <get-element to-file="${libs.main}/lucene-memory-3.6.0.jar"
url="${central.url}/org/apache/lucene/lucene-memory/3.6.0/lucene-memory-3.6.0.jar"
/>
+ <get-element to-file="${libs.main}/mail-1.4.jar"
url="${central.url}/javax/mail/mail/1.4/mail-1.4.jar" />
+ <get-element to-file="${libs.main}/nekohtml-0.9.4.jar"
url="${central.url}/nekohtml/nekohtml/0.9.4/nekohtml-0.9.4.jar" />
+ <get-element to-file="${libs.main}/oro-2.0.7.jar"
url="${central.url}/oro/oro/2.0.7/oro-2.0.7.jar" />
+ <get-element to-file="${libs.main}/oscache-2.3.jar"
url="${central.url}/opensymphony/oscache/2.3/oscache-2.3.jar" />
+ <get-element to-file="${libs.main}/sandler-0.5.jar"
url="${svn.repository}/libs/${libs.main}/sandler-0.5.jar" />
+ <get-element to-file="${libs.main}/servlet-api-2.4.jar"
url="${central.url}/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar" />
+ <get-element to-file="${libs.main}/xmlrpc-2.0.1.jar"
url="${central.url}/xmlrpc/xmlrpc/2.0.1/xmlrpc-2.0.1.jar" />
+
+ <!-- tests dependencies -->
+ <get-element to-file="${libs.tests}/commons-el-1.0.jar"
url="${central.url}/commons-el/commons-el/1.0/commons-el-1.0.jar" />
+ <get-element to-file="${libs.tests}/custom_rhino-0.4.3.jar"
url="${central.url}/org/dojotoolkit/custom_rhino/0.4.3/custom_rhino-0.4.3.jar"
/>
+ <get-element to-file="${libs.tests}/hsqldb-1.8.0.jar"
url="${svn.repository}/libs/${libs.tests}/hsqldb-1.8.0.jar" />
+ <get-element to-file="${libs.tests}/jasper-compiler-5.5.25.jar"
url="${svn.repository}/libs/${libs.tests}/jasper-compiler-5.5.25.jar" />
+ <get-element to-file="${libs.tests}/jasper-runtime-5.5.25.jar"
url="${svn.repository}/libs/${libs.tests}/jasper-runtime-5.5.25.jar" />
+ <get-element to-file="${libs.tests}/jetty-jmx-5.1.14.jar"
url="${svn.repository}/libs/${libs.tests}/jetty-jmx-5.1.14.jar" />
+ <get-element to-file="${libs.tests}/jetty-plus-5.1.14.jar"
url="${svn.repository}/libs/${libs.tests}/jetty-plus-5.1.14.jar" />
+ <get-element to-file="${libs.tests}/jetty-servlet-5.1.14.jar"
url="${svn.repository}/libs/${libs.tests}/jetty-servlet-5.1.14.jar" />
+ <get-element to-file="${libs.tests}/junit-3.8.2.jar"
url="${central.url}/junit/junit/3.8.2/junit-3.8.2.jar" />
+ <get-element
to-file="${libs.tests}/selenium-java-client-driver-1.0-beta1.jar"
url="${svn.repository}/libs/${libs.tests}/selenium-java-client-driver-1.0-beta1.jar"
/>
+ <get-element to-file="${libs.tests}/selenium-server-1.0-beta1.jar"
url="${svn.repository}/libs/${libs.tests}/selenium-server-1.0-beta1.jar" />
+ <get-element to-file="${libs.tests}/stripes-1.5.7.jar"
url="${central.url}/net/sourceforge/stripes/stripes/1.5.7/stripes-1.5.7.jar" />
+ <get-element to-file="${libs.tests}/xercesImpl-2.6.2.jar"
url="${central.url}/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar" />
+ <get-element to-file="${libs.tests}/xml-apis-1.0.b2.jar"
url="${central.url}/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" />
+ <get-element to-file="${libs.tests}/yuicompressor-2.4.2.jar"
url="${central.url}/com/yahoo/platform/yui/yuicompressor/2.4.2/yuicompressor-2.4.2.jar"
/>
+
+ <!-- other dependencies ((L)GPL dependencies and jars needed by these)
-->
+ <get-element to-file="${libs.opt}/cobertura-1.9.4.1.jar"
url="${central.url}/net/sourceforge/cobertura/cobertura/1.9.4.1/cobertura-1.9.4.1.jar"
/>
+ <get-element to-file="${libs.opt}/asm-3.0.jar"
url="${central.url}/asm/asm/3.0/asm-3.0.jar" />
+ <get-element to-file="${libs.opt}/asm-tree-3.0.jar"
url="${central.url}/asm/asm-tree/3.0/asm-tree-3.0.jar" />
+ <get-element to-file="${libs.opt}/sonar-ant-task-1.4.jar"
url="${central.url}/org/codehaus/sonar-plugins/sonar-ant-task/1.4/sonar-ant-task-1.4.jar"
/>
+ </sequential>
+ </macrodef>
+
<target name="mkpropertyfile"
description="Builds the correct propertyfile from the
build.properties">
<copy file="etc/jspwiki.properties.tmpl" tofile="etc/jspwiki.properties"
/>
@@ -264,7 +295,7 @@
<!-- Removes the build directory and the tests build directory -->
<target name="clean"
description="Cleans away all generated files.">
- <delete dir="${tests.build}" />
+ <delete dir="${tests.build}" />
<delete dir="${code.build}" />
<delete dir="${tests.reports}" />
<delete dir="${docs.javadoc}" />
@@ -285,6 +316,14 @@
<fileset dir="." includes="**/#*#" defaultexcludes="no"/>
</delete>
</target>
+
+ <!-- Removes all lib directories -->
+ <target name="clean-deps"
+ description="Cleans away all downloaded files.">
+ <delete dir="${libs.main}" />
+ <delete dir="${libs.tests}" />
+ <delete dir="${libs.opt}" />
+ </target>
<!-- ============================================================== -->
@@ -1626,39 +1665,8 @@ To automate the JAR signing processs, yo
</xslt>
</target>
- <target name="optional-dependencies-download"
xmlns:artifact="urn:maven-artifact-ant">
- <mkdir dir="${libs.opt}" />
- <!-- bootstrap maven ant asks -->
- <path id="path.maven.ant.tasks">
- <pathelement location="tests/lib/maven-ant-tasks-2.1.3.jar" />
- </path>
- <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
- uri="urn:maven-artifact-ant"
- classpathref="path.maven.ant.tasks" />
-
- <!-- download optional dependencies -->
- <artifact:localRepository id="local.repository" path="${libs.opt}"/>
-
- <artifact:dependencies pathId="cobertura.classpath">
- <dependency groupId="net.sourceforge.cobertura"
artifactId="cobertura" version="1.9.4.1" scope="compile" />
- <remoteRepository id="central"
url="http://repo.maven.apache.org/maven2/" />
- <localRepository refid="local.repository"/>
- </artifact:dependencies>
-
- <artifact:dependencies pathId="sonar.classpath">
- <dependency groupId="org.codehaus.sonar-plugins"
artifactId="sonar-ant-task" version="1.4" scope="compile" />
- <remoteRepository id="central"
url="http://repo.maven.apache.org/maven2/" />
- <localRepository refid="local.repository"/>
- </artifact:dependencies>
- </target>
-
- <target name="coverage-tests"
depends="optional-dependencies-download,compile,tests">
- <path id="path.optional">
- <fileset dir="${libs.opt}">
- <include name="**/*.jar" />
- </fileset>
- </path>
- <!-- bootstrap cobertura ant-tasks -->
+ <target name="coverage-tests" depends="compile,tests">
+ <!-- bootstrap cobertura ant-tasks -->
<taskdef classpathref="path.optional" resource="tasks.properties" />
<cobertura-instrument todir="${tests.build}/instrumented-classes"
datafile="${tests.build}/cobertura.ser">
@@ -1669,7 +1677,6 @@ To automate the JAR signing processs, yo
<junit haltonfailure="no" fork="yes">
<classpath>
<path location="${tests.build}/instrumented-classes" />
- <path refid="path.tests" />
<path refid="path.optional" />
</classpath>
<formatter type="xml" />
@@ -1691,11 +1698,6 @@ To automate the JAR signing processs, yo
</target>
<target name="sonar" depends="coverage-tests">
- <path id="path.optional">
- <fileset dir="${libs.opt}">
- <include name="**/*.jar" />
- </fileset>
- </path>
<!-- bootstrap sonar ant tasks -->
<typedef resource="org/sonar/ant/antlib.xml"
uri="antlib:org.sonar.ant"