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



 


                
                
                
                
                

 

 

 

Reply via email to