ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Optional excludesfile in javac?
Date Tue, 17 Jul 2001 05:55:52 GMT
On Mon, 16 Jul 2001, Mark Womack <mwomack@bevocal.com> wrote:

>                <patternset excludesfile="${build.local_excludes}"
>                            if="build.local_excludes"/>
> 
> The above chunk does not cause a parse exception,

It should, hmm.

> but it ignores the if attribute

That's the way patternsets work, maybe we really need the if attribute
on the patternset level as well?  Not sure.

With a recent nightly build, you could do something like

<target name="check">
  <available property="optional-excludes"
             file="${build.local_excludes}" />
</target>

<target name="add-optional-excludes" if="optional-excludes"
        depends="check" />
  <patternset excludesfile="${build.local_excludes}" id="optional" />
</target>

<target name="dont-add-optional-excludes" unless="optional-excludes"
        depends="check" />
  <patternset id="optional" />
</target>

<target name="compile" 
        depends="add-optional-excludes,dont-add-optional-excludes">
  <javac ...>
    <patternset refid="optional" />
  </javac>
</target>

but this looks like a silly hack.

Maybe we should simply add file attributes to <include> and <exclude>
and deprecate the includesfile/excludesfile attributes of <patternset>
in favor of them?  Looks like the cleanest solution to me.

Stefan

Mime
View raw message