ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: dynamically assembled classpath
Date Fri, 18 Jan 2002 03:17:40 GMT
How about using if/unless clauses on <include>/<exclude>'s within a
<patternset>???

See: http://jakarta.apache.org/ant/manual/CoreTypes/patternset.html


----- Original Message -----
From: "Todd Chambery" <tchambery@hotmail.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Thursday, January 17, 2002 4:56 PM
Subject: dynamically assembled classpath


> Hey all,
>
> I'm trying to assemble a classpath based on whether or not a system is
> capable of compiling for WebLogic or WebSphere:
>
>  <target name  ="set.foo.classpath"
>    description ="sets the foo classpath">
>   <available file="${websphere.home}" type="dir"
> property="websphere.home.present"/>
>   <available file="${weblogic.home}" type="dir"
> property="weblogic.home.present"/>
>   <antcall target="set.foo.base.classpath"/>
>   <antcall target="set.foo.weblogic.classpath"/>
>   <antcall target="set.foo.websphere.classpath"/>
>   <path id="ecore.classpath">
>    <path refid="ecore.base.classpath"/>
>    <path refid="ecore.was.classpath"/>
>    <path refid="ecore.wl.classpath"/>
>   </path>
>  </target>
>  <target name  ="set.foo.base.classpath"
>    description ="set the foo base classpath">
>   <path id="foo.base.classpath">
>         <!-- some path stuff -->
>   </path>
>  </target>
>  <target name  ="set.foo.websphere.classpath"
>    if   ="websphere.home.present">
>       <path id="foo.was.classpath">
>         <!-- websphere classpath assembly -->
>       </path>
>  </target>
>  <target name  ="set.foo.weblogic.classpath"
>    if   ="weblogic.home.present">
>   <path id="foo.wl.classpath">
>         <!-- weblogic classpath assembly -->
>   </path>
>  </target>
>
> but this don't work:
>
> S:\FOO>ant init
> Buildfile: build.xml
> set.foo.classpath:
> set.foo.base.classpath:
> set.foo.weblogic.classpath:
> set.foo.websphere.classpath:
> BUILD FAILED
> Reference foo.base.classpath not found.
>
> Is there a way to make this work, or a better way I'm not thinking of?
>
> Thanks,
>
> Todd
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message