ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor Bucutea" <victor.bucu...@softspot.ro>
Subject set Path element id
Date Sun, 11 Jan 2009 08:46:47 GMT
Hi ,

 

 

I'm developing a custom Task in which i wish to dynamically create a <path>
. My code is :

 

public void execute() throws BuildException {

 

            if (stringElemente == null || separator == null ) {

                  throw new BuildException(

                             "Nu ai completat toti parametrii :
stringElemente , separator ");

            }

 

            StringTokenizer st = new StringTokenizer(stringElemente,
separator);

            

            

            

            Path dynamicClassPath = new Path(getProject());

            

 

            while (st.hasMoreTokens()) {

                  String token = st.nextToken();

                  // Creem un nou path pentru fiecare token si il adaugam la
classPath

                  log("Adding to classpath resource: "+token);

                  PathElement path = dynamicClassPath.createPathElement();

                  path.setLocation(new File(token));

            }

 

            

            //dynamicClassPath.setRefid(new
Reference(getProject(),"dynamic.classpath"));

            

            

      }

 

I'm trying to dynamically create a classpath (e.g. Path element ) for later
use. 

 

The problem is that I cannot set an id ( same as <path
id="compile.classpath"/> ) , which i will later use to reference that path !


 

 

 

Thanks,

	

Victor   BucuĹŁea 
Programmer



 


		
		
		
		
		

 

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message