diff -Nru ant-1.9.10/build.xml ant-1.10.3/build.xml
--- ant-1.9.10/build.xml 2018-02-03 16:12:26.000000000 +0000
+++ ant-1.10.3/build.xml 2018-03-24 12:37:12.000000000 +0000
@@ -31,12 +31,12 @@
-->
-
+
-
+
-
-
+
+
@@ -45,7 +45,7 @@
-
+
@@ -60,14 +60,13 @@
-
-
-
+
-
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
@@ -121,7 +120,6 @@
-
+
+
+
+
+
+
+
+
@@ -293,6 +305,13 @@
+
+
+
+
+
+
+
@@ -317,8 +336,10 @@
+
+
@@ -337,7 +358,7 @@
-
+
@@ -374,9 +395,6 @@
-
-
-
@@ -402,6 +420,15 @@
+
+
+
@@ -444,15 +471,9 @@
-
-
-
-
-
-
-
+
@@ -511,30 +532,19 @@
+
-
+
-
-
-
-
-
-
-
-
-
+
@@ -556,7 +566,7 @@
Build the code
===================================================================
-->
-
@@ -576,17 +586,19 @@
-
+
+
+
-
+
@@ -595,6 +607,7 @@
+
@@ -624,6 +637,8 @@
+
+
@@ -647,28 +662,8 @@
-
-
-
-
-
@@ -681,8 +676,7 @@
@@ -690,10 +684,10 @@
-
+
-
@@ -717,7 +711,6 @@
@@ -725,8 +718,8 @@
-
+
+
@@ -734,14 +727,31 @@
+
+
+
@@ -749,6 +759,7 @@
+
@@ -765,6 +776,7 @@
+
@@ -776,7 +788,7 @@
We cannot build the test jar unless JUnit is present,
as JUnit is needed to compile the test classes.
-
@@ -841,6 +853,7 @@
+
@@ -857,6 +870,7 @@
+
@@ -909,18 +923,23 @@
-
-
-
+
+
+
+
+
+
+
-
+
@@ -957,9 +976,9 @@
-
+
-
+
@@ -1020,18 +1039,23 @@
-
-
-
+
+
+
+
+
+
+
-
+
@@ -1135,18 +1159,26 @@
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
@@ -1196,10 +1228,28 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1229,6 +1279,8 @@
src="${dist.base.binaries}/${dist.name}-bin.tar"/>
+
@@ -1282,19 +1334,19 @@
src="${dist.base.manual}/${dist.name}-manual.tar"/>
+
-
-
@@ -1333,12 +1385,13 @@
src="${dist.base.source}/${dist.name}-src.tar"/>
+
-
@@ -1373,8 +1426,10 @@
description="--> cleans up everything">
-
-
+
+
+
+
-
+
+ targetfile="${build.javadocs}/packages.html">
+ targetfile="${build.tests.javadocs}/packages.html">
+
+
+
-
+
-
+
+
+
+
+
@@ -1626,6 +1690,11 @@
+
+
+
+
@@ -1763,8 +1832,7 @@
-
+
@@ -1936,6 +2004,9 @@
+
+
+
diff -Nru ant-1.9.10/CONTRIBUTORS ant-1.10.3/CONTRIBUTORS
--- ant-1.9.10/CONTRIBUTORS 2018-02-03 16:12:26.000000000 +0000
+++ ant-1.10.3/CONTRIBUTORS 2018-03-24 12:37:12.000000000 +0000
@@ -287,6 +287,7 @@
Nigel Magnay
Oliver Merkel
Oliver Rossmueller
+Olivier Parent
Ondra Medek
Omer Shapira
Oystein Gisnas
diff -Nru ant-1.9.10/contributors.xml ant-1.10.3/contributors.xml
--- ant-1.9.10/contributors.xml 2018-02-03 16:12:26.000000000 +0000
+++ ant-1.10.3/contributors.xml 2018-03-24 12:37:12.000000000 +0000
@@ -40,6 +40,10 @@
Adam
+ Retter
+
+
+ Adam
Sotona
@@ -1169,6 +1173,10 @@
Rossmueller
+ Olivier
+ Parent
+
+
Omer
Shapira
diff -Nru ant-1.9.10/debian/ant-optional.poms ant-1.10.3/debian/ant-optional.poms
--- ant-1.9.10/debian/ant-optional.poms 2018-02-23 10:48:52.000000000 +0000
+++ ant-1.10.3/debian/ant-optional.poms 2018-03-27 23:41:26.000000000 +0000
@@ -16,3 +16,4 @@
src/etc/poms/ant-junit4/pom.xml
src/etc/poms/ant-swing/pom.xml
src/etc/poms/ant-testutil/pom.xml
+src/etc/poms/ant-xz/pom.xml
diff -Nru ant-1.9.10/debian/ant.properties ant-1.10.3/debian/ant.properties
--- ant-1.9.10/debian/ant.properties 2018-02-23 10:48:52.000000000 +0000
+++ ant-1.10.3/debian/ant.properties 2018-03-27 23:41:26.000000000 +0000
@@ -1,5 +1,5 @@
base64.present=true
sunuue.present=true
offline=true
-javac.target=1.5
-javac.source=1.5
+javac.target=1.8
+javac.source=1.8
diff -Nru ant-1.9.10/debian/changelog ant-1.10.3/debian/changelog
--- ant-1.9.10/debian/changelog 2018-03-19 09:04:26.000000000 +0000
+++ ant-1.10.3/debian/changelog 2018-03-29 07:35:04.000000000 +0000
@@ -1,3 +1,19 @@
+ant (1.10.3-1) unstable; urgency=medium
+
+ * New upstream release
+ - Refreshed the patches
+ - Changed the source/target level to 1.8 when building Ant
+ - Build the new optional ant-xz module
+ - Require Java 8 or higher to run Ant
+ * Don't use the javadoc --ignore-source-errors option when using
+ a custom doclet (Closes: #893547)
+ * Adjust the source/target level to 1.7 in anticipation of the 1.6 removal
+ in Java 11
+ * Added activation.jar to the build classpath to fix the empty ant-javamail
+ jar with Java 9
+
+ -- Emmanuel Bourg Thu, 29 Mar 2018 09:35:04 +0200
+
ant (1.9.10-2) unstable; urgency=medium
* Non maintainer upload.
diff -Nru ant-1.9.10/debian/control ant-1.10.3/debian/control
--- ant-1.9.10/debian/control 2018-03-19 09:04:26.000000000 +0000
+++ ant-1.10.3/debian/control 2018-03-27 23:58:06.000000000 +0000
@@ -10,6 +10,7 @@
default-jdk,
junit,
junit4 (>= 4.11),
+ libactivation-java,
libbcel-java (>= 5.0),
libbsf-java (>= 2.3.0rc1),
libcommons-logging-java,
@@ -22,6 +23,7 @@
libregexp-java,
libxalan2-java (>= 2.4.0),
libxml-commons-resolver1.1-java (>= 1.2-7~),
+ libxz-java,
maven-repo-helper (>> 1.0)
Standards-Version: 4.1.3
Vcs-Git: https://anonscm.debian.org/git/pkg-java/ant.git
@@ -30,7 +32,7 @@
Package: ant
Architecture: all
-Depends: default-jre-headless | java5-runtime-headless | java6-runtime-headless | java7-runtime-headless,
+Depends: default-jre-headless (>= 2:1.8) | java8-runtime-headless,
${misc:Depends}
Recommends: ant-optional
Suggests: ant-doc, default-jdk | java-compiler | java-sdk
@@ -54,6 +56,7 @@
junit,
junit4,
jython,
+ libactivation-java,
libbcel-java (>= 5.0),
libbsf-java,
libcommons-logging-java,
@@ -66,7 +69,8 @@
liboro-java,
libregexp-java,
libxalan2-java (>= 2.4.0-1),
- libxml-commons-resolver1.1-java
+ libxml-commons-resolver1.1-java,
+ libxz-java
Description: Java based build tool like make - optional libraries
Apache Ant is a Java library and command-line tool whose mission is to drive
processes described in build files as targets and extension points dependent
diff -Nru ant-1.9.10/debian/patches/0009-reproducible-timestamp-task.patch ant-1.10.3/debian/patches/0009-reproducible-timestamp-task.patch
--- ant-1.9.10/debian/patches/0009-reproducible-timestamp-task.patch 2018-02-23 14:03:13.000000000 +0000
+++ ant-1.10.3/debian/patches/0009-reproducible-timestamp-task.patch 2018-03-27 23:41:26.000000000 +0000
@@ -1,18 +1,13 @@
-From: Emmanuel Bourg
-Date: Mon, 28 Mar 2016 01:45:52 +0200
-Subject: Add support for the SOURCE_DATE_EPOCH variable in the Tstamp task
-
+Description: Add support for the SOURCE_DATE_EPOCH variable in the Tstamp task
+Author: Emmanuel Bourg
Forwarded: no
----
- src/main/org/apache/tools/ant/taskdefs/Tstamp.java | 39 ++++++++++++++++++++++
- 1 file changed, 39 insertions(+)
-
--- a/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
-@@ -71,20 +71,51 @@
+@@ -76,16 +76,49 @@
try {
Date d = getNow();
+- customFormats.forEach(cts -> cts.execute(getProject(), d, getLocation()));
+ boolean reproducibleBuild = false;
+
+ if (System.getenv("SOURCE_DATE_EPOCH") != null) {
@@ -27,9 +22,7 @@
+ }
+ }
+
- Enumeration i = customFormats.elements();
- while (i.hasMoreElements()) {
- CustomFormat cts = (CustomFormat) i.nextElement();
++ for (CustomFormat cts : customFormats) {
+ if (reproducibleBuild) {
+ if (cts.getTimezone() == null) {
+ cts.setTimezone("UTC");
@@ -38,8 +31,8 @@
+ cts.setLocale("en_US");
+ }
+ }
- cts.execute(getProject(), d, getLocation());
- }
++ cts.execute(getProject(), d, getLocation());
++ }
SimpleDateFormat dstamp = new SimpleDateFormat("yyyyMMdd");
+ if (reproducibleBuild) {
@@ -61,7 +54,7 @@
setProperty("TODAY", today.format(d));
} catch (Exception e) {
-@@ -200,6 +231,10 @@
+@@ -220,6 +253,10 @@
}
}
@@ -72,7 +65,7 @@
/**
* The timezone to use for displaying time.
* The values are as defined by the Java TimeZone class.
-@@ -210,6 +245,10 @@
+@@ -230,6 +267,10 @@
timeZone = TimeZone.getTimeZone(id);
}
diff -Nru ant-1.9.10/debian/patches/0010-reproducible-javadoc-task.patch ant-1.10.3/debian/patches/0010-reproducible-javadoc-task.patch
--- ant-1.9.10/debian/patches/0010-reproducible-javadoc-task.patch 2018-02-23 14:03:13.000000000 +0000
+++ ant-1.10.3/debian/patches/0010-reproducible-javadoc-task.patch 2018-03-27 23:41:26.000000000 +0000
@@ -1,17 +1,11 @@
-From: Emmanuel Bourg
-Date: Mon, 28 Mar 2016 02:00:16 +0200
-Subject: Improves the reproducibility of the javadoc task for the Debian
+Description: Improves the reproducibility of the javadoc task for the Debian
builds by setting the locale to 'en' and the encoding to UTF-8 if none was
specified and SOURCE_DATE_EPOCH is set.
-
+Author: Emmanuel Bourg
Forwarded: no
----
- src/main/org/apache/tools/ant/taskdefs/Javadoc.java | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
--- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
-@@ -1707,6 +1707,16 @@
+@@ -1700,6 +1700,16 @@
*/
@Override
public void execute() throws BuildException {
@@ -27,4 +21,4 @@
+
checkTaskName();
- final Vector packagesToDoc = new Vector();
+ final List packagesToDoc = new Vector<>();
diff -Nru ant-1.9.10/debian/patches/0011-reproducible-propertyfile-task.patch ant-1.10.3/debian/patches/0011-reproducible-propertyfile-task.patch
--- ant-1.9.10/debian/patches/0011-reproducible-propertyfile-task.patch 2018-02-23 14:03:13.000000000 +0000
+++ ant-1.10.3/debian/patches/0011-reproducible-propertyfile-task.patch 2018-03-27 23:41:26.000000000 +0000
@@ -1,14 +1,8 @@
-From: Emmanuel Bourg
-Date: Tue, 24 May 2016 00:22:11 +0200
-Subject: Improves the reproducibility of the propertyfile task for the Debian
+Description: Improves the reproducibility of the propertyfile task for the Debian
builds by using the date specified by the SOURCE_DATE_EPOCH variable in the
header of the .properties file generated
-
+Author: Emmanuel Bourg
Forwarded: no
----
- src/main/org/apache/tools/ant/util/DateUtils.java | 5 +++++
- 1 file changed, 5 insertions(+)
-
--- a/src/main/org/apache/tools/ant/util/DateUtils.java
+++ b/src/main/org/apache/tools/ant/util/DateUtils.java
@@ -238,6 +238,10 @@
diff -Nru ant-1.9.10/debian/patches/0013-auto-adjust-target.patch ant-1.10.3/debian/patches/0013-auto-adjust-target.patch
--- ant-1.9.10/debian/patches/0013-auto-adjust-target.patch 2018-02-23 14:03:13.000000000 +0000
+++ ant-1.10.3/debian/patches/0013-auto-adjust-target.patch 2018-03-29 07:19:33.000000000 +0000
@@ -1,19 +1,9 @@
-From: "ebourg@apache.org"
-Date: Fri, 30 Jun 2017 00:35:44 +0200
-Subject: Adjust the source compatibility automatically for Debian builds with
- Java 9
-
+Description: Adjust the source compatibility automatically for Debian builds with Java 9
+Author: Emmanuel Bourg
Forwarded: no
----
- src/main/org/apache/tools/ant/taskdefs/Javac.java | 13 ++++-
- .../org/apache/tools/ant/taskdefs/Javadoc.java | 7 ++-
- .../apache/tools/ant/taskdefs/LanguageLevel.java | 62 ++++++++++++++++++++++
- 3 files changed, 79 insertions(+), 3 deletions(-)
- create mode 100644 src/main/org/apache/tools/ant/taskdefs/LanguageLevel.java
-
--- a/src/main/org/apache/tools/ant/taskdefs/Javac.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Javac.java
-@@ -210,7 +210,10 @@
+@@ -213,7 +213,10 @@
*/
public String getSource() {
return source != null
@@ -25,7 +15,7 @@
}
/**
-@@ -789,7 +792,10 @@
+@@ -792,7 +795,10 @@
public String getTarget() {
return targetAttribute != null
? targetAttribute
@@ -37,7 +27,7 @@
}
/**
-@@ -1118,6 +1124,9 @@
+@@ -1121,6 +1127,9 @@
checkParameters();
resetFileLists();
@@ -49,17 +39,12 @@
if (hasPath(src)) {
--- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
-@@ -2207,7 +2207,12 @@
+@@ -2174,7 +2174,7 @@
: getProject().getProperty(MagicNames.BUILD_JAVAC_SOURCE);
if (sourceArg != null) {
toExecute.createArgument().setValue("-source");
- toExecute.createArgument().setValue(sourceArg);
+ toExecute.createArgument().setValue(LanguageLevel.adjust(sourceArg, "javadoc -source", this));
-+ }
-+
-+ if (LanguageLevel.isDebianBuild() && !LanguageLevel.isPreJava9()) {
-+ toExecute.createArgument().setValue("--ignore-source-errors");
-+ log("Debian build on Java >=9: Adding --ignore-source-errors.");
}
if (linksource && doclet == null) {
@@ -77,10 +62,10 @@
+class LanguageLevel {
+
+ /** The minimum language level supported by the current javac */
-+ private static final String MIN_LEVEL = "1.6";
++ private static final String MIN_LEVEL = "1.7";
+
+ /** The list of language levels no longer supported by the current javac */
-+ private static final List UNSUPPORTED_LEVELS = Arrays.asList(new String[]{"1.1", "1.2", "1.3", "1.4", "1.5", "5"});
++ private static final List UNSUPPORTED_LEVELS = Arrays.asList(new String[]{"1.1", "1.2", "1.3", "1.4", "1.5", "5", "1.6", "6"});
+
+ /** Detect if a Debian build is in process */
+ static boolean isDebianBuild() {
diff -Nru ant-1.9.10/debian/patches/0014-remove-java-activation-module.patch ant-1.10.3/debian/patches/0014-remove-java-activation-module.patch
--- ant-1.9.10/debian/patches/0014-remove-java-activation-module.patch 1970-01-01 00:00:00.000000000 +0000
+++ ant-1.10.3/debian/patches/0014-remove-java-activation-module.patch 2018-03-27 23:55:42.000000000 +0000
@@ -0,0 +1,13 @@
+Description: Don't add the java.activation module when building the Javadoc, this breaks the build, probably because JAF is already on the classpath
+Author: Emmanuel Bourg
+Forwarded: no
+--- a/build.xml
++++ b/build.xml
+@@ -1502,7 +1502,6 @@
+
+
+
+-
+
+
+
diff -Nru ant-1.9.10/debian/patches/0015-javadoc-ignore-source-errors.patch ant-1.10.3/debian/patches/0015-javadoc-ignore-source-errors.patch
--- ant-1.9.10/debian/patches/0015-javadoc-ignore-source-errors.patch 1970-01-01 00:00:00.000000000 +0000
+++ ant-1.10.3/debian/patches/0015-javadoc-ignore-source-errors.patch 2018-03-29 07:24:08.000000000 +0000
@@ -0,0 +1,17 @@
+Description: Ignore source errors when using the default doclet with Java 9
+Author: Emmanuel Bourg
+Forwarded: no
+--- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
++++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
+@@ -2177,6 +2177,11 @@
+ toExecute.createArgument().setValue(LanguageLevel.adjust(sourceArg, "javadoc -source", this));
+ }
+
++ if (doclet == null && LanguageLevel.isDebianBuild() && !LanguageLevel.isPreJava9()) {
++ toExecute.createArgument().setValue("--ignore-source-errors");
++ log("Debian build on Java 9+ detected: Adding the --ignore-source-errors option");
++ }
++
+ if (linksource && doclet == null) {
+ toExecute.createArgument().setValue("-linksource");
+ }
diff -Nru ant-1.9.10/debian/patches/series ant-1.10.3/debian/patches/series
--- ant-1.9.10/debian/patches/series 2018-02-23 10:48:52.000000000 +0000
+++ ant-1.10.3/debian/patches/series 2018-03-29 07:20:10.000000000 +0000
@@ -2,3 +2,5 @@
0010-reproducible-javadoc-task.patch
0011-reproducible-propertyfile-task.patch
0013-auto-adjust-target.patch
+0015-javadoc-ignore-source-errors.patch
+0014-remove-java-activation-module.patch
diff -Nru ant-1.9.10/debian/rules ant-1.10.3/debian/rules
--- ant-1.9.10/debian/rules 2018-03-19 09:04:24.000000000 +0000
+++ ant-1.10.3/debian/rules 2018-03-27 23:41:26.000000000 +0000
@@ -1,6 +1,6 @@
#!/usr/bin/make -f
-DEPENDENCIES := antlr bcel bsf commons-logging javax.mail jdepend junit junit4 hamcrest-core log4j-1.2 oro regexp xalan2 serializer xml-resolver-1.2 commons-net jsch
+DEPENDENCIES := antlr bcel bsf commons-logging javax.activation javax.mail jdepend junit junit4 hamcrest-core log4j-1.2 oro regexp xalan2 serializer xml-resolver-1.2 commons-net jsch xz
%:
dh $@ --with maven-repo-helper
@@ -31,7 +31,7 @@
mh_installpoms -pant-optional
for MODULE in antlr apache-bcel apache-bsf apache-log4j apache-oro apache-regexp apache-resolver apache-xalan2 \
- commons-logging commons-net javamail jdepend jmf jsch junit junit4 swing testutil; do \
+ commons-logging commons-net javamail jdepend jmf jsch junit junit4 swing testutil xz; do \
mh_installjar -pant-optional -l src/etc/poms/ant-$$MODULE/pom.xml build/lib/ant-$$MODULE.jar /usr/share/ant/lib/ant-$$MODULE.jar; \
done
@@ -48,10 +48,6 @@
override_dh_compress:
dh_compress -XWHATSNEW
-# Hardening
-export AOT_GCJFLAGS=$(shell dpkg-buildflags --get CFLAGS)
-export AOT_LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
-
override_dh_auto_clean:
rm -Rf bin build bootstrap lib/optional/*.jar
diff -Nru ant-1.9.10/fetch.xml ant-1.10.3/fetch.xml
--- ant-1.9.10/fetch.xml 2018-02-03 16:12:26.000000000 +0000
+++ ant-1.10.3/fetch.xml 2018-03-24 12:37:12.000000000 +0000
@@ -109,6 +109,7 @@
+
Unknown archive @{archive} -no property @{archive}.version defined in ${lib.dir}/libraries.properties.
@@ -118,7 +119,6 @@
-
+
@@ -231,6 +232,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -261,7 +280,7 @@
-
+
-
-
-
@@ -359,8 +377,14 @@
dest="${temp.dir}/NetRexx.zip" skipexisting="true"/>
+
+
+
+
-
+ depends="antunit,ivy,logging,junit,junitlauncher,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,
+ javamail,jspc,jai,xz,netrexx,junit-engine-vintage,junit-engine-jupiter"/>
diff -Nru ant-1.9.10/lib/libraries.properties ant-1.10.3/lib/libraries.properties
--- ant-1.9.10/lib/libraries.properties 2018-02-03 16:12:24.000000000 +0000
+++ ant-1.10.3/lib/libraries.properties 2018-03-24 12:37:12.000000000 +0000
@@ -31,15 +31,13 @@
# Versions of different libraries. Please keep in alphabetical order, except
# when a specific dependency forces them to be out-of-order
ivy.version=2.4.0
-activation.version=1.1.1
ant-antunit.version=1.3
antlr.version=2.7.7
-bcel.version=5.1
+bcel.version=6.2
bsf.version=2.4.0
bsh.version=2.0b4
bsh-core.version=${bsh.version}
-# Later versions are built with Java 6
-commons-net.version=2.2
+commons-net.version=3.6
commons-logging.version=1.1
commons-logging-api.version=${commons-logging.version}
hamcrest-core.version=1.3
@@ -50,16 +48,18 @@
# Later versions of Tomcat provide a jspc task
jasper-compiler.version=4.1.36
jasper-runtime.version=${jasper-compiler.version}
-# Later versions are built with Java 7
-javax.mail-api.version=1.5.6
+javax.mail-api.version=1.6.0
jdepend.version=2.9.1
-# Later versions are built with Java 7
jruby.version=1.6.8
junit.version=4.12
-# Later versions are built with Java 6
-rhino.version=1.7R5
+rhino.version=1.7.8
+junit-platform-launcher.version=1.1.0
+# Only used for internal tests in Ant project
+junit-vintage-engine.version=5.1.0
+# Only used for internal tests in Ant project
+junit-jupiter-engine.version=5.1.0
jsch.version=0.1.54
-jython.version=2.5.3
+jython.version=2.7.0
# log4j 1.2.15 requires JMS and a few other Sun jars that are not in the m2 repo
log4j.version=1.2.14
oro.version=2.0.8
@@ -67,6 +67,7 @@
which.version=1.0
xalan.version=2.7.2
xml-resolver.version=1.2
+xz.version=1.8
# paired
jacl.version=1.2.6
tcljava.version=${jacl.version}
diff -Nru ant-1.9.10/manual/antexternal.html ant-1.10.3/manual/antexternal.html
--- ant-1.9.10/manual/antexternal.html 2018-02-03 16:12:26.000000000 +0000
+++ ant-1.10.3/manual/antexternal.html 2018-03-24 12:37:12.000000000 +0000
@@ -14,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
@@ -29,16 +28,16 @@
Apache Ant provides a rich set of tasks for buildfile creators and
administrators. But what about programmers? Can the functionality
-provided by Ant tasks be used in java programs?
+provided by Ant tasks be used in Java programs?
-Yes, and its quite easy. Before getting into the details, however,
+
Yes, and its quite easy. Before getting into the details, however,
we should mention the pros and cons of this approach:
Pros
-
+
-Robust |
+Robust |
Ant tasks are very robust. They have been banged on by many people.
Ant tasks have been used in many different contexts, and have
@@ -47,7 +46,7 @@
|
-Cross Platform |
+Cross Platform |
Ant tasks are cross platform. They have been tested on all of the
volume platforms, and several rather unusual ones (Netware and OS/390, to
@@ -55,7 +54,7 @@
|
-Community Support |
+Community Support |
Using Ant tasks means you have less of your own code to support. Ant
code is supported by the entire Apache Ant community.
@@ -65,18 +64,18 @@
Cons
-
+
-Dependency on Ant Libraries |
+Dependency on Ant Libraries |
Obviously, if you use an Ant task in your code, you will have to add
-"ant.jar" to your path. Of course, you could use a code optimizer to
+ant.jar to your path. Of course, you could use a code optimizer to
remove the unnecessary classes, but you will still probably require a
chunk of the Ant core.
|
-Loss of Flexibility |
+Loss of Flexibility |
At some point, if you find yourself having to modify the Ant code, it
probably makes more sense to "roll your own." Of course, you can
@@ -86,7 +85,6 @@
|
-
Example
Let's say you want to unzip a zip file programmatically from java
@@ -109,8 +107,8 @@
-The Ant task to perform this function is
-org.apache.tools.ant.taskdefs.Expand . All we have to do
+The Ant task to perform this function
+is org.apache.tools.ant.taskdefs.Expand . All we have to do
is create a dummy Ant Project and Target ,
set the Task parameters that would normally be set in a
buildfile, and call execute() .
@@ -121,8 +119,7 @@
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Target;
import org.apache.tools.ant.taskdefs.Expand;
-import java.io.File;
-
+import java.io.File;
The function call is actually quite simple:
@@ -131,30 +128,30 @@
final class Expander extends Expand {
public Expander() {
- project = new Project();
- project.init();
- taskType = "unzip";
- taskName = "unzip";
- target = new Target();
- }
+ project = new Project();
+ project.init();
+ taskType = "unzip";
+ taskName = "unzip";
+ target = new Target();
+ }
}
Expander expander = new Expander();
expander.setSrc(new File(zipfile));
expander.setDest(new File(destdir));
expander.execute();
-
+}
In actual practice, you will probably want to add your own error
handling code and you may not want to use a local inner class.
However, the point of the example is to show how an Ant task can be
called programmatically in relatively few lines of code.
-The question you are probably asking yourself at this point is:
-How would I know which classes and methods have to be called in
-order to set up a dummy Project and Target? The answer is: you
+ The question you are probably asking yourself at this point
+is: How would I know which classes and methods have to be called in
+order to set up a dummy Project and Target? The answer is: you
don't. Ultimately, you have to be willing to get your feet wet and
read the source code. The above example is merely designed to whet
your appetite and get you started. Go for it!
-
+
diff -Nru ant-1.9.10/manual/anttaskslist.html ant-1.10.3/manual/anttaskslist.html
--- ant-1.9.10/manual/anttaskslist.html 2018-02-03 16:12:26.000000000 +0000
+++ ant-1.10.3/manual/anttaskslist.html 2018-03-24 12:37:12.000000000 +0000
@@ -25,16 +25,13 @@
-
Apache Ant Tasks
diff -Nru ant-1.9.10/manual/argumentprocessor.html ant-1.10.3/manual/argumentprocessor.html
--- ant-1.9.10/manual/argumentprocessor.html 2018-02-03 16:12:26.000000000 +0000
+++ ant-1.10.3/manual/argumentprocessor.html 2018-03-24 12:37:12.000000000 +0000
@@ -25,52 +25,45 @@
The Command Line Processor Plugin: ArgumentProcessor
-
+What is an ArgumentProcessor?
-An ArgumentProcessor is a parser of command line argument which is
-then call before and after the build file is being parsed. Third party
-libraries may then be able to have custom argument line argument which modify
-Ant behaviour.
+An ArgumentProcessor is a parser of command line argument which is then
+call before and after the build file is being parsed. Third party libraries may then be able to have
+custom argument line argument which modify Ant behaviour.
-An ArgumentProcessor is called each time Ant parse an unknown
-argument, an ArgumentProcessor doesn't take precedence over Ant to
-parse already suported options. It is then recommended to third party
-ArgumentProcessor implementation to chose specific 'enough'
-argument name, avoiding for instance one letter arguments.
+An ArgumentProcessor is called each time Ant parse an unknown argument,
+an ArgumentProcessor doesn't take precedence over Ant to parse already
+supported options. It is then recommended to third party ArgumentProcessor
+implementation to chose specific 'enough' argument name, avoiding for instance one letter arguments.
-It is also called at the different phases so different behaviour can be
-implemented. It is called just after every arguments are parsed, just
-before the project is being configured (the build file being parsed),
-and just after. Some of the methods to be implemented return a boolean:
-if true is returned, Ant will terminate immediately, without
-error.
+It is also called at the different phases so different behaviour can be implemented. It is called
+just after every arguments are parsed, just before the project is being configured (the build file
+being parsed), and just after. Some of the methods to be implemented return a boolean:
+if true is returned, Ant will terminate immediately, without error.
-Being called during all these phases, an ArgumentProcessor
-can just print some specific system properties and quit (like
--diagnose ), or print some specific properties of a project after
-being parsed and quit (like -projectHelp ), or just set some
+Being called during all these phases, an ArgumentProcessor can just print
+some specific system properties and quit (like -diagnose), or print some specific
+properties of a project after being parsed and quit (like -projectHelp), or just set some
custom properties on the project and let it run.
-
+How to register it's own ArgumentProcessor
-First, the ArgumentProcessor must be an implementation of
-org.apache.tools.ant.ArgumentProcessor .
+ First, the ArgumentProcessor must be an implementation
+of org.apache.tools.ant.ArgumentProcessor .
-Then to decare it: create a file
-META-INF/services/org.apache.tools.ant.ArgumentProcessor which
-contains only one line the fully qualified name of the class of the
-implementation. This file together with the implementation class need then to
-be found in Ant's classpath.
+ Then to declare it: create a
+file META-INF/services/org.apache.tools.ant.ArgumentProcessor which contains only one
+line the fully qualified name of the class of the implementation. This file together with the
+implementation class need then to be found in Ant's classpath.
|