ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40742] New: - Tag "isset" does not recognise property set with argument "-D"
Date Thu, 12 Oct 2006 15:21:19 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40742>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40742

           Summary: Tag "isset" does not recognise property set with
                    argument "-D"
           Product: Ant
           Version: 1.7.0Beta2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Build Process
        AssignedTo: dev@ant.apache.org
        ReportedBy: opyate@gmail.com
                CC: opyate@gmail.com


Tag "isset" does not recognise property set with argument "-D"

When running Ant, on the command line I would like to specify a property:

> ant -Dtest.class.name=class.to.be.Tested

Then, in the build file I would like to test if this property has been set,
otherwise default to something else:

<?xml version="1.0" encoding="UTF-8"?>
<project default="default-task-name" basedir="." name="project-name">

<condition property="testClassSpecified">
 <isset property="test.class.name"/>
</condition>
<if>
 <equals arg1="testClassSpecified" arg2="true" />
  <then>
   <echo message="Test class specified." />
  </then>
  <else>
   <echo message="Test class not specified. Setting it to default Suite..." />
    <property name="test.class.name" value="some.default.Suite"/>
   </else>
</if>

<!-- tasks follow... -->
</project>

Maybe I'm doing something wrong, but Ant does not seem to pick up the argument,
and the condition always fails (i.e. "test.class.name" always defaults to
"some.default.Suite", and the rest of the tasks then execute perfectly with this
value.)


Other tools used with Ant:
* ant-contrib-1.0b2 (of which the JAR is in %ANT_HOME%/lib
* JUnit4.1 (of which the JAR is in %ANT_HOME%/lib

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message