defineset and refid

Help
clem
2004-09-16
2004-09-16
  • clem
    clem
    2004-09-16

    While attempting to create a defineset that I'd planned to reference multiple times, I created a freestanding defineset such as the following:

    <defineset id="version.info">
    <define name="PRODUCT_VERSION" value="${product_version}"/>
    <define name="BUILD_NUMBER" value="${build.number}"/>
    <define name="PATCH_LEVEL" value="${patch.level}"/>
    </defineset>

    This is then referenced later on.  However, I'm getting the following error when building:

    Not an actual task, but looks like one for documentation purposes

    Is it possible to create a defineset outside a cc task?  It would be very handy if this were possible in the same way the defining a freestanding classpath or fileset is useful.

     
    • Curt Arnold
      Curt Arnold
      2004-09-16

      I added a request for enhancement:
      https://sourceforge.net/tracker/index.php?func=detail&aid=1028960&group_id=36177&atid=416923

      That will put it on my todo list, but I'm occupied at the moment trying to get another project out and won't be able to address it for two weeks at best and maybe much longer.

      I have to play some tricks to get Ant's automatic documentation to generate the documentation for defineset which was the reason for the message you saw.  defineset was never intended to be executed as a task, but was defined as a task to get the docs generated.

      The compiler elements were designed for reuse and referencing and extension and can contain definesets.  Maybe you can achieve what you were trying by using that mechanism.  For example,

      <compiler name="${compiler}" id="compile-with-version">
          <defineset.../>
      </compiler>

      <target>
         <cc>
            <compiler extends="compile-with-version">
                 <!-- add more stuff here  -->
            </compiler>
         </cc>
      </target>