ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sundberg Jukka <Jukka.Sundb...@aldata.fi>
Subject compiler feature
Date Thu, 13 Dec 2001 12:26:47 GMT
Running a following target causes ant to create two instances of the java
class:

	<!--
============================================================================
= -->
	<!-- for testing
-->
	<!-- USAGE: BUILD test -Dname=my.package.Test -Darg1=120
-Darg2=huhuu etc -->
	<!--
============================================================================
= -->
	<target name="test">
		<java classname="${name}">
			<arg value="${arg1}"/> 
			<arg value="${arg2}"/> 
			<arg value="${arg3}"/> 
			<arg value="${arg4}"/> 
			<arg value="${arg5}"/> 
			<arg value="${arg6}"/> 
			<arg value="${arg7}"/> 
			<arg value="${arg8}"/> 
			<classpath refid="my.classpath"/>
		</java>
	</target>

In here BUILD is .bat file with a following call:

         call ant %1 %2 %3 %4 %5 %6 %7 %8 %9 -buildfile c:/myBuild/build.xml

Here is the my.package.Test class:

package my.package;
public class Test{
	public Test(){
      	System.out.println("Should be here only once");
	}
	public void testing(){
		System.out.println("Testing, testing");
	}
    	public static void main(String[] args){
		Test ts = new Test();
		ts.testing();	
	}
}

And surprise here is the result:
	Should be here only once
	Should be here only once
	Testing, testing

I didn't find any fix in nightly builds, and I didn't find it in bugdb. Has
anyone encountered this feature? How do I get aroung it?

Thanks,

Jukka Sundberg






--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message