ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ray Tayek <rta...@attbi.com>
Subject Re: local build file with ant
Date Sun, 23 Mar 2003 03:25:20 GMT
At 01:17 PM 3/22/03 -0600, you wrote:
>... just to give some insigth, I've seen the following organizations that 
>may help
>you in your choice:
>
>1. JBOSS project for instance uses a buildmagic approach with one top 
>build.xml ...
>2. XDOCLET project until recently had one top build.xml to perform the 
>recursive builds ...
>... I think they're talking of merging all their jar files into one, ...
>
>approach 2 is still widespread a lot in corportate environment  ...
>then having a build master launching global builds so that during SW 
>integration
>phase the whole application can be tested ...

thanks, i can check these out ;)


>You can have a look at the following thread that gave me interesting 
>inputs that
>drove me for the final ANT setup of my project:
>http://archives.apache.org/eyebrowse/ReadMsg?listName=user@ant.apache.org&msgId=630807

interesting thread. googling on convert makefile to ant is getting some 
results/


>The conclustion I comes up with (hope that will help ;-) is that you have to
>find a middle point trying to get to the ANT philosophy with our own project
>organization, i.e. find the ANT ways to keep this Makefile approach if u 
>have to
>- otherwise get rid of it, and stick to a global build.xml for all packages in
>the project - must it be buildmagic, recursive ant calls or proprietary 
>custos.

i have no existing structure, this is for my own benefit and preparation 
for an class on ant, netbeans and junit that i may teach this fall. just 
trying to find right middle ground as you say.


>I also got the remark when asking quite the same question to think about 
>the IDE
>setup ...

that is *very* important. you need to be able to use an ide or run ant from 
the command line. the sample i posted at http://tayek.com/~ray/localBuild/ 
works with netbeans except for the fact that the env stuff does not work in 
netbeans, but that can be put in a properties file.

thanks

>Ray Tayek wrote:
>
> > hi, i''ve been trying to come up with a build file that lives in the
> > package that it builds (imho, this seems like the appropriate place for it
> > to hang out - but this is contrary to most of the examples i have seen).
> >
> > so i came up with the following build script (see below). ...
> >
> > it seems like you would want to have one of these in most packages that
> > were deliverable (say as a jar) or required some extra (non-unit) testing.
> >
> > has anyone else fooled around with this idea?
> >
> > i am wondering how to build on something like this when the build script is
> > at a higher level and wants to build all of the stuff below it. ...
> >
> > i am concerned that the includes and excludes for the javac will work ok as
> > there may be a *lot* of stuff in the tree. i zipped up a simple example at
> > http://tayek.com/~ray/localBuild/ that works on windoze and linux just in
> > case anyone is interested in fooling around with it.
> >
> > does anyone have any ideas about this sort of thing? ...
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <project basedir="." default="all" name="localBuildProject">
> >          <property name="app.name" value="localBuildApp"/>
> >          <property name="src.path" value="../../../.."/> <!-- ugly, but
it
> > only occurs once -->
> >          <property environment="env"/>
> >          <property name="ant.home" value="${env.ANT_HOME}"/>
> >          <!-- this does not work in netbeans -->
> >          <target name="init">
> >                  <echo>ant.home=${ant.home}</echo>
> >          </target>
> >          <target name="clean" depends="init" description="Clean all build
> > products.">
> >                  <delete dir="classes"/>
> >          </target>
> >          <target name="compile" depends="init">
> >                  <mkdir dir="classes"/>
> >                  <javac srcdir="${src.path}" destdir="classes" debug="true"
> > deprecation="true">
> >                          <include name="com/tayek/foo/bar/**/*.java"/>
> >                          <exclude name="com/tayek/foo/bar/**/*Test.java"/>
> >                  </javac>
> >          </target>
> >          <target name="compileTests" depends="compile">
> >                  <mkdir dir="classes"/>
> >                  <javac srcdir="${src.path}" destdir="classes" debug="true"
> > deprecation="true">
> >                          <include name="com/tayek/foo/bar/**/*Test.java"/>
> >                          <!-- **/*Test.java - does not work! -->
> >                          <!--<exclude name="com/tayek/foo/bar/**/*.java"/>
> > how do i exclude the normal java files? -->
> >                          <classpath>
> >                                  <pathelement 
> location="d:/java/junit.jar"/>
> >                          </classpath>
> >                  </javac>
> >          </target>
> >          <target name="test" depends="compileTests" description="run the
> > tests.">
> >                  <junit fork="yes" printsummary="on" haltonfailure="true">
> >                          <classpath>
> >                                  <pathelement path="classes"/>
> >                                  <pathelement
> > location="${ant.home}/lib/junit.jar"/>
> >                          </classpath>
> >                          <formatter type="brief" usefile="false"/>
> >                          <batchtest fork="yes" todir="classes">
> >                                  <fileset dir="${src.path}">
> >                                          <include name="**/*Test.java"/>
> >                                          <exclude name="**/AllTests.java"/>
> >                                  </fileset>
> >                          </batchtest>
> >                  </junit>
> >          </target>
> >          <target name="all" depends="test" description="Build everything
> > and run the tests.">
> >      </target>
> > </project>

---
ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work
vice chair orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/


Mime
View raw message