You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2002/03/10 14:28:19 UTC

cvs commit: jakarta-cactus/anttasks/src/java/org/apache/cactus/ant RunServerTestsTask.java StartServerHelper.java StopServerHelper.java

vmassol     02/03/10 05:28:19

  Modified:    anttasks build.xml
               anttasks/src/java/org/apache/cactus/ant
                        RunServerTestsTask.java StartServerHelper.java
                        StopServerHelper.java
  Removed:     anttasks LICENSE
  Log:
  second part of build process refactoring
  
  Revision  Changes    Path
  1.10      +33 -82    jakarta-cactus/anttasks/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/anttasks/build.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- build.xml	9 Mar 2002 23:14:15 -0000	1.9
  +++ build.xml	10 Mar 2002 13:28:19 -0000	1.10
  @@ -18,13 +18,17 @@
   
       Run "ant -projecthelp" to get a list of available targets. The default
       target is "dist"
  +
  +    Note: basedir points to the main Cactus directory in order to have the same
  +          base dir for all Cactus subprojects and thus be able to share
  +          relative paths.
     =============================================================================
   -->
  -<project name="Cactus Ant custom tasks" default="dist" basedir=".">
  +<project name="Cactus Ant custom tasks" default="dist" basedir="..">
   
       <!-- Give user a chance to override without editing this file
            (and without typing -D each time it compiles it) -->
  -    <property file="build.properties" />
  +    <property file="anttasks/build.properties" />
       <property file="${user.home}/build.properties" />
   
       <!-- Global project properties -->
  @@ -48,14 +52,21 @@
   
       <!--
          ========================================================================
  +         Base directory for all file related operations
  +       ========================================================================
  +    -->
  +    <property name="base.dir" value="anttasks"/>
  +
  +    <!--
  +       ========================================================================
            Set the properties related to the source tree
          ========================================================================
       -->
       <!-- Source locations for the build -->
  -    <property name="src.dir" value="src"/>
  +    <property name="src.dir" value="${base.dir}/src"/>
       <property name="src.java.dir" value="${src.dir}/java"/>
  -    <property name="build.dir" value="."/>
  -    <property name="conf.dir" value="conf"/>
  +    <property name="build.dir" value="${base.dir}/."/>
  +    <property name="conf.dir" value="${base.dir}/conf"/>
   
       <!--
          ========================================================================
  @@ -63,7 +74,7 @@
          ========================================================================
       -->
       <!-- Destination locations for the build -->
  -    <property name="target.dir" value="target"/>
  +    <property name="target.dir" value="${base.dir}/target"/>
       <property name="target.classes.dir" value="${target.dir}/classes"/>
       <property name="target.classes.java.dir" value="${target.classes.dir}/java"/>
       <property name="target.conf.dir" value="${target.dir}/conf"/>
  @@ -72,14 +83,11 @@
   
       <!-- Distribution directory, i.e. where the expanded distibutable files
            are located -->
  -    <property name="dist.dir" value="dist"/>
  +    <property name="dist.dir" value="${base.dir}/dist"/>
       <property name="dist.lib.dir" value="${dist.dir}/lib"/>
       <property name="dist.doc.dir" value="${dist.dir}/doc"/>
       <property name="dist.doc.api.dir" value="${dist.doc.dir}/api"/>
   
  -    <!-- Release directory, i.e. where the zipped distribution is located -->
  -    <property name="release.dir" value="release"/>
  -
       <!--
          ========================================================================
           Names of deliverables
  @@ -91,12 +99,10 @@
   
       <!--
          ========================================================================
  -         Initialize the build. Must be called by all targets
  +         Display configurable properties values
          ========================================================================
       -->
  -    <target name="init">
  -
  -        <tstamp/>
  +    <target name="display.properties">
   
           <echo message="----- ${project.name.text} ${project.version} -----"/>
           <echo message=""/>
  @@ -107,10 +113,19 @@
           <echo message="ant.home = ${ant.home}"/>
           <echo message=""/>
   
  +    </target>
  +
  +    <!--
  +       ========================================================================
  +         Initialize the build. Must be called by all targets
  +       ========================================================================
  +    -->
  +    <target name="init" depends="display.properties">
  +
  +        <tstamp/>
  +
           <!-- Filters -->
           <filter token="version" value="${project.version}"/>
  -        <filter token="year" value="${year}"/>
  -        <filter token="today" value="${TODAY}"/>
           <filter token="project.name.text" value="${project.name.text}"/>
           <filter token="project.name.file" value="${project.name.file}"/>
   
  @@ -196,77 +211,13 @@
   
       <!--
          ========================================================================
  -         Common script for both "release" and "nightly" targets. Must only be
  -         called by "release" or "nightly" target as it needs the following
  -         properties defined before calling it :
  -
  -             anttasks.release.name
  -
  -       ========================================================================
  -    -->
  -    <target name="release.common" depends="clean,dist">
  -
  -        <mkdir dir="${release.dir}"/>
  -
  -        <zip destfile="${release.dir}/${anttasks.release.name}.zip">
  -            <fileset dir="${dist.dir}"/>
  -        </zip>
  -
  -    </target>
  -
  -    <!--
  -       ========================================================================
  -         Generate a full release (i.e. the zipped release file)
  -       ========================================================================
  -    -->
  -    <target name="release.prepare" depends="init">
  -
  -        <!-- For a release, the suffix is the version -->
  -        <property name="project.suffix" value="-${project.version}"/>
  -
  -        <!-- Name of full release -->
  -        <property name="anttasks.release.name"
  -            value="${project.prefix}${anttasks.jar.name}${project.suffix}"/>
  -
  -    </target>
  -
  -    <target name="release" depends="release.prepare,release.common"
  -        description="Generate a release">
  -    </target>
  -
  -    <!--
  -       ========================================================================
  -         Generate a nightly release (i.e. the zipped release file)
  -       ========================================================================
  -    -->
  -    <target name="nightly.prepare" depends="init">
  -
  -        <!-- Sets the date for the release prefix : YYYYMMDD -->
  -        <tstamp/>
  -
  -        <!-- Suffix to add to all distributable files -->
  -        <property name="project.suffix" value="-${DSTAMP}"/>
  -
  -        <!-- Name of nightly release -->
  -        <property name="anttasks.release.name"
  -            value="${project.prefix}${anttasks.jar.name}${project.suffix}"/>
  -
  -    </target>
  -
  -    <target name="nightly" depends="nightly.prepare,release.common"
  -        description="Generate a nightly release">
  -    </target>
  -
  -    <!--
  -       ========================================================================
            Clean generated files (including distributables)
          ========================================================================
       -->
  -    <target name="clean" depends="init" description="Clean all generated files">
  +    <target name="clean" description="Clean all generated files">
   
           <delete dir="${target.dir}"/>
           <delete dir="${dist.dir}"/>
  -        <delete dir="${release.dir}"/>
   
       </target>
   
  @@ -286,7 +237,7 @@
           <echo message="Errors are reported in ${target.dir}/checkstyle_errors.xml"/>
   
           <checkstyle paramPattern="^(the|is|has)[A-Z][a-zA-Z0-9]*$"
  -            allowProtected="true" headerFile="LICENSE">
  +            allowProtected="true" headerFile="LICENSE.cactus">
   
               <fileset dir="${src.java.dir}">
                   <include name="**/*.java"/>
  
  
  
  1.2       +2 -1      jakarta-cactus/anttasks/src/java/org/apache/cactus/ant/RunServerTestsTask.java
  
  Index: RunServerTestsTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/anttasks/src/java/org/apache/cactus/ant/RunServerTestsTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RunServerTestsTask.java	24 Feb 2002 23:49:05 -0000	1.1
  +++ RunServerTestsTask.java	10 Mar 2002 13:28:19 -0000	1.2
  @@ -85,7 +85,7 @@
    *
    * @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
    *
  - * @version $Id: RunServerTestsTask.java,v 1.1 2002/02/24 23:49:05 vmassol Exp $
  + * @version $Id: RunServerTestsTask.java,v 1.2 2002/03/10 13:28:19 vmassol Exp $
    */
   public class RunServerTestsTask extends Task
   {
  @@ -162,6 +162,7 @@
           callee.setOwningTarget(target);
           callee.setTaskName(getTaskName());
           callee.setLocation(location);
  +        callee.setInheritAll(true);
           callee.init();
           callee.setTarget(this.testTarget);
           callee.execute();
  
  
  
  1.3       +2 -1      jakarta-cactus/anttasks/src/java/org/apache/cactus/ant/StartServerHelper.java
  
  Index: StartServerHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/anttasks/src/java/org/apache/cactus/ant/StartServerHelper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StartServerHelper.java	28 Feb 2002 11:09:50 -0000	1.2
  +++ StartServerHelper.java	10 Mar 2002 13:28:19 -0000	1.3
  @@ -79,7 +79,7 @@
    *
    * @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
    *
  - * @version $Id: StartServerHelper.java,v 1.2 2002/02/28 11:09:50 vmassol Exp $
  + * @version $Id: StartServerHelper.java,v 1.3 2002/03/10 13:28:19 vmassol Exp $
    */
   public class StartServerHelper implements Runnable
   {
  @@ -254,6 +254,7 @@
           callee.setOwningTarget(this.task.getOwningTarget());
           callee.setTaskName(this.task.getTaskName());
           callee.setLocation(this.task.getLocation());
  +        callee.setInheritAll(true);
   
           callee.init();
   
  
  
  
  1.2       +2 -1      jakarta-cactus/anttasks/src/java/org/apache/cactus/ant/StopServerHelper.java
  
  Index: StopServerHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-cactus/anttasks/src/java/org/apache/cactus/ant/StopServerHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StopServerHelper.java	24 Feb 2002 23:49:05 -0000	1.1
  +++ StopServerHelper.java	10 Mar 2002 13:28:19 -0000	1.2
  @@ -73,7 +73,7 @@
    *
    * @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
    *
  - * @version $Id: StopServerHelper.java,v 1.1 2002/02/24 23:49:05 vmassol Exp $
  + * @version $Id: StopServerHelper.java,v 1.2 2002/03/10 13:28:19 vmassol Exp $
    */
   public class StopServerHelper implements Runnable
   {
  @@ -184,6 +184,7 @@
           callee.setOwningTarget(this.task.getOwningTarget());
           callee.setTaskName(this.task.getTaskName());
           callee.setLocation(this.task.getLocation());
  +        callee.setInheritAll(true);
   
           callee.init();
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-cactus/anttasks/src/java/org/apache/cactus/ant RunServerTestsTask.java StartServerHelper.java StopServerHelper.java

Posted by Erik Hatcher <li...@ehatchersolutions.com>.
----- Original Message -----
From: "Vincent Massol" <vm...@octo.com>
> * I cannot replace my base.dir by basedir as I need basedir to remain
> constant whereas base.dir changes for each subproject. I agree, I should
> call it differently (although I think Ant should prefix all its internal
> properties by "ant.", exactly for this reason).

I agree that Ant properties should be more clearly denoted.  One day I'll
have to have a more detailed look into your build to see how its crafted, so
I can understand your base.dir thing.

> * WRT "location" for <property> : The majority of my properties that
> relate to files are located in build.properties. Thus, I imagine they
> will be loaded by Ant in the same way as if I had used "value", right ?

Yes, correct.  But 'location' is a great thing to use for properties not
loaded by property file.  Having a build.properties by default is sort of
against the way it should be though (or at least against the majority of
Jakarta projects).  Properties should (IMHO) be set inside build.xml and
build.properties is used to override them in exceptional circumstances, but
is typically not needed.  I got into this a fair bit on lucene-dev and they
adopted something a bit different (Scarab's approach) - they have a
default.properties that the properties listed there, but that file should
not be touched - instead it should be copied and tweaked as
build.properties.

    Erik



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-cactus/anttasks/src/java/org/apache/cactus/ant RunServerTestsTask.java StartServerHelper.java StopServerHelper.java

Posted by Vincent Massol <vm...@octo.com>.
Thinking more about it :

* I cannot replace my base.dir by basedir as I need basedir to remain
constant whereas base.dir changes for each subproject. I agree, I should
call it differently (although I think Ant should prefix all its internal
properties by "ant.", exactly for this reason).

* WRT "location" for <property> : The majority of my properties that
relate to files are located in build.properties. Thus, I imagine they
will be loaded by Ant in the same way as if I had used "value", right ?

Thanks
-Vincent

> -----Original Message-----
> From: Erik Hatcher [mailto:lists@ehatchersolutions.com]
> Sent: 10 March 2002 19:17
> To: Cactus Developers List
> Subject: Re: cvs commit: jakarta-
> cactus/anttasks/src/java/org/apache/cactus/ant RunServerTestsTask.java
> StartServerHelper.java StopServerHelper.java
> 
> ----- Original Message -----
> From: <vm...@apache.org>
> > vmassol     02/03/10 05:28:19
> >
> >   Modified:    anttasks build.xml
> >                anttasks/src/java/org/apache/cactus/ant
> >                         RunServerTestsTask.java
StartServerHelper.java
> >                         StopServerHelper.java
> >   Removed:     anttasks LICENSE
> >   Log:
> >   second part of build process refactoring
> 
> While I'm at it, I'll make a suggestion or two below...
> 
> >
>
========================================================================
> >   +         Base directory for all file related operations
> >   +
>
========================================================================
> >   +    -->
> >   +    <property name="base.dir" value="anttasks"/>
> >   +
> 
> Ant already has a ${basedir} - seems confusing to make up your own for
> such
> purposes.  I don't quite know what all you're refactoring, I just
thought
> I'd mention the potential confusion I see.
> 
> But on a different point, how about using 'location' instead of
'value'
> for
> <property> when setting properties that refer to directories or files?
> The
> nice thing about that is that it resolves the property to be the
absolute
> path to the file/directory making it much more pleasant to send to
other
> build files that don't know the relative position and such.
> 
>     Erik
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-dev-
> help@jakarta.apache.org>
> 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-cactus/anttasks/src/java/org/apache/cactus/ant RunServerTestsTask.java StartServerHelper.java StopServerHelper.java

Posted by Vincent Massol <vm...@octo.com>.
Too bad ! I was hoping we could benefit from your Ant expertise to tell
us if we were on the right track with our build process or completely
off the mark ! :-)

Anyway, feel free to comment whenever you have some time.
Thanks
-Vincent

> -----Original Message-----
> From: Erik Hatcher [mailto:lists@ehatchersolutions.com]
> Sent: 10 March 2002 19:43
> To: Cactus Developers List
> Subject: Re: cvs commit: jakarta-
> cactus/anttasks/src/java/org/apache/cactus/ant RunServerTestsTask.java
> StartServerHelper.java StopServerHelper.java
> 
> ----- Original Message -----
> From: "Vincent Massol" <vm...@octo.com>
> 
> > I'm also very much interested in your feedback on the new build
process
> > (I sincerely hope it is not too much complicated and that I am doing
it
> > the right way as I have spent about 2 full days on it !).
> 
> Well, I'm not going to be running the Cactus build anytime soon, I
hope.
> I
> am currently relying on the HEAD version of far too many projects when
I'd
> ideally like to get back to being a mere "consumer" on them.  For
Cactus I
> plan on remaining just an end-user, unless I encounter problems that
> require
> me to dig in and patch.  Very soon I will have some small Cactus
testing
> to
> do, so you may hear from me soon!
> 
>     Erik
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-dev-
> help@jakarta.apache.org>
> 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-cactus/anttasks/src/java/org/apache/cactus/ant RunServerTestsTask.java StartServerHelper.java StopServerHelper.java

Posted by Erik Hatcher <li...@ehatchersolutions.com>.
----- Original Message -----
From: "Vincent Massol" <vm...@octo.com>

> I'm also very much interested in your feedback on the new build process
> (I sincerely hope it is not too much complicated and that I am doing it
> the right way as I have spent about 2 full days on it !).

Well, I'm not going to be running the Cactus build anytime soon, I hope.  I
am currently relying on the HEAD version of far too many projects when I'd
ideally like to get back to being a mere "consumer" on them.  For Cactus I
plan on remaining just an end-user, unless I encounter problems that require
me to dig in and patch.  Very soon I will have some small Cactus testing to
do, so you may hear from me soon!

    Erik



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit: jakarta-cactus/anttasks/src/java/org/apache/cactus/ant RunServerTestsTask.java StartServerHelper.java StopServerHelper.java

Posted by Vincent Massol <vm...@octo.com>.

> -----Original Message-----
> From: Erik Hatcher [mailto:lists@ehatchersolutions.com]
> Sent: 10 March 2002 19:17
> To: Cactus Developers List
> Subject: Re: cvs commit: jakarta-
> cactus/anttasks/src/java/org/apache/cactus/ant RunServerTestsTask.java
> StartServerHelper.java StopServerHelper.java
> 
> ----- Original Message -----
> From: <vm...@apache.org>
> > vmassol     02/03/10 05:28:19
> >
> >   Modified:    anttasks build.xml
> >                anttasks/src/java/org/apache/cactus/ant
> >                         RunServerTestsTask.java
StartServerHelper.java
> >                         StopServerHelper.java
> >   Removed:     anttasks LICENSE
> >   Log:
> >   second part of build process refactoring
> 
> While I'm at it, I'll make a suggestion or two below...

please continue ! :-)

> 
> >
>
========================================================================
> >   +         Base directory for all file related operations
> >   +
>
========================================================================
> >   +    -->
> >   +    <property name="base.dir" value="anttasks"/>
> >   +
> 
> Ant already has a ${basedir} - seems confusing to make up your own for
> such
> purposes.  I don't quite know what all you're refactoring, I just
thought
> I'd mention the potential confusion I see.

Hehe ... The thought occurred to me today ... I should change the name.
My base.dir points to the location of where the project to build is
located (and not the full path to where the build.xml basedir is). I
need this because I have higher level scripts calling subproject scripts
and I want everyone to have the same basedir so that I can pass relative
paths from the top level build.properties to subproject build.xml
scripts ...

I guess I could remove base.dir and use ${basedir} as a prefix to all
the subproject file paths. That would use one less property and avoid
the confusion. I'll put in my todo and will do it once I have finished
committing all the new stuff ...

> 
> But on a different point, how about using 'location' instead of
'value'
> for
> <property> when setting properties that refer to directories or files?
> The
> nice thing about that is that it resolves the property to be the
absolute
> path to the file/directory making it much more pleasant to send to
other
> build files that don't know the relative position and such.

Ahah. Good idea. I hadn't realized this. Will do that as soon as I have
finished the refactoring.

Thanks a lot,
Keep sending suggestion !

I'm also very much interested in your feedback on the new build process
(I sincerely hope it is not too much complicated and that I am doing it
the right way as I have spent about 2 full days on it !).

I should have finished committing stuff within 1 hour or so.
Thanks.

-Vincent
> 
>     Erik



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-cactus/anttasks/src/java/org/apache/cactus/ant RunServerTestsTask.java StartServerHelper.java StopServerHelper.java

Posted by Erik Hatcher <li...@ehatchersolutions.com>.
----- Original Message -----
From: <vm...@apache.org>
> vmassol     02/03/10 05:28:19
>
>   Modified:    anttasks build.xml
>                anttasks/src/java/org/apache/cactus/ant
>                         RunServerTestsTask.java StartServerHelper.java
>                         StopServerHelper.java
>   Removed:     anttasks LICENSE
>   Log:
>   second part of build process refactoring

While I'm at it, I'll make a suggestion or two below...

>
========================================================================
>   +         Base directory for all file related operations
>   +
========================================================================
>   +    -->
>   +    <property name="base.dir" value="anttasks"/>
>   +

Ant already has a ${basedir} - seems confusing to make up your own for such
purposes.  I don't quite know what all you're refactoring, I just thought
I'd mention the potential confusion I see.

But on a different point, how about using 'location' instead of 'value' for
<property> when setting properties that refer to directories or files?  The
nice thing about that is that it resolves the property to be the absolute
path to the file/directory making it much more pleasant to send to other
build files that don't know the relative position and such.

    Erik



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>