You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Tim Williams <wi...@gmail.com> on 2010/06/05 23:05:04 UTC

Re: svn commit: r951719 - /forrest/trunk/plugins/build.xml

On Sat, Jun 5, 2010 at 9:56 AM,  <cr...@apache.org> wrote:
> Author: crossley
> Date: Sat Jun  5 13:56:23 2010
> New Revision: 951719
>
> URL: http://svn.apache.org/viewvc?rev=951719&view=rev
> Log:
> Better detection of "java_exists".
> Issue: FOR-1137
>
> Modified:
>    forrest/trunk/plugins/build.xml
>
> Modified: forrest/trunk/plugins/build.xml
> URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/build.xml?rev=951719&r1=951718&r2=951719&view=diff
> ==============================================================================
> --- forrest/trunk/plugins/build.xml (original)
> +++ forrest/trunk/plugins/build.xml Sat Jun  5 13:56:23 2010
> @@ -87,7 +87,8 @@
>       <fileset dir="${plugin.lib.dir}" includes="*.jar"/>
>       <fileset dir="${plugin.lib.dir}" includes="*.zip"/>
>     </path>
> -    <available file="${plugin.java.dir}" property="java_exists" type="dir"/>
> +    <fileset dir="${plugin.java.dir}" id="java_present" includes="**/*.java"/>
> +    <pathconvert property="java_exists" refid="java_present" setonempty="false"/>
>   </target>
>   <target name="echo-init" depends="init-build-compiler" unless="no.echo.init">
>     <buildnumber file="${build.dir}/build.number"/>

I'm pretty sure this is causing our ails at the moment.  I don't have
time to figure out what it's all about and update it properly, should
we revert for now?

--tim

RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml

Posted by "Gav..." <ga...@16degrees.com.au>.

> -----Original Message-----
> From: Gav... [mailto:gavin@16degrees.com.au]
> Sent: Sunday, 6 June 2010 9:36 AM
> To: dev@forrest.apache.org
> Subject: RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml
> 
> 
> 
> > -----Original Message-----
> > From: Tim Williams [mailto:williamstw@gmail.com]
> > Sent: Sunday, 6 June 2010 9:00 AM
> > To: dev@forrest.apache.org
> > Subject: Re: svn commit: r951719 - /forrest/trunk/plugins/build.xml
> >
> > On Sat, Jun 5, 2010 at 6:42 PM, Gav... <ga...@16degrees.com.au>
> wrote:
> 
> 
> <snip>
> 
> > >
> > > So, going back to the original form and altering it slightly:
> > >
> > > <available file="${plugin.java.dir}/**/*.java"
> > property="java_exists"/>
> > >
> > > seems to work fine, though I haven't seen wildcards in any
> examples,
> > I'm
> > > assuming this will work and set the property accordingly.
> >
> > Thanks Gav, you gonna commit this one or you want me to do it?
> >
> > --tim
> 
> Well, I've done it now.
> 
> However it won't have the desired effect David was after.
> 
> It will set the property "java_exists" to either true or false, that
> parts
> works, however just by setting the property at all is enough for later
> targets to use if="java_exists" to always be true (i.e. the property
> does
> exist, doesn't matter if it's true or not.
> 
> Ant 1.8 cures this by checking whether true or false.
> There is a workaround I've done before elsewhere, which means setting a
> variable
> in an extra target and having the other targets depend on the variable.
> 
> I won't apply that though, but try and find where I've done that before
> and
> post
> it here for review first. David may have been on the right path also as
> that
> at
> least will not set the property at all. Will look closer.
> 

Ok, I found where I've done it before.

See: https://issues.apache.org/jira/browse/FOR-1055

It is the same circumstances, see commit r774176 in
/forrest/trunk/main/forrest.build.xml
That will certainly do what we want, something like:

<available file="${plugin.java.dir}/**/*.java" property="java_exists"/>
...
<target name="java-exists-condition" if="java_exists">
  <property name="java_exists.istrue" value="${java_exists}"/>
    <condition property="java_exists.true">
      <istrue value="${java_exists.istrue}"/>
    </condition>
</target>
...
<target name="compile" depends="init, java-exists-condition"
if="java_exists.true">
...
<target name="jar" depends="init, compile, java-exists-condition"
if="java_exists.true">
...

Will work, but I won't apply, other comments and other avenues to fix
welcome.

Gav...




Re: svn commit: r951719 - /forrest/trunk/plugins/build.xml

Posted by David Crossley <cr...@apache.org>.
I have spent too much time. Tried other suggestions too. thanks.

See https://issues.apache.org/jira/browse/FOR-1137
Re-opened.

There are more important things to do.

-David

Re: svn commit: r951719 - /forrest/trunk/plugins/build.xml

Posted by David Crossley <cr...@apache.org>.
Gav... wrote:
> <snip>
> > > So, going back to the original form and altering it slightly:
> > >
> > > <available file="${plugin.java.dir}/**/*.java"
> > property="java_exists"/>
> > >
> > > seems to work fine, though I haven't seen wildcards in any examples,
> > I'm
> > > assuming this will work and set the property accordingly.
> > 
> > Thanks Gav, you gonna commit this one or you want me to do it?
> 
> Well, I've done it now.

Eeek sorry. I had tested the build with various plugins,
but forgot to do the general "build test".

> However it won't have the desired effect David was after.
> 
> It will set the property "java_exists" to either true or false, that parts
> works, however just by setting the property at all is enough for later
> targets to use if="java_exists" to always be true (i.e. the property does
> exist, doesn't matter if it's true or not.
> 
> Ant 1.8 cures this by checking whether true or false.

Prior to each release we have upgraded our key supporting
tools. Good to do that early.

> There is a workaround I've done before elsewhere, which means setting a
> variable
> in an extra target and having the other targets depend on the variable.
> 
> I won't apply that though, but try and find where I've done that before and
> post
> it here for review first. David may have been on the right path also as that
> at
> least will not set the property at all. Will look closer.

Thanks, i had done a lot of research and thought that i was
onto the solution. Obviously not quite.

-David

RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml

Posted by "Gav..." <ga...@16degrees.com.au>.

> -----Original Message-----
> From: Tim Williams [mailto:williamstw@gmail.com]
> Sent: Sunday, 6 June 2010 9:00 AM
> To: dev@forrest.apache.org
> Subject: Re: svn commit: r951719 - /forrest/trunk/plugins/build.xml
> 
> On Sat, Jun 5, 2010 at 6:42 PM, Gav... <ga...@16degrees.com.au> wrote:


<snip>

> >
> > So, going back to the original form and altering it slightly:
> >
> > <available file="${plugin.java.dir}/**/*.java"
> property="java_exists"/>
> >
> > seems to work fine, though I haven't seen wildcards in any examples,
> I'm
> > assuming this will work and set the property accordingly.
> 
> Thanks Gav, you gonna commit this one or you want me to do it?
> 
> --tim

Well, I've done it now.

However it won't have the desired effect David was after.

It will set the property "java_exists" to either true or false, that parts
works, however just by setting the property at all is enough for later
targets to use if="java_exists" to always be true (i.e. the property does
exist, doesn't matter if it's true or not.

Ant 1.8 cures this by checking whether true or false.
There is a workaround I've done before elsewhere, which means setting a
variable
in an extra target and having the other targets depend on the variable.

I won't apply that though, but try and find where I've done that before and
post
it here for review first. David may have been on the right path also as that
at
least will not set the property at all. Will look closer.

Gav...




Re: svn commit: r951719 - /forrest/trunk/plugins/build.xml

Posted by Tim Williams <wi...@gmail.com>.
On Sat, Jun 5, 2010 at 6:42 PM, Gav... <ga...@16degrees.com.au> wrote:
>
>
>> -----Original Message-----
>> From: Gav... [mailto:gavin@16degrees.com.au]
>> Sent: Sunday, 6 June 2010 8:29 AM
>> To: dev@forrest.apache.org
>> Subject: RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml
>>
>>
>>
>> > -----Original Message-----
>> > From: Gav... [mailto:gavin@16degrees.com.au]
>> > Sent: Sunday, 6 June 2010 8:17 AM
>> > To: dev@forrest.apache.org
>> > Subject: RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml
>> >
>> >
>> >
>> > > -----Original Message-----
>> > > From: Tim Williams [mailto:williamstw@gmail.com]
>> > > Sent: Sunday, 6 June 2010 7:05 AM
>> > > To: Forrest Developers List
>> > > Subject: Re: svn commit: r951719 - /forrest/trunk/plugins/build.xml
>> > >
>> > > On Sat, Jun 5, 2010 at 9:56 AM,  <cr...@apache.org> wrote:
>> > > > Author: crossley
>> > > > Date: Sat Jun  5 13:56:23 2010
>> > > > New Revision: 951719
>> > > >
>> > > > URL: http://svn.apache.org/viewvc?rev=951719&view=rev
>> > > > Log:
>> > > > Better detection of "java_exists".
>> > > > Issue: FOR-1137
>> > > >
>> > > > Modified:
>> > > >    forrest/trunk/plugins/build.xml
>> > > >
>> > > > Modified: forrest/trunk/plugins/build.xml
>> > > > URL:
>> > >
>> >
>> http://svn.apache.org/viewvc/forrest/trunk/plugins/build.xml?rev=951719
>> > > &r1=951718&r2=951719&view=diff
>> > > >
>> > >
>> >
>> =======================================================================
>> > > =======
>> > > > --- forrest/trunk/plugins/build.xml (original)
>> > > > +++ forrest/trunk/plugins/build.xml Sat Jun  5 13:56:23 2010
>> > > > @@ -87,7 +87,8 @@
>> > > >       <fileset dir="${plugin.lib.dir}" includes="*.jar"/>
>> > > >       <fileset dir="${plugin.lib.dir}" includes="*.zip"/>
>> > > >     </path>
>> > > > -    <available file="${plugin.java.dir}" property="java_exists"
>> > > type="dir"/>
>> > > > +    <fileset dir="${plugin.java.dir}" id="java_present"
>> > > includes="**/*.java"/>
>> > > > +    <pathconvert property="java_exists" refid="java_present"
>> > > setonempty="false"/>
>> > > >   </target>
>> > > >   <target name="echo-init" depends="init-build-compiler"
>> > > unless="no.echo.init">
>> > > >     <buildnumber file="${build.dir}/build.number"/>
>> > >
>> > > I'm pretty sure this is causing our ails at the moment.  I don't
>> have
>> > > time to figure out what it's all about and update it properly,
>> should
>> > > we revert for now?
>> >
>> > From what I can tell it should be something like:
>> >
>> > <fileset dir="${plugin.java.dir}" id="java_present">
>> >   <include name ="**/*.java"/>
>> > </fileset>
>> >
>> > (the includes= seems to include a dir rather than a set of files)
>> >
>> > I'll test it shortly.
>>
>> I was wrong there, either should be acceptable and makes no difference
>> to
>> the output.
>
> So, going back to the original form and altering it slightly:
>
> <available file="${plugin.java.dir}/**/*.java" property="java_exists"/>
>
> seems to work fine, though I haven’t seen wildcards in any examples, I'm
> assuming this will work and set the property accordingly.

Thanks Gav, you gonna commit this one or you want me to do it?

--tim

RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml

Posted by "Gav..." <ga...@16degrees.com.au>.

> -----Original Message-----
> From: Gav... [mailto:gavin@16degrees.com.au]
> Sent: Sunday, 6 June 2010 8:29 AM
> To: dev@forrest.apache.org
> Subject: RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml
> 
> 
> 
> > -----Original Message-----
> > From: Gav... [mailto:gavin@16degrees.com.au]
> > Sent: Sunday, 6 June 2010 8:17 AM
> > To: dev@forrest.apache.org
> > Subject: RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml
> >
> >
> >
> > > -----Original Message-----
> > > From: Tim Williams [mailto:williamstw@gmail.com]
> > > Sent: Sunday, 6 June 2010 7:05 AM
> > > To: Forrest Developers List
> > > Subject: Re: svn commit: r951719 - /forrest/trunk/plugins/build.xml
> > >
> > > On Sat, Jun 5, 2010 at 9:56 AM,  <cr...@apache.org> wrote:
> > > > Author: crossley
> > > > Date: Sat Jun  5 13:56:23 2010
> > > > New Revision: 951719
> > > >
> > > > URL: http://svn.apache.org/viewvc?rev=951719&view=rev
> > > > Log:
> > > > Better detection of "java_exists".
> > > > Issue: FOR-1137
> > > >
> > > > Modified:
> > > >    forrest/trunk/plugins/build.xml
> > > >
> > > > Modified: forrest/trunk/plugins/build.xml
> > > > URL:
> > >
> >
> http://svn.apache.org/viewvc/forrest/trunk/plugins/build.xml?rev=951719
> > > &r1=951718&r2=951719&view=diff
> > > >
> > >
> >
> =======================================================================
> > > =======
> > > > --- forrest/trunk/plugins/build.xml (original)
> > > > +++ forrest/trunk/plugins/build.xml Sat Jun  5 13:56:23 2010
> > > > @@ -87,7 +87,8 @@
> > > >       <fileset dir="${plugin.lib.dir}" includes="*.jar"/>
> > > >       <fileset dir="${plugin.lib.dir}" includes="*.zip"/>
> > > >     </path>
> > > > -    <available file="${plugin.java.dir}" property="java_exists"
> > > type="dir"/>
> > > > +    <fileset dir="${plugin.java.dir}" id="java_present"
> > > includes="**/*.java"/>
> > > > +    <pathconvert property="java_exists" refid="java_present"
> > > setonempty="false"/>
> > > >   </target>
> > > >   <target name="echo-init" depends="init-build-compiler"
> > > unless="no.echo.init">
> > > >     <buildnumber file="${build.dir}/build.number"/>
> > >
> > > I'm pretty sure this is causing our ails at the moment.  I don't
> have
> > > time to figure out what it's all about and update it properly,
> should
> > > we revert for now?
> >
> > From what I can tell it should be something like:
> >
> > <fileset dir="${plugin.java.dir}" id="java_present">
> >   <include name ="**/*.java"/>
> > </fileset>
> >
> > (the includes= seems to include a dir rather than a set of files)
> >
> > I'll test it shortly.
> 
> I was wrong there, either should be acceptable and makes no difference
> to
> the output.

So, going back to the original form and altering it slightly:

<available file="${plugin.java.dir}/**/*.java" property="java_exists"/>

seems to work fine, though I haven’t seen wildcards in any examples, I'm
assuming this will work and set the property accordingly.

Gav...

> 
> 
> >
> > Gav...
> >
> >
> >
> >
> > >
> > > --tim
> >
> 
> 




RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml

Posted by "Gav..." <ga...@16degrees.com.au>.

> -----Original Message-----
> From: Gav... [mailto:gavin@16degrees.com.au]
> Sent: Sunday, 6 June 2010 8:17 AM
> To: dev@forrest.apache.org
> Subject: RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml
> 
> 
> 
> > -----Original Message-----
> > From: Tim Williams [mailto:williamstw@gmail.com]
> > Sent: Sunday, 6 June 2010 7:05 AM
> > To: Forrest Developers List
> > Subject: Re: svn commit: r951719 - /forrest/trunk/plugins/build.xml
> >
> > On Sat, Jun 5, 2010 at 9:56 AM,  <cr...@apache.org> wrote:
> > > Author: crossley
> > > Date: Sat Jun  5 13:56:23 2010
> > > New Revision: 951719
> > >
> > > URL: http://svn.apache.org/viewvc?rev=951719&view=rev
> > > Log:
> > > Better detection of "java_exists".
> > > Issue: FOR-1137
> > >
> > > Modified:
> > >    forrest/trunk/plugins/build.xml
> > >
> > > Modified: forrest/trunk/plugins/build.xml
> > > URL:
> >
> http://svn.apache.org/viewvc/forrest/trunk/plugins/build.xml?rev=951719
> > &r1=951718&r2=951719&view=diff
> > >
> >
> =======================================================================
> > =======
> > > --- forrest/trunk/plugins/build.xml (original)
> > > +++ forrest/trunk/plugins/build.xml Sat Jun  5 13:56:23 2010
> > > @@ -87,7 +87,8 @@
> > >       <fileset dir="${plugin.lib.dir}" includes="*.jar"/>
> > >       <fileset dir="${plugin.lib.dir}" includes="*.zip"/>
> > >     </path>
> > > -    <available file="${plugin.java.dir}" property="java_exists"
> > type="dir"/>
> > > +    <fileset dir="${plugin.java.dir}" id="java_present"
> > includes="**/*.java"/>
> > > +    <pathconvert property="java_exists" refid="java_present"
> > setonempty="false"/>
> > >   </target>
> > >   <target name="echo-init" depends="init-build-compiler"
> > unless="no.echo.init">
> > >     <buildnumber file="${build.dir}/build.number"/>
> >
> > I'm pretty sure this is causing our ails at the moment.  I don't have
> > time to figure out what it's all about and update it properly, should
> > we revert for now?
> 
> From what I can tell it should be something like:
> 
> <fileset dir="${plugin.java.dir}" id="java_present">
>   <include name ="**/*.java"/>
> </fileset>
> 
> (the includes= seems to include a dir rather than a set of files)
> 
> I'll test it shortly.

I was wrong there, either should be acceptable and makes no difference to
the output.


> 
> Gav...
> 
> 
> 
> 
> >
> > --tim
> 




RE: svn commit: r951719 - /forrest/trunk/plugins/build.xml

Posted by "Gav..." <ga...@16degrees.com.au>.

> -----Original Message-----
> From: Tim Williams [mailto:williamstw@gmail.com]
> Sent: Sunday, 6 June 2010 7:05 AM
> To: Forrest Developers List
> Subject: Re: svn commit: r951719 - /forrest/trunk/plugins/build.xml
> 
> On Sat, Jun 5, 2010 at 9:56 AM,  <cr...@apache.org> wrote:
> > Author: crossley
> > Date: Sat Jun  5 13:56:23 2010
> > New Revision: 951719
> >
> > URL: http://svn.apache.org/viewvc?rev=951719&view=rev
> > Log:
> > Better detection of "java_exists".
> > Issue: FOR-1137
> >
> > Modified:
> >    forrest/trunk/plugins/build.xml
> >
> > Modified: forrest/trunk/plugins/build.xml
> > URL:
> http://svn.apache.org/viewvc/forrest/trunk/plugins/build.xml?rev=951719
> &r1=951718&r2=951719&view=diff
> >
> =======================================================================
> =======
> > --- forrest/trunk/plugins/build.xml (original)
> > +++ forrest/trunk/plugins/build.xml Sat Jun  5 13:56:23 2010
> > @@ -87,7 +87,8 @@
> >       <fileset dir="${plugin.lib.dir}" includes="*.jar"/>
> >       <fileset dir="${plugin.lib.dir}" includes="*.zip"/>
> >     </path>
> > -    <available file="${plugin.java.dir}" property="java_exists"
> type="dir"/>
> > +    <fileset dir="${plugin.java.dir}" id="java_present"
> includes="**/*.java"/>
> > +    <pathconvert property="java_exists" refid="java_present"
> setonempty="false"/>
> >   </target>
> >   <target name="echo-init" depends="init-build-compiler"
> unless="no.echo.init">
> >     <buildnumber file="${build.dir}/build.number"/>
> 
> I'm pretty sure this is causing our ails at the moment.  I don't have
> time to figure out what it's all about and update it properly, should
> we revert for now?

>From what I can tell it should be something like:

<fileset dir="${plugin.java.dir}" id="java_present">
  <include name ="**/*.java"/>
</fileset>

(the includes= seems to include a dir rather than a set of files)

I'll test it shortly.

Gav...




> 
> --tim