ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Svetlin Stanchev" <stanc...@360t.com>
Subject dynamically setting path id (name)
Date Fri, 08 Aug 2003 08:38:46 GMT
I suspect this has been discussed before, but could not find a direct
answer, so here I go:

I have an editable by anybody list of Java projects belonging to certain
project groups. Thus, I need to compile any or a group of them based on
the project name/group based on editable (JBuilder) library
configuration files.

In my compile target I have smth quite straightforward:
  <target name="compile" depends="init">
    <!-- checkout current lib config -->
    <ant dir="${mountpoint.projects}"
      antfile="extract-libpaths.xml"
      target="getProjectLibs">
    </ant>
    <!-- compile the source -->
    <javac 
      srcdir="${project.src.dir}" 
      destdir="${project.build.classes.dir}"
      debug="${project.build.debug}">
      <classpath refid="${project.name}.compile.classpath"/>
    </javac>
   </target>

In extract-libpaths.xml I have:

    <!-- create the compile path -->
    <property name="project-compile-classpath"
value="${project.name}.compile.classpath"/>
    <path id="project-compile-classpath">
      <pathelement path="${pathvalue}"/>
    </path>
    <echo>pathvalue: ${pathvalue}</echo>
    <echo>${project.name} compile classpath:
${project-compile-classpath}</echo>

pathvalue is properly set with after parsing the JBuilder lib config
file, however the property holding the path does not get set:
     [echo] pathvalue: <a_path_to_a_lib>;<another_path_to_a_lib>;...
     [echo] <my_project_name> compile classpath:
<my_project_name>.compile.classpath

So the compile target fails with:
BUILD FAILED
file:<my_build_filename>: Reference <my_project_name>.compile.classpath
not found.

I suspect <path id=/> does not allow references?
If so, how can I solve my problem?

Thankful for any advice,

-- 
Svetlin


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


Mime
View raw message