conor 01/09/30 06:21:54
Modified: . WHATSNEW
docs ant_in_anger.html
docs/manual/CoreTasks apply.html javac.html sql.html
docs/manual/CoreTypes fileset.html filterset.html
docs/manual/OptionalTasks ejb.html
src/etc/testcases/taskdefs template.xml
src/main/org/apache/tools/ant DirectoryScanner.java
FileScanner.java ProjectHelper.java Target.java
XmlLogger.java
src/main/org/apache/tools/ant/taskdefs Ant.java
AntStructure.java Jar.java Javac.java SQLExec.java
src/main/org/apache/tools/ant/taskdefs/compilers
DefaultCompilerAdapter.java Javac13.java
src/main/org/apache/tools/ant/taskdefs/optional Cab.java
src/main/org/apache/tools/ant/taskdefs/optional/depend
Depend.java
src/main/org/apache/tools/ant/taskdefs/optional/net FTP.java
src/main/org/apache/tools/ant/taskdefs/optional/sitraka
CovReport.java
src/main/org/apache/tools/ant/types FileSet.java
FilterSet.java FilterSetCollection.java
src/main/org/apache/tools/ant/util SourceFileScanner.java
Log:
Merge of 1.4.1 changes into Main truck for Gump testing
Revision Changes Path
1.154 +45 -2 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -w -u -r1.153 -r1.154
--- WHATSNEW 2001/09/13 04:48:06 1.153
+++ WHATSNEW 2001/09/30 13:21:53 1.154
@@ -1,5 +1,5 @@
-Changes from Ant 1.4 to current CVS version
-===========================================
+Changes from Ant 1.4.1 to current CVS version
+==============================================
Changes that could break older environments:
--------------------------------------------
@@ -19,6 +19,49 @@
* Fixed bug where ant would not copy system properties into new Project
in ant/antcall tasks when inheritall="false" is set.
+
+Changes from Ant 1.4 to Ant 1.4.1
+===========================================
+
+Fixed bugs:
+-----------
+
+* <ant>'s antfile attribute will now also be considered an absolute path on
+ Windows systems, if it starts with a \ and no drive specifier.
+
+* The fullpath attribute of <zipfileset> has been ignored if you used
+ the src attribute at the same time.
+
+* The manifest file is now always placed as the second entry (after
/META-INF)
+ in generated jars. This allows the manifest to be read by JarInputStreams
+
+* Fixed bug in depend task which would fail with a NullPointerException if no
+ dependency cache was specified.
+
+* sql task now handles REM statements correctly so that lines starying with
rem
+ but which are not comments are actually processed.
+
+* XMLLogger now uses the task's name rather than the classname
+
+* <mapper>s will now work as expected if the to pattern expands to an
+ absolute pathname.
+
+* <javac> didn't ignore memory settings in non-fork mode
+
+* <cab> didn't split the options attribute into several command line
+ arguments correctly.
+
+Other changes:
+--------------
+
+* New source attribute for <javac> to enable assertion in JDK 1.4
+
+* XmlLogger and <antstructure> now add an encoding declaration to the
+ XML files they generate.
+
+* <fileset> has a new attribute "casesensitive" to make it match
+ filenames in a case insensitive way (if you set it to false) - by
+ default filesets remain case sensitive.
Changes from Ant 1.3 to Ant 1.4
===========================================
1.5 +31 -6 jakarta-ant/docs/ant_in_anger.html
Index: ant_in_anger.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/ant_in_anger.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
--- ant_in_anger.html 2001/08/30 13:23:12 1.4
+++ ant_in_anger.html 2001/09/30 13:21:53 1.5
@@ -185,7 +185,7 @@
new JVM for these tests, so that a significant crash does not break the
full build. The Junit extensions such as
<a href="http://httpunit.sourceforge.net/">HttpUnit</a> for web pages, and
-<a href="http://jakarta.apache.org/commons/cactus/">Cactus</a> for J2EE and
servlet
+<a href="http://jakarta.apache.org/cactus/">Cactus</a> for J2EE and servlet
testing help to expand the testing framework. To test properly you will still
need to invest a lot of effort in getting these to work with your project,
and
deriving great unit, system and regression tests -but your customers will
love
@@ -659,10 +659,16 @@
</b><dd>
The <a href="http://www.jikes.org/">jikes compiler</a> is usually much
-faster than javac, and does dependency checking. Get it. Then set
-build.compiler to "jikes" for it to be used in your build files. Better
-yet, set the JIKES_HOME environment variable for jikes to automatically
-get used, without changing your build files to only work with jikes.
+faster than javac, does dependency checking and has better error
+messages (usually). Get it. Then set
+build.compiler to "jikes" for it to be used in your build files.
+Doing this explicitly in your build files is a bit dubious as it requires the
+whole team (and sub projects) to be using jikes too -something you can only
+control in small, closed source projects. But if you set
+<tt>ANT_OPTS = -Dbuild.compiler=jikes</tt>
+in your environment, then all your builds on your system will use
+Jikes automatically, while others can choose their own compiler, or let
+ant choose whichever is appropriate for the current version of Java.
<dt><b>
#include targets to simplify multi build.xml projects
@@ -924,6 +930,25 @@
still makes sense when you get back to it, and use Antidote to edit the
files if you prefer it.
+<h3>Big projects still get complicated fast</h3>
+
+Large software projects create their own complexity, with inter-dependent
+libraries, long test cycles, hard deployment processes and a multitude of
+people each working on their own bit of the solution. That's even before
+the deadlines loom close, the integration problems become insurmountable,
+weekends become indistinguishable from weekdays in terms of workload and
+half the team stops talking to the other half. Ant may simplify the
+build and test process, and can eliminate the full time 'makefile engineer'
+role, but that doesn't mean that someone can stop 'owning the build'.
+Being in charge of the build has to mean more than they type 'ant all' on
+their system, it means they need to set the standards of what build tools to
+use, what the common targets, what property names and files should be
+and generally oversee the sub projects build processes. On a small project,
+you don't need to do that -but remember: small projects become big projects
+when you aren't looking. If you start off with a little bit of process, then
+you can scale it if needed. Ff you start with none, by the time you need
+it it will be too late.
+
<h3>You still need all the other foundational bits of a software
project</h3>
1.8 +1 -1 jakarta-ant/docs/manual/CoreTasks/apply.html
Index: apply.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/apply.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -u -r1.7 -r1.8
--- apply.html 2001/07/27 09:57:35 1.7
+++ apply.html 2001/09/30 13:21:53 1.8
@@ -166,7 +166,7 @@
<blockquote><pre>
<apply executable="somecommand" parallel="false" >
<arg value="arg1"/>
- <srfile/>
+ <srcfile/>
<arg value="arg2"/>
<fileset dir="/tmp"/>
</apply>
1.13 +10 -9 jakarta-ant/docs/manual/CoreTasks/javac.html
Index: javac.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/javac.html,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -u -r1.12 -r1.13
--- javac.html 2001/09/08 01:05:17 1.12
+++ javac.html 2001/09/30 13:21:53 1.13
@@ -215,6 +215,15 @@
</td>
<td align="center" valign="top">No</td>
</tr>
+ <tr>
+ <td valign="top">source</td>
+ <td valign="top">Value of the <code>-source</code> command line
+ switch, will be ignored by all implementations except
+ <code>modern</code>, legal values are "1.3" and
+ "1.4" - by default, no <code>-source</code> argument
+ will be used at all.</td>
+ <td align="center" valign="top">No</td>
+ </tr>
</table>
<h3>Parameters specified as nested elements</h3>
@@ -291,15 +300,7 @@
<h3>Jikes Notes</h3>
-If the environment variable <tt>JIKES_HOME</tt> is set to the location
-of the jikes compiler, then the standard Ant invocation scripts
-automatically set build.compiler to "jikes". This enables one to
use
-jikes when available, without having to commit the build file to a
-single choice of compiler.
-
-<p>
-
-Jikes also supports some extra options, which can be set be defining
+Jikes supports some extra options, which can be set be defining
properties prior to invoking the task. The ant developers are aware that
this is ugly and inflexible -expect a better solution in the future. All
the options are boolean, and must be set to "true" or
"yes" to be
1.7 +25 -0 jakarta-ant/docs/manual/CoreTasks/sql.html
Index: sql.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/sql.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- sql.html 2001/09/19 12:06:11 1.6
+++ sql.html 2001/09/30 13:21:53 1.7
@@ -129,6 +129,12 @@
<td valign="top" align="center">Yes, unless statements enclosed within
tags</td>
</tr>
</table>
+<h4>fileset</h4>
+<p>You can specify multiple source files via nested <a
+href="../CoreTypes/fileset.html">fileset</a> elements. Each file of
+the fileset will be run in a transaction of its own, the order by
+which the files of a single fileset will be executed is not
+defined.</p>
<h4>classpath</h4>
<p><code>Sql</code>'s <em>classpath</em> attribute is a <a
href="../using.html#path">PATH like structure</a> and can also be set via a
nested
@@ -199,6 +205,25 @@
<transaction src="data1.sql" />
<transaction src="data2.sql" />
<transaction src="data3.sql" />
+ <transaction>
+ truncate table some_other_table;
+ </transaction>
+</sql>
+</pre></blockquote>
+
+<p>The following example does the same as (and may execute additional
+SQL files if there are more files matching the pattern
+<code>data*.sql</code>) but doesn't guarantee that data1.sql will be
+run before <code>data2.sql</code>.</p>
+
+<blockquote><pre><sql
+ driver="org.database.jdbcDriver"
+ url="jdbc:database-url"
+ userid="sa"
+ password="pass" >
+ <fileset dir=".">
+ <include name="data*.sql" />
+ </fileset>
<transaction>
truncate table some_other_table;
</transaction>
1.5 +7 -1 jakarta-ant/docs/manual/CoreTypes/fileset.html
Index: fileset.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTypes/fileset.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -u -r1.4 -r1.5
--- fileset.html 2001/08/01 09:08:55 1.4
+++ fileset.html 2001/09/30 13:21:53 1.5
@@ -62,11 +62,17 @@
taken to be an exclude pattern.</td>
<td valign="top" align="center">No</td>
</tr>
+ <tr>
+ <td valign="top">casesensitive</td>
+ <td valign="top">Must the file system be treated in a case sensitive way?
+ Defaults to true.</td>
+ <td valign="top" align="center">No</td>
+ </tr>
</table>
<h4>Examples</h4>
<blockquote><pre>
-<fileset dir="${server.src}" >
+<fileset dir="${server.src}" casesensitive="yes" >
<patternset id="non.test.sources" >
<include name="**/*.java"/>
<exclude name="**/*Test*"/>
1.3 +2 -2 jakarta-ant/docs/manual/CoreTypes/filterset.html
Index: filterset.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTypes/filterset.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- filterset.html 2001/08/30 13:23:14 1.2
+++ filterset.html 2001/09/30 13:21:53 1.3
@@ -28,7 +28,7 @@
<TD vAlign=top align="center"><B>Required</B></TD>
</TR>
<TR>
- <TD vAlign=top>starttoken</TD>
+ <TD vAlign=top>begintoken</TD>
<TD vAlign=top>The string marking the beginning of a token. eg
<STRONG>@</STRONG>Date@</TD>
<TD vAlign=top>@</TD>
@@ -82,7 +82,7 @@
<p>You are copying the version.txt file to the dist directory from the build
directory
but wish to replace the token @DATE@ with todays date.</p>
<BLOCKQUOTE><PRE>
-<copy file="${build.home}/version.txt"
toFile="${dist.home}/version.txt"<
+<copy file="${build.home}/version.txt"
toFile="${dist.home}/version.txt">
<filterset>
<filter token="DATE" value="${DATE}"/>
</filterset>
1.10 +76 -15 jakarta-ant/docs/manual/OptionalTasks/ejb.html
Index: ejb.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/OptionalTasks/ejb.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -u -r1.9 -r1.10
--- ejb.html 2001/09/08 01:05:18 1.9
+++ ejb.html 2001/09/30 13:21:53 1.10
@@ -20,7 +20,7 @@
</ul>
<p>Version @VERSION@<br>
-$Id: ejb.html,v 1.9 2001/09/08 01:05:18 nico Exp $
+$Id: ejb.html,v 1.10 2001/09/30 13:21:53 conor Exp $
</p>
<hr>
<h2>Table of Contents</h2>
@@ -533,20 +533,6 @@
<li>TOPLink for WebLogic 2.5.1-enabled entity beans</li>
</ul>
-<p>This task supports two approaches to creating ejb jar files. The first
-approach assumes a particular naming convention for deployment descriptor
files.
-For an Account bean, for example, the deployment descriptor would be named
-<code>Account-ejb-jar.xml</code>. This naming convention allows the task to
-distinguish deployment descriptors without relying on their positioning
within a
-source tree. It is also used to derive the name of the .jar file which is
-generated. For the example this would be <code>Account.jar</code>. Vendor
-specific files are assumed to be named in a similar fashion. The deployment
-descriptor file which defines additional weblogic specific information for
the
-above bean would be <code>Account-weblogic-ejb-jar.xml</code>. The second
-approach does not require a naming convention. This approach uses a
specified a
-jar name for the resultant ejb jar. If the jar name is present, then no
naming
-convention is required. If the jar name is not specified, then the default
-naming convention is expected for the deployment descriptor files.</p>
<p>The task works as a directory scanning task, and performs an action for
each
deployment descriptor found. As such the includes and excludes should be set
@@ -571,6 +557,75 @@
any of these files are newer than the jar file the jar will be rebuilt
otherwise
a message is logged that the jar file is up to date.</p>
+<h3>Naming Convention</h3>
+
+Ejbjar handles the processing of multiple beans, and it uses a set of naming
+conventions to determine the name of the generated EJB jars. The naming
convention
+that is used is controlled by the "naming" attribute. It supports
the
+following values
+<ul>
+
+<li>descriptor</li>
+<p>This is the default naming scheme. The name of the generated bean is
derived from the
+name of the deployment descriptor. For an Account bean, for example, the
deployment
+descriptor would be named <code>Account-ejb-jar.xml</code>. Vendor specific
descriptors are
+located using the same naming convention. The weblogic bean, for example,
would be named
+<code>Account-weblogic-ejb-jar.xml</code>. Under this arrangment, the
deployment descriptors
+can be separated from the code implementing the beans, which can be useful
whe the same bean code
+is deployed in separate beans.
+</p>
+
+<p>This scheme is useful when you are using one bean per EJB jar and where
you may be
+deploying the same bean classes in different beans, with different
deployment characteristics.
+
+<li>ejb-name</li>
+<p> This naming scheme uses the <ejb-name> element from the deployment
descriptor to
+determine the bean name. In this situation, the descriptors normally use the
generic
+descriptor names, such as <code>ejb-jar.xml</code> along with any associated
vendor specific descriptor
+names. For example, If the value of the <ejb-name> were to be given in
the deployment descriptor
+as follows:
+<pre>
+<ejb-jar>
+ <enterprise-beans>
+ <entity>
+ <ejb-name>Sample</ejb-name>
+ <home>org.apache.ant.ejbsample.SampleHome</home>
+</pre>
+
+then the name of the generated bean would be <code>Sample.jar</code>
+</p>
+<p> This scheme is useful where you want to use the standard deployment
descriptor names, which may be more
+compatible with other EJB tools. This scheme must have one bean per jar.
+</p>
+<li>directory</li>
+<p>
+In this mode, the name of the generated bean jar is derived from the
directory
+containing the deployment descriptors. Again the deployment descriptors
typically use
+the standard filenames. For example, if the path to the deployment
descriptor is
+<code>/home/user/dev/appserver/dd/sample</code>, then the generated
+bean will be named <code>sample.jar</code>
+</p>
+<p>
+This scheme is also useful when you want to use standard style descriptor
names. It is often
+most useful when the descriptors are located in the same directory as the
bean source code,
+although that is not mandatory. This scheme can handle multiple beans per
jar.
+</p>
+
+<li>basejarname</li>
+<p>
+The final scheme supported by the <ejbjar> task is used when you want
to specify the generated
+bean jar name directly. In this case the name of the generated jar is
specified by the
+"basejarname" attribute. Since all generated beans will have the
same name, this task should
+be only used when each descriptor is in its own directory.
+</p>
+
+<p>
+This scheme is most appropriate when you are using multiple beans per jar
and only process a single
+deployment descriptor. You typically want to specify the name of the jar and
not derive it from the
+beans in the jar.
+</p>
+
+</ul>
<h3>Parameters:</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -604,6 +659,12 @@
task is generating generic jars (i.e. no vendor-specific
deployment elements have been specified).</td>
<td valign="top" align="center">Yes</td>
+ </tr>
+ <tr>
+ <td valign="top">naming</td>
+ <td valign="top">Controls the naming convention used to name generated
+ EJB jars. Please refer to the description above.</td>
+ <td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">basejarname</td>
1.3 +0 -14 jakarta-ant/src/etc/testcases/taskdefs/template.xml
<<Binary file>>
1.16 +110 -19
jakarta-ant/src/main/org/apache/tools/ant/DirectoryScanner.java
Index: DirectoryScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/DirectoryScanner.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -u -r1.15 -r1.16
--- DirectoryScanner.java 2001/07/12 13:02:42 1.15
+++ DirectoryScanner.java 2001/09/30 13:21:53 1.16
@@ -113,6 +113,9 @@
* "**\test\**\XYZ*" matches all files/dirs that start with "XYZ" and where
* there is a parent directory called test (e.g. "abc\test\def\ghi\XYZ123").
* <p>
+ * Case sensitivity may be turned off if necessary. By default, it is
+ * turned on.
+ * <p>
* Example of usage:
* <pre>
* String[] includes = {"**\\*.class"};
@@ -120,6 +123,7 @@
* ds.setIncludes(includes);
* ds.setExcludes(excludes);
* ds.setBasedir(new File("test"));
+ * ds.setCaseSensitive(true);
* ds.scan();
*
* System.out.println("FILES:");
@@ -132,6 +136,7 @@
* .class files in all directories under a directory called "modules"
*
* @author Arnout J. Kuiper <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Magesh Umasankar</a>
*/
public class DirectoryScanner implements FileScanner {
@@ -208,6 +213,11 @@
protected boolean haveSlowResults = false;
/**
+ * Should the file system be treated as a case sensitive one?
+ */
+ protected boolean isCaseSensitive = true;
+
+ /**
* Constructor.
*/
public DirectoryScanner() {
@@ -216,7 +226,7 @@
/**
* Does the path match the start of this pattern up to the first "**".
- +
+ *
* <p>This is not a general purpose test and should only be used if you
* can live with false positives.</p>
*
@@ -226,6 +236,23 @@
* @param str the (non-null) string (path) to match
*/
protected static boolean matchPatternStart(String pattern, String str) {
+ return matchPatternStart(pattern, str, true);
+ }
+
+ /**
+ * Does the path match the start of this pattern up to the first "**".
+ *
+ * <p>This is not a general purpose test and should only be used if you
+ * can live with false positives.</p>
+ *
+ * <p><code>pattern=**\\a</code> and <code>str=b</code> will yield true.
+ *
+ * @param pattern the (non-null) pattern to match against
+ * @param str the (non-null) string (path) to match
+ * @param isCaseSensitive must matches be case sensitive?
+ */
+ protected static boolean matchPatternStart(String pattern, String str,
+ boolean isCaseSensitive) {
// When str starts with a File.separator, pattern has to start with a
// File.separator.
// When pattern starts with a File.separator, str has to start with a
@@ -258,7 +285,7 @@
if (patDir.equals("**")) {
break;
}
- if (!match(patDir,(String)strDirs.elementAt(strIdxStart))) {
+ if (!match(patDir,(String)strDirs.elementAt(strIdxStart),
isCaseSensitive)) {
return false;
}
patIdxStart++;
@@ -288,6 +315,20 @@
* <code>false</code> otherwise.
*/
protected static boolean matchPath(String pattern, String str) {
+ return matchPath(pattern, str, true);
+ }
+
+ /**
+ * Matches a path against a pattern.
+ *
+ * @param pattern the (non-null) pattern to match against
+ * @param str the (non-null) string (path) to match
+ * @param isCaseSensitive must a case sensitive match be done?
+ *
+ * @return <code>true</code> when the pattern matches against the string.
+ * <code>false</code> otherwise.
+ */
+ protected static boolean matchPath(String pattern, String str, boolean
isCaseSensitive) {
// When str starts with a File.separator, pattern has to start with a
// File.separator.
// When pattern starts with a File.separator, str has to start with a
@@ -320,7 +361,7 @@
if (patDir.equals("**")) {
break;
}
- if (!match(patDir,(String)strDirs.elementAt(strIdxStart))) {
+ if (!match(patDir,(String)strDirs.elementAt(strIdxStart),
isCaseSensitive)) {
return false;
}
patIdxStart++;
@@ -347,7 +388,7 @@
if (patDir.equals("**")) {
break;
}
- if (!match(patDir,(String)strDirs.elementAt(strIdxEnd))) {
+ if (!match(patDir,(String)strDirs.elementAt(strIdxEnd),
isCaseSensitive)) {
return false;
}
patIdxEnd--;
@@ -386,7 +427,7 @@
for (int j = 0; j < patLength; j++) {
String subPat =
(String)patDirs.elementAt(patIdxStart+j+1);
String subStr =
(String)strDirs.elementAt(strIdxStart+i+j);
- if (!match(subPat,subStr)) {
+ if (!match(subPat,subStr, isCaseSensitive)) {
continue strLoop;
}
}
@@ -413,7 +454,6 @@
}
-
/**
* Matches a string against a pattern. The pattern contains two special
* characters:
@@ -428,6 +468,24 @@
* <code>false</code> otherwise.
*/
protected static boolean match(String pattern, String str) {
+ return match(pattern, str, true);
+ }
+
+
+ /**
+ * Matches a string against a pattern. The pattern contains two special
+ * characters:
+ * '*' which means zero or more characters,
+ * '?' which means one and only one character.
+ *
+ * @param pattern the (non-null) pattern to match against
+ * @param str the (non-null) string that must be matched against the
+ * pattern
+ *
+ * @return <code>true</code> when the string matches against the pattern,
+ * <code>false</code> otherwise.
+ */
+ protected static boolean match(String pattern, String str, boolean
isCaseSensitive) {
char[] patArr = pattern.toCharArray();
char[] strArr = str.toCharArray();
int patIdxStart = 0;
@@ -451,10 +509,16 @@
}
for (int i = 0; i <= patIdxEnd; i++) {
ch = patArr[i];
- if (ch != '?' && ch != strArr[i]) {
+ if (ch != '?') {
+ if (isCaseSensitive && ch != strArr[i]) {
+ return false;// Character mismatch
+ }
+ if (!isCaseSensitive && Character.toUpperCase(ch) !=
+ Character.toUpperCase(strArr[i])) {
return false; // Character mismatch
}
}
+ }
return true; // String matches against pattern
}
@@ -464,9 +528,15 @@
// Process characters before first star
while((ch = patArr[patIdxStart]) != '*' && strIdxStart <= strIdxEnd)
{
- if (ch != '?' && ch != strArr[strIdxStart]) {
- return false;
+ if (ch != '?') {
+ if (isCaseSensitive && ch != strArr[strIdxStart]) {
+ return false;// Character mismatch
}
+ if (!isCaseSensitive && Character.toUpperCase(ch) !=
+ Character.toUpperCase(strArr[strIdxStart])) {
+ return false;// Character mismatch
+ }
+ }
patIdxStart++;
strIdxStart++;
}
@@ -483,8 +553,14 @@
// Process characters after last star
while((ch = patArr[patIdxEnd]) != '*' && strIdxStart <= strIdxEnd) {
- if (ch != '?' && ch != strArr[strIdxEnd]) {
- return false;
+ if (ch != '?') {
+ if (isCaseSensitive && ch != strArr[strIdxEnd]) {
+ return false;// Character mismatch
+ }
+ if (!isCaseSensitive && Character.toUpperCase(ch) !=
+ Character.toUpperCase(strArr[strIdxEnd])) {
+ return false;// Character mismatch
+ }
}
patIdxEnd--;
strIdxEnd--;
@@ -524,10 +600,16 @@
for (int i = 0; i <= strLength - patLength; i++) {
for (int j = 0; j < patLength; j++) {
ch = patArr[patIdxStart+j+1];
- if (ch != '?' && ch != strArr[strIdxStart+i+j]) {
+ if (ch != '?') {
+ if (isCaseSensitive && ch !=
strArr[strIdxStart+i+j]) {
continue strLoop;
}
+ if (!isCaseSensitive && Character.toUpperCase(ch) !=
+ Character.toUpperCase(strArr[strIdxStart+i+j])) {
+ continue strLoop;
+ }
}
+ }
foundIdx = strIdxStart+i;
break;
@@ -592,6 +674,15 @@
/**
+ * Sets the case sensitivity of the file system
+ *
+ * @param specifies if the filesystem is case sensitive
+ */
+ public void setCaseSensitive(boolean isCaseSensitive) {
+ this.isCaseSensitive = isCaseSensitive;
+ }
+
+ /**
* Sets the set of include patterns to use. All '/' and '\' characters
are
* replaced by <code>File.separatorChar</code>. So the separator used
need
* not match <code>File.separatorChar</code>.
@@ -808,7 +899,7 @@
*/
protected boolean isIncluded(String name) {
for (int i = 0; i < includes.length; i++) {
- if (matchPath(includes[i],name)) {
+ if (matchPath(includes[i],name, isCaseSensitive)) {
return true;
}
}
@@ -824,7 +915,7 @@
*/
protected boolean couldHoldIncluded(String name) {
for (int i = 0; i < includes.length; i++) {
- if (matchPatternStart(includes[i],name)) {
+ if (matchPatternStart(includes[i],name, isCaseSensitive)) {
return true;
}
}
@@ -840,7 +931,7 @@
*/
protected boolean isExcluded(String name) {
for (int i = 0; i < excludes.length; i++) {
- if (matchPath(excludes[i],name)) {
+ if (matchPath(excludes[i],name, isCaseSensitive)) {
return true;
}
}
1.6 +7 -0
jakarta-ant/src/main/org/apache/tools/ant/FileScanner.java
Index: FileScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/FileScanner.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- FileScanner.java 2001/09/13 08:40:37 1.5
+++ FileScanner.java 2001/09/30 13:21:53 1.6
@@ -152,4 +152,11 @@
* @param includes list of include patterns
*/
void setIncludes(String[] includes);
+
+ /**
+ * Sets the case sensitivity of the file system
+ *
+ * @param specifies if the filesystem is case sensitive
+ */
+ void setCaseSensitive(boolean isCaseSensitive);
}
1.62 +1 -5
jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java
Index: ProjectHelper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -w -u -r1.61 -r1.62
--- ProjectHelper.java 2001/08/19 05:52:00 1.61
+++ ProjectHelper.java 2001/09/30 13:21:53 1.62
@@ -421,11 +421,7 @@
// take care of dependencies
if (depends.length() > 0) {
- StringTokenizer tok =
- new StringTokenizer(depends, ",", false);
- while (tok.hasMoreTokens()) {
- target.addDependency(tok.nextToken().trim());
- }
+ target.setDepends(depends);
}
}
1.23 +4 -1 jakarta-ant/src/main/org/apache/tools/ant/Target.java
Index: Target.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Target.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -w -u -r1.22 -r1.23
--- Target.java 2001/08/02 11:42:55 1.22
+++ Target.java 2001/09/30 13:21:53 1.23
@@ -85,7 +85,10 @@
StringTokenizer tok =
new StringTokenizer(depS, ",", false);
while (tok.hasMoreTokens()) {
- addDependency(tok.nextToken().trim());
+ String token = tok.nextToken().trim();
+ if (!token.equals("")) {
+ addDependency(token);
+ }
}
}
}
1.13 +1 -5 jakarta-ant/src/main/org/apache/tools/ant/XmlLogger.java
Index: XmlLogger.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/XmlLogger.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -u -r1.12 -r1.13
--- XmlLogger.java 2001/09/13 16:02:03 1.12
+++ XmlLogger.java 2001/09/30 13:21:53 1.13
@@ -201,11 +201,7 @@
taskElement.startTime = System.currentTimeMillis();
taskElement.element = doc.createElement(TASK_TAG);
- String name = task.getClass().getName();
- int pos = name.lastIndexOf(".");
- if (pos != -1) {
- name = name.substring(pos + 1);
- }
+ String name = event.getTask().getTaskName();
taskElement.element.setAttribute(NAME_ATTR, name);
taskElement.element.setAttribute(LOCATION_ATTR,
event.getTask().getLocation().toString());
tasks.put(task, taskElement);
1.28 +69 -39
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
Index: Ant.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -w -u -r1.27 -r1.28
--- Ant.java 2001/09/14 06:04:21 1.27
+++ Ant.java 2001/09/30 13:21:53 1.28
@@ -80,28 +80,40 @@
*/
public class Ant extends Task {
+ /** the basedir where is executed the build file */
private File dir = null;
+
+ /** the build.xml file (can be absolute) in this case dir will be
ignored */
private String antFile = null;
+
+ /** the target to call if any */
private String target = null;
+
+ /** the output */
private String output = null;
+
+ /** should we inherit properties from the parent ? */
private boolean inheritAll = true;
+
+ /** the properties to pass to the new project */
+ private Vector properties = new Vector();
- Vector properties = new Vector();
- Project p1;
+ /** the temporary project created to run the build file */
+ private Project newProject;
/**
* If true, inherit all properties from parent Project
* If false, inherit only userProperties and those defined
* inside the ant call itself
- **/
- public void setInheritAll(boolean inherit) {
- inheritAll = inherit;
- } //-- setInheritAll
+ */
+ public void setInheritAll(boolean value) {
+ inheritAll = value;
+ }
public void init() {
- p1 = new Project();
- p1.setJavaVersionProperty();
- p1.addTaskDefinition("property",
+ newProject = new Project();
+ newProject.setJavaVersionProperty();
+ newProject.addTaskDefinition("property",
(Class)project.getTaskDefinitions().get("property"));
}
@@ -109,7 +121,7 @@
init();
for (int i=0; i<properties.size(); i++) {
Property p = (Property) properties.elementAt(i);
- Property newP = (Property) p1.createTask("property");
+ Property newP = (Property) newProject.createTask("property");
newP.setName(p.getName());
if (p.getValue() != null) {
newP.setValue(p.getValue());
@@ -127,7 +139,7 @@
private void initializeProject() {
Vector listeners = project.getBuildListeners();
for (int i = 0; i < listeners.size(); i++) {
- p1.addBuildListener((BuildListener)listeners.elementAt(i));
+
newProject.addBuildListener((BuildListener)listeners.elementAt(i));
}
if (output != null) {
@@ -137,7 +149,7 @@
logger.setMessageOutputLevel(Project.MSG_INFO);
logger.setOutputPrintStream(out);
logger.setErrorPrintStream(out);
- p1.addBuildListener(logger);
+ newProject.addBuildListener(logger);
}
catch( IOException ex ) {
log( "Ant: Can't set output to " + output );
@@ -149,7 +161,7 @@
while (et.hasMoreElements()) {
String taskName = (String) et.nextElement();
Class taskClass = (Class) taskdefs.get(taskName);
- p1.addTaskDefinition(taskName, taskClass);
+ newProject.addTaskDefinition(taskName, taskClass);
}
Hashtable typedefs = project.getDataTypeDefinitions();
@@ -157,7 +169,7 @@
while (e.hasMoreElements()) {
String typeName = (String) e.nextElement();
Class typeClass = (Class) typedefs.get(typeName);
- p1.addDataTypeDefinition(typeName, typeClass);
+ newProject.addDataTypeDefinition(typeName, typeClass);
}
// set user-defined or all properties from calling project
@@ -170,23 +182,24 @@
// set Java built-in properties separately,
// b/c we won't inherit them.
- p1.setSystemProperties();
+ newProject.setSystemProperties();
}
e = prop1.keys();
while (e.hasMoreElements()) {
String arg = (String) e.nextElement();
String value = (String) prop1.get(arg);
- if (inheritAll == true)
- p1.setProperty(arg, value);
- else
- p1.setUserProperty(arg, value);
+ if (inheritAll == true){
+ newProject.setProperty(arg, value);
+ } else {
+ newProject.setUserProperty(arg, value);
+ }
}
}
protected void handleOutput(String line) {
- if (p1 != null) {
- p1.demuxOutput(line, false);
+ if (newProject != null) {
+ newProject.demuxOutput(line, false);
}
else {
super.handleOutput(line);
@@ -194,8 +207,8 @@
}
protected void handleErrorOutput(String line) {
- if (p1 != null) {
- p1.demuxOutput(line, true);
+ if (newProject != null) {
+ newProject.demuxOutput(line, true);
}
else {
super.handleErrorOutput(line);
@@ -207,17 +220,18 @@
*/
public void execute() throws BuildException {
try {
- if (p1 == null) {
+ if (newProject == null) {
reinit();
}
- if(dir == null)
+ if (dir == null) {
dir = project.getBaseDir();
+ }
initializeProject();
- p1.setBaseDir(dir);
- p1.setUserProperty("basedir" , dir.getAbsolutePath());
+ newProject.setBaseDir(dir);
+ newProject.setUserProperty("basedir" , dir.getAbsolutePath());
// Override with local-defined properties
Enumeration e = properties.elements();
@@ -226,43 +240,59 @@
p.execute();
}
- if (antFile == null)
+ if (antFile == null) {
antFile = "build.xml";
+ }
File file = FileUtils.newFileUtils().resolveFile(dir, antFile);
antFile = file.getAbsolutePath();
- p1.setUserProperty( "ant.file" , antFile );
- ProjectHelper.configureProject(p1, new File(antFile));
+ newProject.setUserProperty( "ant.file" , antFile );
+ ProjectHelper.configureProject(newProject, new File(antFile));
if (target == null) {
- target = p1.getDefaultTarget();
+ target = newProject.getDefaultTarget();
}
// Are we trying to call the target in which we are defined?
- if (p1.getBaseDir().equals(project.getBaseDir()) &&
-
p1.getProperty("ant.file").equals(project.getProperty("ant.file")) &&
+ if (newProject.getBaseDir().equals(project.getBaseDir()) &&
+
newProject.getProperty("ant.file").equals(project.getProperty("ant.file")) &&
getOwningTarget() != null &&
target.equals(this.getOwningTarget().getName())) {
throw new BuildException("ant task calling its own parent
target");
}
- p1.executeTarget(target);
+ newProject.executeTarget(target);
} finally {
// help the gc
- p1 = null;
+ newProject = null;
}
}
+ /**
+ * ...
+ */
public void setDir(File d) {
this.dir = d;
}
+ /**
+ * set the build file, it can be either absolute or relative.
+ * If it is absolute, <tt>dir</tt> will be ignored, if it is
+ * relative it will be resolved relative to <tt>dir</tt>.
+ */
public void setAntfile(String s) {
+ // @note: it is a string and not a file to handle relative/absolute
+ // otherwise a relative file will be resolved based on the current
+ // basedir.
this.antFile = s;
}
+ /**
+ * set the target to execute. If none is defined it will
+ * execute the default target of the build file
+ */
public void setTarget(String s) {
this.target = s;
}
@@ -271,12 +301,12 @@
this.output = s;
}
+ /** create a property to pass to the new project as a 'user property' */
public Property createProperty() {
- if (p1 == null) {
+ if (newProject == null) {
reinit();
}
-
- Property p=(Property)p1.createTask("property");
+ Property p=(Property)newProject.createTask("property");
p.setUserProperty(true);
properties.addElement( p );
return p;
1.14 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/AntStructure.java
Index: AntStructure.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/AntStructure.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -u -r1.13 -r1.14
--- AntStructure.java 2001/07/26 07:51:28 1.13
+++ AntStructure.java 2001/09/30 13:21:53 1.14
@@ -71,7 +71,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
*
- * @version $Revision: 1.13 $
+ * @version $Revision: 1.14 $
*/
public class AntStructure extends Task {
@@ -146,7 +146,7 @@
private void printHead(PrintWriter out, Enumeration tasks,
Enumeration types) {
- out.println("<?xml version=\"1.0\" ?>");
+ out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
out.println("<!ENTITY % boolean \"(true|false|on|off|yes|no)\">");
out.print("<!ENTITY % tasks \"");
boolean first = true;
1.25 +24 -50
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java
Index: Jar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -w -u -r1.24 -r1.25
--- Jar.java 2001/09/12 15:41:54 1.24
+++ Jar.java 2001/09/30 13:21:53 1.25
@@ -141,15 +141,24 @@
throws IOException, BuildException
{
try {
- // If no manifest is specified, add the default one.
- if (manifest == null) {
- execManifest = null;
- }
- else {
- execManifest = new Manifest();
+ execManifest = getDefaultManifest();
+
+ if (manifest != null) {
execManifest.merge(manifest);
}
+ for (Enumeration e = execManifest.getWarnings();
e.hasMoreElements(); ) {
+ log("Manifest warning: " + (String)e.nextElement(),
Project.MSG_WARN);
+ }
+
zipDir(null, zOut, "META-INF/");
+ // time to write the manifest
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintWriter writer = new PrintWriter(baos);
+ execManifest.write(writer);
+ writer.flush();
+
+ ByteArrayInputStream bais = new
ByteArrayInputStream(baos.toByteArray());
+ super.zipFile(bais, zOut, "META-INF/MANIFEST.MF",
System.currentTimeMillis());
super.initZipOutputStream(zOut);
}
catch (ManifestException e) {
@@ -175,28 +184,6 @@
}
}
- protected void finalizeZipOutputStream(ZipOutputStream zOut)
- throws IOException, BuildException {
-
- if (execManifest == null) {
- execManifest = getDefaultManifest();
- }
-
- for (Enumeration e = execManifest.getWarnings();
e.hasMoreElements(); ) {
- log("Manifest warning: " + (String)e.nextElement(),
Project.MSG_WARN);
- }
-
- // time to write the manifest
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintWriter writer = new PrintWriter(baos);
- execManifest.write(writer);
- writer.flush();
-
- ByteArrayInputStream bais = new
ByteArrayInputStream(baos.toByteArray());
- super.zipFile(bais, zOut, "META-INF/MANIFEST.MF",
System.currentTimeMillis());
- super.finalizeZipOutputStream(zOut);
- }
-
/**
* Handle situation when we encounter a manifest file
*
@@ -223,30 +210,17 @@
protected void zipFile(File file, ZipOutputStream zOut, String vPath)
throws IOException
{
- // If the file being added is META-INF/MANIFEST.MF, we merge it with
the
- // current manifest
+ // If the file being added is META-INF/MANIFEST.MF, we warn if it's
not the
+ // one specified in the "manifest" attribute - or if it's being
added twice,
+ // meaning the same file is specified by the "manifeset" attribute
and in
+ // a <fileset> element.
if (vPath.equalsIgnoreCase("META-INF/MANIFEST.MF")) {
- InputStream is = null;
- try {
- is = new FileInputStream(file);
- zipManifestEntry(is);
- }
- catch (IOException e) {
- throw new BuildException("Unable to read manifest file: " +
file, e);
- }
- finally {
- if (is != null) {
- try {
- is.close();
- }
- catch (IOException e) {
- // do nothing
- }
- }
- }
+ log("Warning: selected "+archiveType+" files include a
META-INF/MANIFEST.MF which will be ignored " +
+ "(please use manifest attribute to "+archiveType+" task)",
Project.MSG_WARN);
} else {
super.zipFile(file, zOut, vPath);
}
+
}
protected void zipFile(InputStream is, ZipOutputStream zOut, String
vPath, long lastModified)
1.70 +611 -584
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
Index: Javac.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -w -u -r1.69 -r1.70
--- Javac.java 2001/08/30 13:26:37 1.69
+++ Javac.java 2001/09/30 13:21:53 1.70
@@ -82,6 +82,7 @@
* <li>failonerror
* <li>includeantruntime
* <li>includejavaruntime
+ * <li>source
* </ul>
* Of these arguments, the <b>sourcedir</b> and <b>destdir</b> are required.
* <p>
@@ -122,7 +123,25 @@
protected boolean failOnError = true;
protected File[] compileList = new File[0];
+ private String source;
+
/**
+ * Get the value of source.
+ * @return value of source.
+ */
+ public String getSource() {
+ return source;
+ }
+
+ /**
+ * Set the value of source.
+ * @param v Value to assign to source.
+ */
+ public void setSource(String v) {
+ this.source = v;
+ }
+
+ /**
* Create a nested <src ...> element for multiple source path
* support.
*
@@ -436,6 +455,14 @@
this.fork = fork;
}
+ /**
+ * Is this a forked invocation of JDK's javac?
+ */
+ public boolean isForkedJavac() {
+ return fork ||
+ "extJavac".equals(project.getProperty("build.compiler"));
+ }
+
/**
* Sets whether the -nowarn option should be used.
1.24 +7 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
Index: SQLExec.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SQLExec.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -w -u -r1.23 -r1.24
--- SQLExec.java 2001/09/19 12:06:11 1.23
+++ SQLExec.java 2001/09/30 13:21:53 1.24
@@ -512,8 +512,13 @@
project.getProperties());
if (line.startsWith("//")) continue;
if (line.startsWith("--")) continue;
- if (line.length() > 2 &&
- line.substring(0,3).equalsIgnoreCase("REM")) continue;
+ StringTokenizer st = new StringTokenizer(line);
+ if (st.hasMoreTokens()) {
+ String token = st.nextToken();
+ if ("REM".equalsIgnoreCase(token)) {
+ continue;
+ }
+ }
sql += " " + line;
sql = sql.trim();
1.9 +460 -433
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
Index: DefaultCompilerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- DefaultCompilerAdapter.java 2001/08/30 13:26:37 1.8
+++ DefaultCompilerAdapter.java 2001/09/30 13:21:54 1.9
@@ -216,12 +216,22 @@
boolean usingJava1_1 =
Project.getJavaVersion().equals(Project.JAVA_1_1);
String memoryParameterPrefix = usingJava1_1 ? "-J-" : "-J-X";
if (memoryInitialSize != null) {
+ if (!attributes.isForkedJavac()) {
+ attributes.log("Since fork is false, ignoring
memoryInitialSize setting.",
+ Project.MSG_WARN);
+ } else {
cmd.createArgument().setValue(memoryParameterPrefix+"ms"+memoryInitialSize);
}
+ }
if (memoryMaximumSize != null) {
+ if (!attributes.isForkedJavac()) {
+ attributes.log("Since fork is false, ignoring
memoryMaximumSize setting.",
+ Project.MSG_WARN);
+ } else {
cmd.createArgument().setValue(memoryParameterPrefix+"mx"+memoryMaximumSize);
}
+ }
if (attributes.getNowarn()) {
cmd.createArgument().setValue("-nowarn");
@@ -307,6 +317,23 @@
* Does the command line argument processing common to classic and
* modern and adds the files to compile as well.
*/
+ protected Commandline setupModernJavacCommand() {
+ Commandline cmd = new Commandline();
+ setupJavacCommandlineSwitches(cmd);
+
+ if (attributes.getSource() != null) {
+ cmd.createArgument().setValue("-source");
+ cmd.createArgument().setValue(attributes.getSource());
+ }
+
+ logAndAddFilesToCompile(cmd);
+ return cmd;
+ }
+
+ /**
+ * Does the command line argument processing common to classic and
+ * modern and adds the files to compile as well.
+ */
protected Commandline setupJavacCommand() {
Commandline cmd = new Commandline();
setupJavacCommandlineSwitches(cmd);
1.4 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java
Index: Javac13.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/Javac13.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- Javac13.java 2001/07/22 13:12:29 1.3
+++ Javac13.java 2001/09/30 13:21:54 1.4
@@ -81,7 +81,7 @@
public boolean execute() throws BuildException {
attributes.log("Using modern compiler", Project.MSG_VERBOSE);
- Commandline cmd = setupJavacCommand();
+ Commandline cmd = setupModernJavacCommand();
// Use reflection to be able to build on all JDKs >= 1.1:
try {
1.7 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java
Index: Cab.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/Cab.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- Cab.java 2001/01/03 14:18:35 1.6
+++ Cab.java 2001/09/30 13:21:54 1.7
@@ -200,7 +200,7 @@
if (cmdOptions != null)
{
- command.createArgument().setValue(cmdOptions);
+ command.createArgument().setLine(cmdOptions);
}
command.createArgument().setValue("n");
1.11 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java
Index: Depend.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -u -r1.10 -r1.11
--- Depend.java 2001/09/13 08:33:45 1.10
+++ Depend.java 2001/09/30 13:21:54 1.11
@@ -257,7 +257,7 @@
classFileInfoMap = new Hashtable();
boolean cacheDirty = false;
- Hashtable dependencyMap = null;
+ Hashtable dependencyMap = new Hashtable();
File depCacheFile = null;
boolean depCacheFileExists = true;
long depCacheFileLastModified = Long.MAX_VALUE;
1.9 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
Index: FTP.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -u -r1.8 -r1.9
--- FTP.java 2001/08/30 13:26:37 1.8
+++ FTP.java 2001/09/30 13:21:54 1.9
@@ -806,12 +806,12 @@
}
if( ! ftp.makeDirectory( dir ) ) {
- // Both codes 550 and 553 can be produced by FTP Servers
+ // codes 521, 550 and 553 can be produced by FTP Servers
// to indicate that an attempt to create a directory has
// failed because the directory already exists.
int rc = ftp.getReplyCode();
- if( rc != 550 && rc != 553 && !ignoreNoncriticalErrors) {
+ if( !(ignoreNoncriticalErrors && (rc == 550 || rc == 553 ||
rc==521))) {
throw new BuildException( "could not create directory: " +
ftp.getReplyString() );
}
1.2 +299 -299
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
Index: CovReport.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -u -r1.1 -r1.2
--- CovReport.java 2001/07/31 08:40:12 1.1
+++ CovReport.java 2001/09/30 13:21:54 1.2
@@ -338,7 +338,7 @@
protected ReportFilters filters;
public Path createClasspath(){
if (classPath == null) {
- classPath = new Path(project);
+ classPath = new Path(CovReport.this.project);
}
return classPath.createPath();
}
1.18 +14 -0
jakarta-ant/src/main/org/apache/tools/ant/types/FileSet.java
Index: FileSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/FileSet.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -u -r1.17 -r1.18
--- FileSet.java 2001/08/01 09:08:55 1.17
+++ FileSet.java 2001/09/30 13:21:54 1.18
@@ -72,6 +72,7 @@
* @author Sam Ruby <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
* @author Jon S. Stevens <a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Magesh Umasankar</a>
*/
public class FileSet extends DataType {
@@ -80,6 +81,7 @@
private File dir;
private boolean useDefaultExcludes = true;
+ private boolean isCaseSensitive = true;
public FileSet() {
super();
@@ -90,6 +92,7 @@
this.defaultPatterns = fileset.defaultPatterns;
this.additionalPatterns = fileset.additionalPatterns;
this.useDefaultExcludes = fileset.useDefaultExcludes;
+ this.isCaseSensitive = fileset.isCaseSensitive;
}
@@ -245,6 +248,16 @@
}
/**
+ * Sets case sensitivity of the file system
+ *
+ * @param isCaseSensitive "true"|"on"|"yes" if file system is case
+ * sensitive, "false"|"off"|"no" when not.
+ */
+ public void setCaseSensitive(boolean isCaseSensitive) {
+ this.isCaseSensitive = isCaseSensitive;
+ }
+
+ /**
* Returns the directory scanner needed to access the files to process.
*/
public DirectoryScanner getDirectoryScanner(Project p) {
@@ -287,6 +300,7 @@
ds.setIncludes(defaultPatterns.getIncludePatterns(p));
ds.setExcludes(defaultPatterns.getExcludePatterns(p));
if (useDefaultExcludes) ds.addDefaultExcludes();
+ ds.setCaseSensitive(isCaseSensitive);
}
/**
1.4 +2 -2
jakarta-ant/src/main/org/apache/tools/ant/types/FilterSet.java
Index: FilterSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/FilterSet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -u -r1.3 -r1.4
--- FilterSet.java 2001/08/18 14:59:40 1.3
+++ FilterSet.java 2001/09/30 13:21:54 1.4
@@ -72,7 +72,7 @@
/**
* A set of filters to be applied to something.
*
- * A filter set may have starttoken and endtokens defined.
+ * A filter set may have begintoken and endtokens defined.
*
* @author <A href="mailto:[EMAIL PROTECTED]"> Michael McCallum </A>
* @created 14 March 2001
@@ -324,7 +324,7 @@
/**
* Does replacement on the given string with token matching.
- * This uses the defined starttoken and endtoken values which default to
@ for both.
+ * This uses the defined begintoken and endtoken values which default to
@ for both.
*
* @param line The line to process the tokens in.
* @return The string with the tokens replaced.
1.3 +1 -1
jakarta-ant/src/main/org/apache/tools/ant/types/FilterSetCollection.java
Index: FilterSetCollection.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/FilterSetCollection.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -u -r1.2 -r1.3
--- FilterSetCollection.java 2001/08/18 14:59:40 1.2
+++ FilterSetCollection.java 2001/09/30 13:21:54 1.3
@@ -93,7 +93,7 @@
/**
* Does replacement on the given string with token matching.
- * This uses the defined starttoken and endtoken values which default to
@ for both.
+ * This uses the defined begintoken and endtoken values which default to
@ for both.
*
* @param line The line to process the tokens in.
* @return The string with the tokens replaced.
1.6 +5 -2
jakarta-ant/src/main/org/apache/tools/ant/util/SourceFileScanner.java
Index: SourceFileScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/SourceFileScanner.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -u -r1.5 -r1.6
--- SourceFileScanner.java 2000/11/29 14:42:49 1.5
+++ SourceFileScanner.java 2001/09/30 13:21:54 1.6
@@ -74,11 +74,14 @@
protected Task task;
+ private FileUtils fileUtils;
+
/**
* @param task The task we should log messages through
*/
public SourceFileScanner(Task task) {
this.task = task;
+ fileUtils = FileUtils.newFileUtils();
}
/**
@@ -118,7 +121,7 @@
continue;
}
- File src = new File(srcDir, files[i]);
+ File src = fileUtils.resolveFile(srcDir, files[i]);
if (src.lastModified() > now) {
task.log("Warning: "+files[i]+" modified in the future.",
Project.MSG_WARN);
@@ -131,7 +134,7 @@
if (destDir == null) {
dest = new File(targets[j]);
} else {
- dest = new File(destDir, targets[j]);
+ dest = fileUtils.resolveFile(destDir, targets[j]);
}
if (!dest.exists()) {