ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Engin Erdem <enginer...@yahoo.com>
Subject why doesn't work on ant 1.6.1
Date Wed, 15 Dec 2004 08:49:39 GMT
we have a piece of code that uses ant api and a build
file to control our build  process. this code works on
ant 1.4.1 version but not in 1.6.1 version, I searched
mailing lists but I did'nt find any suggestions.
what is the problem???
you can test them with the code and build file below
---------------------------------------------
//build.xml
<project name="testProject" default="main">
    <path id="myBuilder.path">
        <pathelement path="d:/temp/antbuilderv2.jar"/>
    </path>

    <taskdef name="ref2V2"
classname="antbuilderv2.AntBuilder">
        <classpath>
            <path refid="myBuilder.path"/>
        </classpath>
    </taskdef>

    <target name="main">
        <ref2V2/>
    </target>
    <target name="parameterTest">
        <echo>gelen parametre ${param1}</echo>
    </target>
</project>
-------------------------------------------------
//AntBuilder.java
package antbuilderv2;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.CallTarget;
import org.apache.tools.ant.taskdefs.Property;
public class AntBuilder extends Task {

    private Project project;

    public void execute() throws BuildException {
        project = getProject();
        Task task1 =
(CallTarget)createAntCallTask("test1");
        Task task2 =
(CallTarget)createAntCallTask("test2");
        task1.init();
        task1.execute();
        task2.init();
        task2.execute();
    }

    private Task createAntCallTask(String paramValue)
{
        CallTarget callTarget = new CallTarget();
        callTarget.setProject(project);
        callTarget.setTarget("parameterTest");
        Property parameter = callTarget.createParam();
        parameter.setName("param1");
        parameter.setValue(paramValue);
        return callTarget;
    }
}





		
__________________________________ 
Do you Yahoo!? 
Jazz up your holiday email with celebrity designs. Learn more. 
http://celebrity.mail.yahoo.com

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


Mime
View raw message