ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Poulter, Toby" <tpoul...@kpmg.co.nz>
Subject RE: Problem using srcfile element with apply task
Date Thu, 23 Aug 2001 23:19:47 GMT
Stefan,

Thanks for the comments.

I am also getting the NPE.  Apologies for not mentioning that earlier.

And I have tried using the file you provided and after doing the
replacement, the bootstrap and retrying the build the result is pretty much
the same, as shown below.

The build.xml is:

<apply executable="C:\Program Files\Microsoft Visual Studio\VB98\vb6.exe"
parallel="false">
	<arg value="/m" />
	<srcfile />
	<fileset dir="c:\temp\buildname\test\src\Registry">
		<patternset>
			<include name="*.vbp" />
		</patternset>
	</fileset>
	<arg value="/out" />
	<arg value="c:\temp\buildname\errors.txt" />
	<arg value="/outdir" />
	<arg value="c:\temp\buildname\test\bin" />
</apply>

The output (full this time) is:

D:\>ant -buildfile c:\ant\test\test3.xml main -verbose
Ant version 1.4Beta2 compiled on August 20 2001
Buildfile: c:\ant\test\test3.xml
Detected Java version: 1.3 in: c:\jdk1.3.1\jre
Detected OS: Windows 2000
parsing buildfile c:\ant\test\test3.xml with URI =
file:c:/ant/test/test3.xml
Project base dir set to: C:\ant
 [property] Override ignored for ant.home
Build sequence for target `main' is [main]
Complete build sequence is [main]

main:
    [apply] Current OS is Windows 2000
    [apply] "C:\Program Files\Microsoft Visual Studio\VB98\vb6.exe" /m /out
c:\t
emp\buildname\errors.txt /outdir c:\temp\buildname\test\bin

BUILD FAILED

java.lang.NullPointerException
        at
org.apache.tools.ant.types.Commandline.quoteArgument(Commandline.java
:273)
        at
org.apache.tools.ant.types.Commandline.toString(Commandline.java:296)

        at
org.apache.tools.ant.taskdefs.ExecuteOn.runExec(ExecuteOn.java:224)
        at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:177)
        at org.apache.tools.ant.Task.perform(Task.java:217)
        at org.apache.tools.ant.Target.execute(Target.java:164)
        at org.apache.tools.ant.Target.performTasks(Target.java:182)
        at org.apache.tools.ant.Project.executeTarget(Project.java:601)
        at org.apache.tools.ant.Project.executeTargets(Project.java:560)
        at org.apache.tools.ant.Main.runBuild(Main.java:454)
        at org.apache.tools.ant.Main.start(Main.java:153)
        at org.apache.tools.ant.Main.main(Main.java:176)

Total time: 0 seconds

Please let me know if you have any further thoughts.

Thanks,

Toby.

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Wednesday, 22 August 2001 6:31 p.m.
To: ant-user@jakarta.apache.org
Subject: Re: Problem using srcfile element with apply task

Toby,

On Wed, 22 Aug 2001, Toby Poulter <tpoulter@kpmg.co.nz> wrote:

> I am having problems using a nested <srcfile /> element in an apply
> task like this:

What you are trying to do is how it is supposed to work, nothing wrong
on your side.  I don't have a Windows box around, so I've run the
following test on Linux:

<project default="apply">
  <target name="apply">
    <apply executable="echo" parallel="false">
      <arg value="1" />
      <fileset dir="." includes="*.xml" />
      <srcfile />
      <arg value="2" />
    </apply>
  </target>
</project>

and it works as expected:

bodewig@bodewig ~/jakarta/jakarta-ant >ant -f /tmp/apply.xml 
Buildfile: /tmp/apply.xml

apply:
    [apply] 1 /tmp/apply.xml 2
    [apply] 1 /tmp/meins.xml 2
    [apply] 1 /tmp/deldummy.xml 2

BUILD SUCCESSFUL

Total time: 2 seconds

*after* I fixed ExecuteOn to not lose the arguments after the
<srcfile/>.  Before my commit of a few minutes ago, the example above
would die with a NullPointerException.  So I'm more than a little bit
puzzled by your result, you should have gotten the NPE as well.

Could you please pick up the source release of 1.4beta2, replace
ExecuteOn.java with this one
<http://cvs.apache.org/viewcvs/~checkout~/jakarta-ant/src/main/org/apache/to
ols/ant/taskdefs/ExecuteOn.java?rev=1.14.2.1&content-type=text/plain>,
bootstrap a new version of Ant with bootstrap.bat and rerun your build
file to see whether the problem persists?

Thanks

        Stefan


Disclaimer: 
The information in this electronic mail message is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this Internet electronic mail message by
anyone else is unauthorised.  
If you are not the intended recipient, any disclosure, copying, distribution or any action
taken or omitted to be taken in reliance on it is prohibited and may be unlawful.
When addressed to our clients any opinions or advice contained in this Internet electronic
mail message are subject to the terms and conditions expressed in the governing KPMG client
engagement letter.

KPMG accepts no responsibility for any effects this email message or attachments has on the
recipient network or computer system.

Mime
View raw message