Codebase list ant / 2dde442
New upstream version 1.10.5 Emmanuel Bourg 5 years ago
51 changed file(s) with 521 addition(s) and 154 deletion(s). Raw diff Collapse all Expand all
0 Changes from Ant 1.10.4 TO Ant 1.10.5
1 =====================================
2
3 Fixed bugs:
4 -----------
5
6 * Fixes a regression in the "get" task where redirects
7 from a HTTP resource to a HTTPS resource started throwing
8 an exception.
9 Bugzilla Report 62499
10
11 * the new allowFilesToEscapeDest didn't work when set to false and
12 archive entries contained relative paths with so many ".."
13 segnments that the resulting path would go beyond the file system
14 root.
15 Bugzilla Report 62502
16
17 Other changes:
18 --------------
19 * Java task now accepts a "sourcefile" attribute to allow single file
20 source program execution, a feature that is introduced in Java 11.
21
022 Changes from Ant 1.10.3 TO Ant 1.10.4
123 =====================================
224
3232 <property name="name" value="ant"/>
3333 <!-- this is the directory corresponding to groupId of Ant in the Maven repository -->
3434 <property name="groupid" value="org/apache/ant"/>
35 <property name="project.version" value="1.10.4"/>
35 <property name="project.version" value="1.10.5"/>
3636 <!-- pom.version is used when doing a distribution and must match with what is checked in under src/etc/poms -->
37 <property name="pom.version" value="1.10.4"/>
38 <property name="manifest-version" value="1.10.4"/>
37 <property name="pom.version" value="1.10.5"/>
38 <property name="manifest-version" value="1.10.5"/>
3939 <property name="bootstrap.jar" value="ant-bootstrap.jar"/>
4040
4141 <property name="ant.package" value="org/apache/tools/ant"/>
3030 # Versions of different libraries. Please keep in alphabetical order, except
3131 # when a specific dependency forces them to be out-of-order
3232 ivy.version=2.4.0
33 ant-antunit.version=1.3
33 ant-antunit.version=1.4
3434 antlr.version=2.7.7
3535 bcel.version=6.2
3636 bsf.version=2.4.0
4949 <tr id="classname">
5050 <td>classname</td>
5151 <td>the Java class to execute.</td>
52 <td rowspan="3">Exactly one of the three</td>
52 <td rowspan="4">Exactly one of the four</td>
5353 </tr>
5454 <tr>
5555 <td>jar</td>
6363 <td class="left">The initial or main module to resolve (must have a <code>Main-Class</code>
6464 entry in the manifest). <var>fork</var> must be set to <q>true</q> if this option is
6565 selected. <em>since Ant 1.9.7</em></td>
66 </tr>
67 <tr>
68 <td>sourcefile</td>
69 <td class="left">The location of a ".java" file or a file containing shebang with Java source code.
70 Set this attribute to run Java single file source programs, a feature introduced in Java 11.
71 <var>fork</var> must be set to <q>true</q> if this option is selected.
72 <em>since Ant 1.10.5</em></td>
6673 </tr>
6774 <tr>
6875 <td>args</td>
3030
3131 <h3>Description</h3>
3232 <p>Sends SMTP mail with MIME
33 attachments. <a href="https://www.oracle.com/technetwork/java/index-138643.html"
33 attachments. <a href="https://javaee.github.io/javamail/"
3434 target="_top">JavaMail</a>
35 and <a href="https://www.oracle.com/technetwork/java/javase/jaf-135115.html" target="_top">Java
36 Activation Framework</a> are required for this task.</p>
35 and <a href="https://github.com/javaee/activation" target="_top">Java
36 Activation Framework</a> are required for this task. The Java
37 Activation Framework is part of the standard class library for Java 6
38 to Java 10 but the <code>java.activation</code> module has been
39 deprecated in Java 9 and must be enabled explicitly when running on
40 Java 10. Alternatively it can be provided as an external library.</p>
3741 <p>Multiple files can be attached using <a href="../Types/fileset.html">FileSets.</a></p>
3842 <h3>Parameters</h3>
3943 <table class="attr">
1818 <head>
1919 <meta http-equiv="Content-Language" content="en-us">
2020 <link rel="stylesheet" type="text/css" href="stylesheets/style.css">
21 <title>Apache Ant 1.10.4 User Manual</title>
21 <title>Apache Ant 1.10.5 User Manual</title>
2222 </head>
2323
2424 <body>
2525 <h1 class="center"><img src="images/ant_logo_large.gif" width="190" height="120" alt="Apache Ant logo"></h1>
26 <h1 class="center">Apache Ant&trade; 1.10.4 Manual</h1>
27 <p>This is the manual for version 1.10.4 of <a href="https://ant.apache.org/" target="_top">Apache Ant</a>. If your
26 <h1 class="center">Apache Ant&trade; 1.10.5 Manual</h1>
27 <p>This is the manual for version 1.10.5 of <a href="https://ant.apache.org/" target="_top">Apache Ant</a>. If your
2828 version of Ant (as verified with <kbd>ant -version</kbd>) is older or newer than this version then this is not the
2929 correct manual set. Please use the documentation appropriate to your current version. Also, if you are using a
3030 version older than the most recent release, we recommend an upgrade to fix bugs as well as provide new
1818 <head>
1919 <meta http-equiv="Content-Language" content="en-us">
2020 <link rel="stylesheet" type="text/css" href="stylesheets/style.css">
21 <title>Apache Ant User Manual&mdash;Credits</title>
21 <title>Apache Ant User Manual - Credits</title>
2222 </head>
2323
2424 <body>
4545 <li>Arnout J. Kuiper (<a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a>)</li>
4646 <li>Antoine L&eacute;vy-Lambert</li>
4747 <li>Conor MacNeill</li>
48 <li>Jan Mat&eacute;rne</li>
48 <li>Jan Mat&egrave;rne</li>
4949 <li>Stefano Mazzocchi (<a href="mailto:stefano@apache.org">stefano@apache.org</a>)</li>
5050 <li>Erik Meade (<a href="mailto:emeade@geekfarm.org">emeade@geekfarm.org</a>)</li>
5151 <li>Sam Ruby (<a href="mailto:rubys@us.ibm.com">rubys@us.ibm.com</a>)</li>
6060 <li>Craeg Strong (<a href="mailto:cstrong@arielpartners.com">cstrong@arielpartners.com</a>)</li>
6161 </ul>
6262
63 <p class="center">Version: 1.10.4</p>
63 <p class="center">Version: 1.10.5</p>
6464
6565 </body>
6666 </html>
896896 <td><a href="https://javaee.github.io/javamail/" target="_top">https://javaee.github.io/javamail/</a></td>
897897 </tr>
898898 <tr>
899 <td>activation.jar<br/>(included in Java 6 and later runtime)</td>
899 <td>activation.jar<br/>
900 (included in Java 6 to Java 10 but
901 the <code>java.activation</code> module is deprecated and marked
902 for removal in Java 9 and needs to be enabled explicitly on Java
903 10)</td>
900904 <td><a href="Tasks/mail.html">mail</a> task with MIME encoding,
901905 and <em><u>deprecated</u></em> <a href="Tasks/mimemail.html">mimemail</a> task</td>
902 <td><a href="https://www.oracle.com/technetwork/java/javase/jaf-135115.html"
906 <td><a href="https://github.com/javaee/activation"
903907 target="_top">https://www.oracle.com/technetwork/java/javase/jaf-135115.html</a></td>
904908 </tr>
905909 <tr>
8888 </ul-->
8989
9090 <h1><a name="top">JDepend Analysis</a></h1>
91 <p align="right">Designed for use with <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> and <a href="http://jakarta.apache.org">Ant</a>.</p>
91 <p align="right">Designed for use with <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> and <a href="https://ant.apache.org">Ant</a>.</p>
9292 <hr size="2" />
9393
9494 <table width="100%"><tr><td>
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
2828 <relativePath>../pom.xml</relativePath>
29 <version>1.10.4</version>
29 <version>1.10.5</version>
3030 </parent>
3131 <modelVersion>4.0.0</modelVersion>
3232 <url>http://ant.apache.org/</url>
3333 <groupId>org.apache.ant</groupId>
3434 <artifactId>ant</artifactId>
35 <version>1.10.4</version>
35 <version>1.10.5</version>
3636 <name>Apache Ant Core</name>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant-launcher</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
2828 <relativePath>../pom.xml</relativePath>
29 <version>1.10.4</version>
29 <version>1.10.5</version>
3030 </parent>
3131 <modelVersion>4.0.0</modelVersion>
3232 <url>http://ant.apache.org/</url>
3333 <groupId>org.apache.ant</groupId>
3434 <artifactId>ant-antlr</artifactId>
35 <version>1.10.4</version>
35 <version>1.10.5</version>
3636 <name>Apache Ant + ANTLR</name>
3737 <description>antlr specific task.
3838 The implementation forks a java process, therefore the antlr jar file is only needed at runtime</description>
4040 <dependency>
4141 <groupId>org.apache.ant</groupId>
4242 <artifactId>ant</artifactId>
43 <version>1.10.4</version>
43 <version>1.10.5</version>
4444 <optional>true</optional>
4545 <scope>compile</scope>
4646 </dependency>
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
2828 <relativePath>../pom.xml</relativePath>
29 <version>1.10.4</version>
29 <version>1.10.5</version>
3030 </parent>
3131 <modelVersion>4.0.0</modelVersion>
3232 <url>http://ant.apache.org/</url>
3333 <groupId>org.apache.ant</groupId>
3434 <artifactId>ant-apache-bcel</artifactId>
35 <version>1.10.4</version>
35 <version>1.10.5</version>
3636 <name>Apache Ant + BCEL</name>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
2828 <relativePath>../pom.xml</relativePath>
29 <version>1.10.4</version>
29 <version>1.10.5</version>
3030 </parent>
3131 <modelVersion>4.0.0</modelVersion>
3232 <url>http://ant.apache.org/</url>
3333 <groupId>org.apache.ant</groupId>
3434 <artifactId>ant-apache-bsf</artifactId>
35 <version>1.10.4</version>
35 <version>1.10.5</version>
3636 <name>Apache Ant + BSF</name>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-apache-log4j</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + Log4J</name>
3636 <dependencies>
3737 <dependency>
3838 <groupId>org.apache.ant</groupId>
3939 <artifactId>ant</artifactId>
40 <version>1.10.4</version>
40 <version>1.10.5</version>
4141 <scope>compile</scope>
4242 </dependency>
4343 <dependency>
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
2828 <relativePath>../pom.xml</relativePath>
29 <version>1.10.4</version>
29 <version>1.10.5</version>
3030 </parent>
3131 <modelVersion>4.0.0</modelVersion>
3232 <url>http://ant.apache.org/</url>
3333 <groupId>org.apache.ant</groupId>
3434 <artifactId>ant-apache-oro</artifactId>
35 <version>1.10.4</version>
35 <version>1.10.5</version>
3636 <name>Apache Ant + Apache Oro</name>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-apache-regexp</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + Apache Regexp</name>
3636 <dependencies>
3737 <dependency>
3838 <groupId>org.apache.ant</groupId>
3939 <artifactId>ant</artifactId>
40 <version>1.10.4</version>
40 <version>1.10.5</version>
4141 <scope>compile</scope>
4242 </dependency>
4343 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-apache-resolver</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + Apache Resolver</name>
3636 <dependencies>
3737 <dependency>
3838 <groupId>org.apache.ant</groupId>
3939 <artifactId>ant</artifactId>
40 <version>1.10.4</version>
40 <version>1.10.5</version>
4141 <scope>compile</scope>
4242 </dependency>
4343 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-apache-xalan2</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + Xalan 2</name>
3636 <description>contains Xalan2-specific features</description>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-commons-logging</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + Commons Logging</name>
3636 <description>Ant Listener based on commons-logging</description>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-commons-net</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + Commons Net</name>
3636 <description>ftp, rexec and telnet tasks</description>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
2828 <relativePath>../pom.xml</relativePath>
29 <version>1.10.4</version>
29 <version>1.10.5</version>
3030 </parent>
3131 <modelVersion>4.0.0</modelVersion>
3232 <url>http://ant.apache.org/</url>
3333 <groupId>org.apache.ant</groupId>
3434 <artifactId>ant-jai</artifactId>
35 <version>1.10.4</version>
35 <version>1.10.5</version>
3636 <name>Apache Ant + JAI</name>
3737 <description>image task and corresponding types.
3838 </description>
4040 <dependency>
4141 <groupId>org.apache.ant</groupId>
4242 <artifactId>ant</artifactId>
43 <version>1.10.4</version>
43 <version>1.10.5</version>
4444 <scope>compile</scope>
4545 </dependency>
4646 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-javamail</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + JavaMail</name>
3636 <description>implementation of the mail task based on javamail.
3737 Required to send emails to SMTP servers using user/password combinations
4040 <dependency>
4141 <groupId>org.apache.ant</groupId>
4242 <artifactId>ant</artifactId>
43 <version>1.10.4</version>
43 <version>1.10.5</version>
4444 <scope>compile</scope>
4545 </dependency>
4646 <dependency>
4949 <version>1.6.1</version>
5050 <scope>compile</scope>
5151 </dependency>
52 </dependencies>
52 </dependencies>
5353 <build>
5454 <plugins>
5555 <plugin>
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
2828 <relativePath>../pom.xml</relativePath>
29 <version>1.10.4</version>
29 <version>1.10.5</version>
3030 </parent>
3131 <modelVersion>4.0.0</modelVersion>
3232 <url>http://ant.apache.org/</url>
3333 <groupId>org.apache.ant</groupId>
3434 <artifactId>ant-jdepend</artifactId>
35 <version>1.10.4</version>
35 <version>1.10.5</version>
3636 <name>Apache Ant + JDepend</name>
3737 <description>task jdepend invoking the jdepend parser. There is also a version 2.9.1 of the
3838 jdepend parser available on the maven repository</description>
4040 <dependency>
4141 <groupId>org.apache.ant</groupId>
4242 <artifactId>ant</artifactId>
43 <version>1.10.4</version>
43 <version>1.10.5</version>
4444 <scope>compile</scope>
4545 </dependency>
4646 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-jmf</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + JMF</name>
3636 <description>contains the sound task and a soundplayer listener
3737 download the dependency from http://java.sun.com/products/java-media/jmf/</description>
3939 <dependency>
4040 <groupId>org.apache.ant</groupId>
4141 <artifactId>ant</artifactId>
42 <version>1.10.4</version>
42 <version>1.10.5</version>
4343 <scope>compile</scope>
4444 </dependency>
4545 </dependencies>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-jsch</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + JSch</name>
3636 <description>contains the sshexec and scp tasks
3737 </description>
3939 <dependency>
4040 <groupId>org.apache.ant</groupId>
4141 <artifactId>ant</artifactId>
42 <version>1.10.4</version>
42 <version>1.10.5</version>
4343 <scope>compile</scope>
4444 </dependency>
4545 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-junit</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + JUnit</name>
3636 <description>contains the junit and junirreport tasks</description>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-junit4</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + JUnit 4</name>
3636 <description>contains JUnit 4.x support</description>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-junitlauncher</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + JUnit 5</name>
3636 <description>contains JUnit 5.x support</description>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
2828 <relativePath>../pom.xml</relativePath>
29 <version>1.10.4</version>
29 <version>1.10.5</version>
3030 </parent>
3131 <modelVersion>4.0.0</modelVersion>
3232 <url>http://ant.apache.org/</url>
3333 <groupId>org.apache.ant</groupId>
3434 <artifactId>ant-launcher</artifactId>
35 <version>1.10.4</version>
35 <version>1.10.5</version>
3636 <name>Apache Ant Launcher</name>
3737 <build>
3838 <plugins>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-netrexx</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + NetRexx</name>
3636 <description>NetRexxC task
3737 dependency can be downloaded from http://www.ibm.com/software/awdtools/netrexx/download.html</description>
3939 <dependency>
4040 <groupId>org.apache.ant</groupId>
4141 <artifactId>ant</artifactId>
42 <version>1.10.4</version>
42 <version>1.10.5</version>
4343 <scope>compile</scope>
4444 </dependency>
4545 <!-- Processed too early, before maven-antrun-plugin gets a chance to work:
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
2828 <relativePath>../pom.xml</relativePath>
29 <version>1.10.4</version>
29 <version>1.10.5</version>
3030 </parent>
3131 <modelVersion>4.0.0</modelVersion>
3232 <url>http://ant.apache.org/</url>
3333 <groupId>org.apache.ant</groupId>
3434 <artifactId>ant-swing</artifactId>
35 <version>1.10.4</version>
35 <version>1.10.5</version>
3636 <name>Apache Ant + Swing</name>
3737 <description>a listener and a splash task based on Swing</description>
3838 <dependencies>
3939 <dependency>
4040 <groupId>org.apache.ant</groupId>
4141 <artifactId>ant</artifactId>
42 <version>1.10.4</version>
42 <version>1.10.5</version>
4343 <scope>compile</scope>
4444 </dependency>
4545 </dependencies>
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
2828 <relativePath>../pom.xml</relativePath>
29 <version>1.10.4</version>
29 <version>1.10.5</version>
3030 </parent>
3131 <modelVersion>4.0.0</modelVersion>
3232 <url>http://ant.apache.org/</url>
3333 <groupId>org.apache.ant</groupId>
3434 <artifactId>ant-testutil</artifactId>
35 <version>1.10.4</version>
35 <version>1.10.5</version>
3636 <name>Apache Ant Test Utilities</name>
3737 <description>test utility classes</description>
3838 <dependencies>
3939 <dependency>
4040 <groupId>org.apache.ant</groupId>
4141 <artifactId>ant</artifactId>
42 <version>1.10.4</version>
42 <version>1.10.5</version>
4343 <scope>compile</scope>
4444 </dependency>
4545 <dependency>
2525 <groupId>org.apache.ant</groupId>
2626 <artifactId>ant-parent</artifactId>
2727 <relativePath>../pom.xml</relativePath>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 </parent>
3030 <modelVersion>4.0.0</modelVersion>
3131 <url>http://ant.apache.org/</url>
3232 <groupId>org.apache.ant</groupId>
3333 <artifactId>ant-xz</artifactId>
34 <version>1.10.4</version>
34 <version>1.10.5</version>
3535 <name>Apache Ant + XZ for Java</name>
3636 <description>contains the xz compression support</description>
3737 <dependencies>
3838 <dependency>
3939 <groupId>org.apache.ant</groupId>
4040 <artifactId>ant</artifactId>
41 <version>1.10.4</version>
41 <version>1.10.5</version>
4242 <scope>compile</scope>
4343 </dependency>
4444 <dependency>
2525 <modelVersion>4.0.0</modelVersion>
2626 <groupId>org.apache.ant</groupId>
2727 <artifactId>ant-parent</artifactId>
28 <version>1.10.4</version>
28 <version>1.10.5</version>
2929 <packaging>pom</packaging>
3030 <description>master POM</description>
3131 <licenses>
1919 <import file="../buildfiletest-base.xml"/>
2020
2121 <target name="setUp">
22 <mkdir dir="${output}"/>
22 <mkdir dir="${output}" />
2323 </target>
2424
2525 <target name="testLineContains" depends="setUp">
3434 </filterchain>
3535 </copy>
3636 </target>
37
37
3838 <target name="testNegateLineContains" depends="setUp">
3939 <copy file="input/linecontains.test"
4040 tofile="${output}/negatelinecontains.test">
4949 <condition>
5050 <not>
5151 <filesmatch file1="${output}/negatelinecontains.test"
52 file2="expected/negatelinecontains.test"/>
52 file2="expected/negatelinecontains.test" />
5353 </not>
5454 </condition>
5555 </fail>
5656 </target>
57
57
5858 <target name="testEscapeUnicode" depends="setUp">
5959 <copy todir="${output}" encoding="UTF-8">
6060 <fileset dir="input">
7171
7272 <target name="testStripJavaComments" depends="setUp">
7373 <copy todir="${output}">
74 <fileset dir="input" includes="stripjavacomments.test"/>
74 <fileset dir="input" includes="stripjavacomments.test" />
7575 <filterchain>
76 <filterreader classname="org.apache.tools.ant.filters.StripJavaComments"/>
76 <filterreader classname="org.apache.tools.ant.filters.StripJavaComments" />
7777 </filterchain>
7878 </copy>
7979 </target>
9595 <filterchain>
9696 <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
9797 <param type="propertiesfile" value="${basedir}/input/sample.properties"/>
98 </filterreader>
98 </filterreader>
9999 </filterchain>
100100 </copy>
101101 </target>
1919 <import file="../buildfiletest-base.xml"/>
2020
2121 <target name="setUp">
22 <mkdir dir="${output}"/>
22 <mkdir dir="${output}" />
2323 </target>
2424
2525 <!-- Testcases for HeadFilter -->
5757 </target>
5858
5959 <target name="testFilterReaderHeadLinesSkip" depends="setUp">
60 <copy file="input/head-tail.test"
60 <copy file="input/head-tail.test"
6161 tofile="${output}/head-tail.filterReaderHeadLinesSkip.test">
6262 <filterchain>
6363 <filterreader classname="org.apache.tools.ant.filters.HeadFilter">
111111 </target>
112112
113113 <target name="testFilterReaderTailLinesSkip" depends="setUp">
114 <copy file="input/head-tail.test"
114 <copy file="input/head-tail.test"
115115 tofile="${output}/head-tail.filterReaderTailLinesSkip.test">
116116 <filterchain>
117117 <filterreader classname="org.apache.tools.ant.filters.TailFilter">
3131 <fail>
3232 <condition>
3333 <not>
34 <antversion exactly="1.10.4" />
34 <antversion exactly="1.10.5" />
3535 </not>
3636 </condition>
37 Should be exactly 1.10.4
37 Should be exactly 1.10.5
3838 </fail>
3939 </target>
4040
1818 <project name="delete-test" basedir="." default="test1">
1919
2020 <import file="../buildfiletest-base.xml"/>
21
2221
2322 <property name="dir" location="${output}" />
2423 <basename property="dirname" file="${output}"/>
423423
424424 <target name="foo" />
425425
426 <target name="simpleSourceFile"
427 description="Tests that the single source file programs, introduced in Java 11, works as expected">
428 <mkdir dir="${output}/javasource"/>
429 <echo file="/tmp/foo.txt" message="${output}"/>
430 <echo file="${output}/javasource/A.java">
431 import java.nio.file.Files;
432 import java.nio.file.Paths;
433 import java.io.BufferedWriter;
434 public class A {
435 public static void main(String[] args) throws Exception {
436 final String outFile = args[0];
437 try(BufferedWriter bw = Files.newBufferedWriter(Paths.get(outFile));) {
438 bw.write("Hello world!");
439 }
440 }
441 }
442 </echo>
443 <java sourcefile="${output}/javasource/A.java" fork="true" failonerror="true" logerror="true">
444 <arg value="${output}/javasource/simpleSourceFileOutput.txt"/>
445 </java>
446 <loadfile property="simpleSourceFile.prog.output" srcfile="${output}/javasource/simpleSourceFileOutput.txt"/>
447 <condition property="simpleSourceFile.execution.success">
448 <equals arg1="${simpleSourceFile.prog.output}" arg2="Hello world!"/>
449 </condition>
450 <fail unless="simpleSourceFile.execution.success">Java source-file execution did not yield the expected
451 result</fail>
452 </target>
453
454
455 <target name="generateDummyJavaSource">
456 <mkdir dir="${output}/javasource"/>
457 <echo file="/tmp/foo.txt" message="${output}"/>
458 <echo file="${output}/javasource/ThrowsException.java">
459 public class ThrowsException {
460 public static void main(String[] args) throws Exception {
461 throw new RuntimeException("Wasn't expected to be run");
462 }
463 }
464 </echo>
465 </target>
466
467 <target name="sourceFileRequiresFork" depends="generateDummyJavaSource">
468 <java sourcefile="${output}/javasource/ThrowsException.java" failonerror="true" logerror="true"/>
469 <fail>Execution of java task, for sourcefile, was expected to fail since fork wasn't set</fail>
470 </target>
471
472 <target name="sourceFileCantUseClassname" depends="generateDummyJavaSource">
473 <java classname="foo.bar" sourcefile="${output}/javasource/ThrowsException.java"
474 fork="true" failonerror="true" logerror="true"/>
475 <fail>Execution of java task, for sourcefile, was expected to fail since classname attribute was set</fail>
476 </target>
477
478 <target name="sourceFileCantUseJar" depends="generateDummyJavaSource">
479 <java jar="irrelevant.jar" sourcefile="${output}/javasource/ThrowsException.java"
480 fork="true" failonerror="true" logerror="true"/>
481 <fail>Execution of java task, for sourcefile, was expected to fail since jar attribute was set</fail>
482 </target>
483
484 <target name="sourceFileCantUseModule" depends="generateDummyJavaSource">
485 <java module="irrelevant" sourcefile="${output}/javasource/ThrowsException.java"
486 fork="true" failonerror="true" logerror="true"/>
487 <fail>Execution of java task, for sourcefile, was expected to fail since module attribute was set</fail>
488 </target>
489
426490 </project>
3636 </target>
3737
3838 <target name="test5" description="Get the latest from PVCS">
39 <pvcs pvcsbin="/home/cvs/pvcsant/src/etc/testcases/taskdefs"
39 <pvcs pvcsbin="/home/cvs/pvcsant/src/etc/testcases/taskdefs"
4040 repository="//ct4serv2/pvcs/monitor"/>
4141 </target>
4242
331331 mappedNames = new String[] {entryName};
332332 }
333333 File f = fileUtils.resolveFile(dir, mappedNames[0]);
334 if (!allowedOutsideOfDest && !fileUtils.isLeadingPath(dir, f)) {
335 log("skipping " + entryName + " as its target " + f + " is outside of "
336 + dir + ".", Project.MSG_VERBOSE);
334 if (!allowedOutsideOfDest && !fileUtils.isLeadingPath(dir, f, true)) {
335 log("skipping " + entryName + " as its target " + f.getCanonicalPath()
336 + " is outside of " + dir.getCanonicalPath() + ".", Project.MSG_VERBOSE);
337337 return;
338338 }
339339
692692
693693
694694 private boolean redirectionAllowed(final URL aSource, final URL aDest) {
695 if (aSource.getProtocol().equals(aDest.getProtocol())
696 && (HTTP.equals(aSource.getProtocol()) || HTTPS.equals(aDest.getProtocol()))) {
697 redirections++;
698 if (redirections > REDIRECT_LIMIT) {
699 final String message = "More than " + REDIRECT_LIMIT
700 + " times redirected, giving up";
701 if (ignoreErrors) {
702 log(message, logLevel);
703 return false;
704 }
695 if (!(aSource.getProtocol().equals(aDest.getProtocol()) || (HTTP
696 .equals(aSource.getProtocol()) && HTTPS.equals(aDest
697 .getProtocol())))) {
698 final String message = "Redirection detected from "
699 + aSource.getProtocol() + " to " + aDest.getProtocol()
700 + ". Protocol switch unsafe, not allowed.";
701 if (ignoreErrors) {
702 log(message, logLevel);
703 return false;
704 } else {
705705 throw new BuildException(message);
706706 }
707 return true;
708 }
709
710 final String message = "Redirection detected from "
711 + aSource.getProtocol() + " to " + aDest.getProtocol()
712 + ". Protocol switch unsafe, not allowed.";
713 if (ignoreErrors) {
714 log(message, logLevel);
715 return false;
716 }
717 throw new BuildException(message);
707 }
708
709 redirections++;
710 if (redirections > REDIRECT_LIMIT) {
711 final String message = "More than " + REDIRECT_LIMIT
712 + " times redirected, giving up";
713 if (ignoreErrors) {
714 log(message, logLevel);
715 return false;
716 } else {
717 throw new BuildException(message);
718 }
719 }
720
721
722 return true;
718723 }
719724
720725 private URLConnection openConnection(final URL aSource) throws IOException {
141141 protected void checkConfiguration() throws BuildException {
142142 String classname = getCommandLine().getClassname();
143143 String module = getCommandLine().getModule();
144 if (classname == null && getCommandLine().getJar() == null && module == null) {
144 final String sourceFile = getCommandLine().getSourceFile();
145 if (classname == null && getCommandLine().getJar() == null && module == null && sourceFile == null) {
145146 throw new BuildException("Classname must not be null.");
146147 }
147148 if (!fork && getCommandLine().getJar() != null) {
151152 if (!fork && getCommandLine().getModule() != null) {
152153 throw new BuildException(
153154 "Cannot execute a module in non-forked mode. Please set fork='true'. ");
155 }
156 if (!fork && sourceFile != null) {
157 throw new BuildException("Cannot execute sourcefile in non-forked mode. Please set fork='true'");
154158 }
155159 if (spawn && !fork) {
156160 throw new BuildException(
354358 *
355359 * @param jarfile the jarfile to execute.
356360 *
357 * @throws BuildException if there is also a main class specified.
361 * @throws BuildException if there is also a {@code classname}, {@code module}
362 * or {@code sourcefile} attribute specified
358363 */
359364 public void setJar(File jarfile) throws BuildException {
360 if (getCommandLine().getClassname() != null || getCommandLine().getModule() != null) {
365 if (getCommandLine().getClassname() != null || getCommandLine().getModule() != null
366 || getCommandLine().getSourceFile() != null) {
361367 throw new BuildException(
362 "Cannot use 'jar' with 'classname' or 'module' attributes in same command.");
368 "Cannot use combination of 'jar', 'sourcefile', 'classname', 'module' attributes in same command");
363369 }
364370 getCommandLine().setJar(jarfile.getAbsolutePath());
365371 }
369375 *
370376 * @param s the name of the main class.
371377 *
372 * @throws BuildException if the jar attribute has been set.
378 * @throws BuildException if there is also a {@code jar} or {@code sourcefile} attribute specified
373379 */
374380 public void setClassname(String s) throws BuildException {
375 if (getCommandLine().getJar() != null) {
381 if (getCommandLine().getJar() != null || getCommandLine().getSourceFile() != null) {
376382 throw new BuildException(
377 "Cannot use 'jar' and 'classname' attributes in same command");
383 "Cannot use combination of 'jar', 'classname', sourcefile attributes in same command");
378384 }
379385 getCommandLine().setClassname(s);
380386 }
384390 *
385391 * @param module the name of the module.
386392 *
387 * @throws BuildException if the jar attribute has been set.
393 * @throws BuildException if there is also a {@code jar} or {@code sourcefile} attribute specified
388394 * @since 1.9.7
389395 */
390396 public void setModule(String module) throws BuildException {
391 if (getCommandLine().getJar() != null) {
397 if (getCommandLine().getJar() != null || getCommandLine().getSourceFile() != null) {
392398 throw new BuildException(
393 "Cannot use 'jar' and 'module' attributes in same command");
399 "Cannot use combination of 'jar', 'module', sourcefile attributes in same command");
394400 }
395401 getCommandLine().setModule(module);
402 }
403
404 /**
405 * Set the Java source-file to execute. Support for single file source program
406 * execution, in Java, is only available since Java 11.
407 *
408 * @param sourceFile The path to the source file
409 * @throws BuildException if there is also a {@code jar}, {@code classname}
410 * or {@code module} attribute specified
411 * @since Ant 1.10.5
412 */
413 public void setSourceFile(final String sourceFile) throws BuildException {
414 final String jar = getCommandLine().getJar();
415 final String className = getCommandLine().getClassname();
416 final String module = getCommandLine().getModule();
417 if (jar != null || className != null || module != null) {
418 throw new BuildException("Cannot use 'sourcefile' in combination with 'jar' or " +
419 "'module' or 'classname'");
420 }
421 getCommandLine().setSourceFile(sourceFile);
396422 }
397423
398424 /**
842868 }
843869
844870 /**
845 * Executes the given classname with the given arguments in a separate VM.
871 * Executes the given source-file or classname with the given arguments in a separate VM.
846872 * @param command String[] of command-line arguments.
847873 */
848874 private int fork(String[] command) throws BuildException {
10171043 public CommandlineJava.SysProperties getSysProperties() {
10181044 return getCommandLine().getSystemProperties();
10191045 }
1046
1047
10201048 }
368368 }
369369
370370 /**
371 * Set the source-file, to execute as single file source programs, a feature, available
372 * since Java 11.
373 *
374 * @param sourceFile The path to the source file
375 * @since Ant 1.10.5
376 */
377 public void setSourceFile(final String sourceFile) {
378 this.executableType = ExecutableType.SOURCE_FILE;
379 javaCommand.setExecutable(sourceFile);
380 }
381
382 /**
383 * @return Returns the source-file to execute, if this command line has
384 * been {@link #setSourceFile(String) configured for single file source program
385 * execution}. Else returns null.
386 * @since Ant 1.10.5
387 */
388 public String getSourceFile() {
389 return this.executableType == ExecutableType.SOURCE_FILE ? this.javaCommand.getExecutable() : null;
390 }
391
392 /**
371393 * Set the module to execute.
372394 * @param module the module name.
373395 * @since 1.9.7
533555 } else if (executableType == ExecutableType.MODULE) {
534556 listIterator.add("-m");
535557 }
536 // this is the classname to run as well as its arguments.
558 // this is the classname/source-file to run as well as its arguments.
537559 // in case of ExecutableType.JAR, the executable is a jar file,
538560 // in case of ExecutableType.MODULE, the executable is a module name, potentially including a class name.
561 // in case of ExecutableType.SOURCE_FILE, the executable is a Java source file (ending in .java) or a shebang
562 // file containing Java source
539563 javaCommand.addCommandToList(listIterator);
540564 }
541565
886910 /**
887911 * Module execution.
888912 */
889 MODULE
913 MODULE,
914
915 /**
916 * Source file (introduced in Java 11)
917 */
918 SOURCE_FILE,
890919 }
891920 }
728728 * <li>DOS style paths that start with a drive letter will have
729729 * \ as the separator.</li>
730730 * </ul>
731 * Unlike {@link File#getCanonicalPath()} this method
732 * specifically does not resolve symbolic links.
731 * <p>Unlike {@link File#getCanonicalPath()} this method
732 * specifically does not resolve symbolic links.</p>
733 *
734 * <p>If the path tries to go beyond the file system root (i.e. it
735 * contains more ".." segments than can be travelled up) the
736 * method will return the original path unchanged.</p>
733737 *
734738 * @param path the path to be normalized.
735739 * @return the normalized version of the path.
11541158 /**
11551159 * Removes a leading path from a second path.
11561160 *
1161 * <p>This method uses {@link #normalize} under the covers and
1162 * does not resolve symbolic links.</p>
1163 *
11571164 * @param leading The leading path, must not be null, must be absolute.
11581165 * @param path The path to remove from, must not be null, must be absolute.
11591166 *
11781185
11791186 /**
11801187 * Learn whether one path "leads" another.
1188 *
1189 * <p>This method uses {@link #normalize} under the covers and
1190 * does not resolve symbolic links.</p>
1191 *
1192 * <p>If either path tries to go beyond the file system root
1193 * (i.e. it contains more ".." segments than can be travelled up)
1194 * the method will return false.</p>
1195 *
11811196 * @param leading The leading path, must not be null, must be absolute.
1182 * @param path The path to remove from, must not be null, must be absolute.
1197 * @param path The path to check, must not be null, must be absolute.
11831198 * @return true if path starts with leading; false otherwise.
11841199 * @since Ant 1.7
11851200 */
11941209 if (!l.endsWith(File.separator)) {
11951210 l += File.separator;
11961211 }
1212 // ensure "/foo/" is not considered a parent of "/foo/../../bar"
1213 String up = File.separator + ".." + File.separator;
1214 if (l.contains(up) || p.contains(up) || (p + File.separator).contains(up)) {
1215 return false;
1216 }
11971217 return p.startsWith(l);
1218 }
1219
1220 /**
1221 * Learn whether one path "leads" another.
1222 *
1223 * @param leading The leading path, must not be null, must be absolute.
1224 * @param path The path to check, must not be null, must be absolute.
1225 * @param resolveSymlinks whether symbolic links shall be resolved
1226 * prior to comparing the paths.
1227 * @return true if path starts with leading; false otherwise.
1228 * @since Ant 1.10.5
1229 * @throws IOException if resolveSymlinks is true and invoking
1230 * getCanonicaPath on either argument throws an exception
1231 */
1232 public boolean isLeadingPath(File leading, File path, boolean resolveSymlinks)
1233 throws IOException {
1234 if (!resolveSymlinks) {
1235 return isLeadingPath(leading, path);
1236 }
1237 final File l = leading.getCanonicalFile();
1238 File p = path.getCanonicalFile();
1239 do {
1240 if (l.equals(p)) {
1241 return true;
1242 }
1243 p = p.getParentFile();
1244 } while (p != null);
1245 return false;
11981246 }
11991247
12001248 /**
1919 <import file="../antunit-base.xml" />
2020
2121 <property name="location" value="http://ant.apache.org/webtest/gettest" />
22
22
2323 <target name="setUp">
2424 <mkdir dir="${output}" />
2525 </target>
9494
9595
9696 <target name="testInfiniteRedirect" unless="jenkins">
97 <au:expectfailure expectedmessage="More than 25 times redirected, giving up">
97 <au:expectfailure expectedmessage="More than 25 times redirected, giving up">
9898 <get src="${location}/infinite.txt" dest="${output}/infinite.tmp"/>
9999 </au:expectfailure>
100100 </target>
121121 </au:assertTrue>
122122 <au:assertLogContains text="local.cgi moved to http" />
123123 </target>
124
125 <target name="testHttpToHttpsRedirect" description="Tests that a resource that's redirected
126 from HTTP to HTTPS works without an error. See bugzilla-62499 for details">
127 <get src="${location}/http-to-https.txt" dest="${output}/http-to-https-redirect.tmp"/>
128 <au:assertFileExists file="${output}/http-to-https-redirect.tmp"/>
129 <au:assertTrue>
130 <resourcecontains resource="${output}/http-to-https-redirect.tmp" substring="hello world"/>
131 </au:assertTrue>
132 </target>
124133 </project>
2222 import java.util.stream.Collectors;
2323
2424 import org.apache.tools.ant.util.JavaEnvUtils;
25 import org.junit.AssumptionViolatedException;
2526 import org.junit.Before;
2627 import org.junit.Test;
27 import org.junit.internal.AssumptionViolatedException;
2828
2929 import static org.junit.Assert.assertEquals;
3030 import static org.junit.Assert.assertFalse;
3131 import org.apache.tools.ant.BuildException;
3232 import org.apache.tools.ant.BuildFileRule;
3333 import org.apache.tools.ant.input.DefaultInputHandler;
34 import org.apache.tools.ant.taskdefs.condition.JavaVersion;
3435 import org.apache.tools.ant.util.FileUtils;
3536 import org.apache.tools.ant.util.TeeOutputStream;
37 import org.junit.Assume;
38 import org.junit.AssumptionViolatedException;
3639 import org.junit.Before;
3740 import org.junit.Rule;
3841 import org.junit.Test;
39 import org.junit.internal.AssumptionViolatedException;
4042 import org.junit.rules.ExpectedException;
4143
4244 import static org.hamcrest.Matchers.containsString;
105107 @Test
106108 public void testJarAndClassName() {
107109 thrown.expect(BuildException.class);
108 thrown.expectMessage("Cannot use 'jar' and 'classname' attributes in same command");
110 thrown.expectMessage("Cannot use combination of ");
109111 buildRule.executeTarget("testJarAndClassName");
110112 }
111113
112114 @Test
113115 public void testClassnameAndJar() {
114116 thrown.expect(BuildException.class);
115 thrown.expectMessage("Cannot use 'jar' with 'classname' or 'module' attributes in same command.");
117 thrown.expectMessage("Cannot use combination of ");
116118 buildRule.executeTarget("testClassnameAndJar");
117119 }
118120
119121 @Test
120122 public void testJarAndModule() {
121123 thrown.expect(BuildException.class);
122 thrown.expectMessage("Cannot use 'jar' and 'module' attributes in same command");
124 thrown.expectMessage("Cannot use combination of ");
123125 buildRule.executeTarget("testJarAndModule");
124126 }
125127
126128 @Test
127129 public void testModuleAndJar() {
128130 thrown.expect(BuildException.class);
129 thrown.expectMessage("Cannot use 'jar' with 'classname' or 'module' attributes in same command.");
131 thrown.expectMessage("Cannot use combination of ");
130132 buildRule.executeTarget("testModuleAndJar");
131133 }
132134
410412 }
411413
412414 /**
415 * Test that the Java single file source program feature introduced in Java 11 works fine
416 *
417 * @throws Exception
418 */
419 @Test
420 public void testSimpleSourceFile() throws Exception {
421 requireJava11();
422 buildRule.executeTarget("simpleSourceFile");
423 }
424
425 /**
426 * Test that the sourcefile option of the Java task can only be run when fork attribute is set
427 *
428 * @throws Exception
429 */
430 @Test
431 public void testSourceFileRequiresFork() throws Exception {
432 requireJava11();
433 thrown.expect(BuildException.class);
434 thrown.expectMessage("Cannot execute sourcefile in non-forked mode. Please set fork='true'");
435 buildRule.executeTarget("sourceFileRequiresFork");
436 }
437
438 /**
439 * Tests that the sourcefile attribute and the classname attribute of the Java task cannot be used
440 * together
441 *
442 * @throws Exception
443 */
444 @Test
445 public void testSourceFileCantUseClassname() throws Exception {
446 requireJava11();
447 thrown.expect(BuildException.class);
448 thrown.expectMessage("Cannot use 'sourcefile' in combination with");
449 buildRule.executeTarget("sourceFileCantUseClassname");
450 }
451
452 /**
453 * Tests that the sourcefile attribute and the jar attribute of the Java task cannot be used
454 * together
455 *
456 * @throws Exception
457 */
458 @Test
459 public void testSourceFileCantUseJar() throws Exception {
460 requireJava11();
461 thrown.expect(BuildException.class);
462 thrown.expectMessage("Cannot use 'sourcefile' in combination with");
463 buildRule.executeTarget("sourceFileCantUseJar");
464 }
465
466 /**
467 * Tests that the sourcefile attribute and the module attribute of the Java task cannot be used
468 * together
469 *
470 * @throws Exception
471 */
472 @Test
473 public void testSourceFileCantUseModule() throws Exception {
474 requireJava11();
475 thrown.expect(BuildException.class);
476 thrown.expectMessage("Cannot use 'sourcefile' in combination with");
477 buildRule.executeTarget("sourceFileCantUseModule");
478 }
479
480 private static void requireJava11() {
481 final JavaVersion javaVersion = new JavaVersion();
482 javaVersion.setAtLeast("11");
483 Assume.assumeTrue("Skipping test which requires a minimum of Java 11 runtime", javaVersion.eval());
484 }
485
486 /**
413487 * entry point class with no dependencies other
414488 * than normal JRE runtime
415489 */
1717
1818 package org.apache.tools.ant.taskdefs;
1919
20 import org.junit.internal.AssumptionViolatedException;
20 import org.junit.AssumptionViolatedException;
2121
2222 /**
2323 * Interactive Testcase for Processdestroyer.
600600 }
601601
602602 }
603
604 @Test
603605 public void testGetDefaultEncoding() {
604606 // This just tests that the function does not blow up
605607 FILE_UTILS.getDefaultEncoding();
608 }
609
610 /**
611 * @see "https://bz.apache.org/bugzilla/show_bug.cgi?id=62502"
612 */
613 @Test
614 public void isLeadingPathCannotBeFooledByTooManyDoubleDots() {
615 assertFalse(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/../../bar")));
616 assertFalse(FILE_UTILS.isLeadingPath(new File("c:\\foo"), new File("c:\\foo\\..\\..\\bar")));
617 assertFalse(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/../..")));
618 }
619
620 /**
621 * @see "https://bz.apache.org/bugzilla/show_bug.cgi?id=62502"
622 */
623 @Test
624 public void isLeadingPathCanonicalVersionCannotBeFooledByTooManyDoubleDots() throws IOException {
625 assertFalse(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/../../bar"), true));
626 assertFalse(FILE_UTILS.isLeadingPath(new File("c:\\foo"), new File("c:\\foo\\..\\..\\bar"), true));
627 assertFalse(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/../.."), true));
628 }
629
630 @Test
631 public void isLeadingPathCanonicalVersionWorksAsExpectedOnUnix() throws IOException {
632 assumeFalse("Test doesn't run on DOS", Os.isFamily("dos"));
633 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/bar"), true));
634 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/baz/../bar"), true));
635 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/../foo/bar"), true));
636 assertFalse(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foobar"), true));
637 assertFalse(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/bar"), true));
638 }
639
640 @Test
641 public void isLeadingPathAndTrailingSlashesOnUnix() throws IOException {
642 assumeFalse("Test doesn't run on DOS", Os.isFamily("dos"));
643 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/bar"), true));
644 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/bar/"), true));
645 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/"), true));
646 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo"), true));
647 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/"), true));
648
649 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/bar"), false));
650 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/bar/"), false));
651 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo/"), false));
652 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo/"), new File("/foo"), false));
653 assertTrue(FILE_UTILS.isLeadingPath(new File("/foo"), new File("/foo/"), false));
654 }
655
656 @Test
657 public void isLeadingPathCanonicalVersionWorksAsExpectedOnDos() throws IOException {
658 assumeTrue("Test only runs on DOS", Os.isFamily("dos"));
659 assertTrue(FILE_UTILS.isLeadingPath(new File("C:\\foo"), new File("C:\\foo\\bar"), true));
660 assertTrue(FILE_UTILS.isLeadingPath(new File("C:\\foo"), new File("C:\\foo\\baz\\..\\bar"), true));
661 assertTrue(FILE_UTILS.isLeadingPath(new File("C:\\foo"), new File("C:\\foo\\..\\foo\\bar"), true));
662 assertFalse(FILE_UTILS.isLeadingPath(new File("C:\\foo"), new File("C:\\foobar"), true));
663 assertFalse(FILE_UTILS.isLeadingPath(new File("C:\\foo"), new File("C:\\bar"), true));
664 }
665
666 @Test
667 public void isLeadingPathAndTrailingSlashesOnDos() throws IOException {
668 assumeTrue("Test only runs on DOS", Os.isFamily("dos"));
669 assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\bar"), true));
670 assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\bar\\"), true));
671 assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\"), true));
672 assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo"), true));
673 assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo"), new File("c:\\foo\\"), true));
674
675 assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\bar"), false));
676 assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\bar\\"), false));
677 assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo\\"), false));
678 assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo\\"), new File("c:\\foo"), false));
679 assertTrue(FILE_UTILS.isLeadingPath(new File("c:\\foo"), new File("c:\\foo\\"), false));
606680 }
607681
608682 /**
3333 import java.util.Vector;
3434
3535 import org.apache.tools.ant.BuildException;
36 import org.junit.AssumptionViolatedException;
3637 import org.junit.Before;
3738 import org.junit.Test;
38 import org.junit.internal.AssumptionViolatedException;
3939
4040 /**
4141 * JUnit testcases for org.apache.tools.mail.MailMessage.