ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: help calling import of prop file to set globals
Date Mon, 13 Sep 2004 05:50:46 GMT
1st: use Ant 1.6 (otherwise the next wouldnt work)
2nd: before your <path> statemtent provide a static task:
    <project ...>
        <sequential taskname="init">
            <!-- init the whole stuff -->   
            <condition ...>
            ...
        </sequential>
        <path ...>
        ...
    </project>


or as second possibility dont use the <condition>s:
    <project ...>
        <property file="${os.name}.properties"/>
        <property file="default.properties"/>
        <path ...>
    </project>
with a "Linux.properties" containing
    platform=linux
and a "Mac OS X.properties" containing
    platform=macosx
and a "default.properties" containing
    platzform=something-else
...



Jan

 

> -----Urspr√ľngliche Nachricht-----
> Von: William I. Zumwalt [mailto:wizumwalt@yahoo.com]
> Gesendet am: Sonntag, 12. September 2004 05:19
> An: user@ant.apache.org
> Betreff: help calling import of prop file to set globals
> 
> Hey all,
> 
> How would I go about the following ... I have a
> classpath I'm trying to set that uses a property from
> a properties file as shown in my init-platform target,
> but because it hasn't been set yet (i.e. havn't yet
> called my init-platform target) ... it of course is
> not found. I'd like to somehow call this target so
> that I could then set my global properties (I'm
> calling them global but, these would be the props I'm
> setting that are not in a target).
> 
> Any ideas?
> 
> --- build.xml ---
> 
> <project name="Code Construct" default="main-build"
> basedir=".">
>    ...
>    <path id="classpath.jboss.lib">
> 
> 	<!-- my PROBLEM, jboss.lib not yet set from prop file
> -->
> 
>         <fileset dir="${jboss.lib}">
>             <include name="**/*.jar"/>
>         </fileset>
>         <pathelement
> location="${jboss.server}/jboss-jdbc_ext.jar"/>
>         <pathelement
> location="${jboss.client}/jmx-rmi-connector-client.jar"/>
>     </path>
> 
>     ...
>     <target name="init-platform">
>         <condition property="platform" value="linux">
>             <equals arg1="${os.name}" arg2="Linux" />
>         </condition>
>             
>         <condition property="platform" value="macosx">
>             <equals arg1="${os.name}" arg2="Mac OS X"
> />
>         </condition>
>             
>         <echo message="Using ${platform}.properties"
> />
>         <property file="etc/${platform}.properties" />
>     </target>
> 
> --- 
> init-platform target would source in these properties
> from my ~/etc/linux.properties file ---
> 
> jboss.server=/opt/jboss-3.2.4/server
> jboss.lib=/opt/jboss-3.2.4/server/default/lib
> jboss.client=/opt/jboss-3.2.4/client
> jboss.deploy=/opt/jboss-3.2.4/server/default/deploy
> ~
> 
> 
> 
> 		
> _______________________________
> Do you Yahoo!?
> Shop for Back-to-School deals on Yahoo! Shopping.
> http://shopping.yahoo.com/backtoschool
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message