简体   繁体   中英

Runtime path reference in ANT based on OS bitness

I have a requirement to define a run time path reference in ANT to point JAR location based on OS bitness (if the machine is 32/64 bit) .

  <path id="jdev.lib">
    <pathelement location="${mw.home}/dbclient${os.bitness}/sqldeveloper/jdev/lib/jdev-rt.jar"/>
  </path>

The problem is ${os.bitness} is identified by a target which will be executed only after path is initialized.

I tried to set the target which identifies bitness as default property and also as dependency to the main target,but no help. Also tried setting `conditional' property!!

I was looking for a way to get this value intialize before path is executed.

Thanks in advance.

Achieved what I want by including path reference inside my target..

<target name="run"    description="xxx" >
      <junit printsummary="yes" haltonfailure="no" showoutput="yes">
        <classpath>
                <path id="jdv.runtime">
                    <pathelement location="${mw.home}/dbclient${os.bitness}/sqldeveloper/jdev/lib/jdev-rt.jar"/>
                </path>
        </classpath>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM