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 37694] New: - Calling ant via java does not set "basedir" property
Date Tue, 29 Nov 2005 16:10:52 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=37694>.
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=37694

           Summary: Calling ant via java does not set "basedir" property
           Product: Ant
           Version: 1.6.5
          Platform: PC
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: andreas.krueger@dv-ratio.com


I recently had reason to code something like this, in an ant build.xml file:

      <java
         classname="org.apache.tools.ant.launch.Launcher"
         fork="true"
         failonerror="true"
         dir="${sub.builddir}"
         timeout="4000000"
      >
         <classpath>
            <pathelement location="${env.ANT_HOME}/lib/ant-launcher.jar"/>
         </classpath>
         <arg value="-buildfile"/><arg file="${sub.buildfile}"/>
         <arg value="-Dthis=this"/>
         <arg value="-Dthat=that"/>
         <arg value="-Dthe.other=the.other"/>
         <arg value="${sub.target}"/>
      </java>

The code at first did not work.

My ant files have come to rely on the property "basedir". This was not set for
${sub.buildfile}. After I found that out, the fix was easy:

         <arg value="-Dbasedir=${sub.builddir}"/>

In my opinion, the property "basedir" should always be set by the launcher.

If that cannot be done for some reason, the second best solution is: The
circumstances when it is set and when not should be documented.

My suggestion:

apache-ant-1.6.5/docs/manual/running.html#viajava

-- 
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