Re: Building project from the command line

From: Kaelin Colclasure (kaeli..cm.org)
Date: Fri Apr 16 2004 - 11:38:02 EDT

  • Next message: Charles-Edouard Ruault: "Re: Building project from the command line"

    On Apr 16, 2004, at 4:43 AM, <Pierre.Bernar..cl.lu> wrote:

    > Hi!
    >  
    > I have created a set of scripts and Ant tasks to compile from the
    > command line. The basic idea is to have a first script which defines
    > the WOProject tasks and then calls the build scripts of each project
    > to compile.
    >  
    > The full setup checks the projects out of CVS, compiles them using a
    > javac task, calls the build scripts to do split installs, notes the
    > currently installed configuration into a file commited back into
    > cvs,....
    >  
    > I could make this available for download if there is interest. Though
    > this is used in production, it will most likely require changes to be
    > adapted to other environments as project specifics or deployment
    > workflows vary.

    I'd certainly be interested in having a look. One of my co-workers is
    investigating automating our deployments using Ant, and it would
    certainly be nice to have a process that included the final build
    steps.

    -- Kaelin

    >  Pierre.
    > -----Original Message-----
    > From: Ulrich Köster [mailto:ulric..bjectstyle.org]
    > Sent: Thursday, April 15, 2004 1:15 PM
    > To: Woproject <woproject-de..bjectstyle.org>
    > Subject: Re: Building project from the command line
    >
    >
    >
    >
    > Am 14.04.2004 um 10:25 schrieb Charles-Edouard Ruault:
    >
    >
    > Hi Ulrich,
    > thanks for your answer
    >
    >
    > On Apr 13, 2004, at 7:23 PM, Ulrich Köster wrote:
    >
    >
    > Hi Charles,
    >
    >
    >
    > Am 09.04.2004 um 09:59 schrieb Charles-Edouard Ruault:
    >
    >
    > Hi all,
    >
    >
    > i'm using eclipse/Wolips to develop WebObject apps and frameworks ,
    > everything is ok ( aside a few glitches here and there ... ).
    >
    >
    > Please report them:
    > http://objectstyle.org/jira/
    > will do !
    >
    >
    > Now i would like to build scripts to automate the build of our
    > application ( consisting of a few Frameworks and Apps ).
    > In order to minimize the work i would like to reuse the build.xml
    > scripts produced by WOLips. Unfortunately they don't include the
    > taskdefs and wocompile blocks needed to build from the command line.
    >
    >
    > http://objectstyle.org/jira/secure/ViewIssue.jspa?key=WOL-40
    > Looks like things are going in the right direction here.
    >
    >
    > To assure that a future release includes the ability to build from
    > the command line you should add your comment to jira.
    >
    >
    >
    >
    >
    >
    >
    >
    > For example, to be able to build one Framework from the command line
    > i had to add :
    > <taskdef name="woframework"
    > classname="org.objectstyle.woproject.ant.WOFramework"></taskdef>
    >
    > <taskdef name="wocompile"
    > classname="org.objectstyle.woproject.ant.WOCompile"></taskdef>
    > and then within the <target name="build.woframework"> tag :
    > <wocompile srcdir="." destdir="${classes.dir}">
    > <frameworks root="${wo.root}/Library/Frameworks">
    > <include name="JavaWebObjects.framework"/>
    > <include name="JavaFoundation.framework"/>
    > <include name="JavaXML.framework"/>
    > <include name="JavaWOExtensions.framework"/>
    > <include name="JavaEOAccess.framework"/>
    > <include name="JavaEOControl.framework"/>
    > </frameworks>
    > <frameworks root="${wo.localroot}/Library/Frameworks">
    > </frameworks>
    > <classpath>
    > <fileset dir="${wo.localroot}">
    > <include name="/Library/WebObjects/Extensions/log4j-1.2.4.jar" />
    > </fileset>
    > </classpath>
    > </wocompile>
    >
    >
    >
    > WOLips creates some patternset files for an application. With this
    > files it's very easy to compile from the command line. WOLips
    > automatically updates these files on classpath modification. We could
    > enable this feature also for frameworks.
    >
    >
    > <taskdef name="wocompile"
    > classname="org.objectstyle.woproject.ant.WOCompile"></taskdef>
    >
    > <wocompile srcdir="src" destdir="foo">
    > <frameworks root="${wo.wosystemroot}">
    > <patternset>
    > <includesfile name="ant.frameworks.wo.wosystemroot"/>
    > </patternset>
    > </frameworks>
    > <frameworks root="${wo.wolocalroot}">
    > <patternset>
    > <includesfile name="ant.frameworks.wo.wolocalroot"/>
    > </patternset>
    > </frameworks>
    > <frameworks root="${user.home}">
    > <patternset>
    > <includesfile name="ant.frameworks.user.home"/>
    > </patternset>
    > </frameworks>
    > <classpath>
    > <fileset dir=".">
    > <include name="lib/log4j-1.2.4.jar" />
    > </fileset>
    > </classpath>
    > </wocompile>
    >
    >
    >
    >
    >
    >
    > That's very similar to what i've done. I've created a shell script
    > that takes the WOLips generated build.xml file and add the wocompile
    > task.
    > It takes the ant.frameworks* and ant.classpath* to generate the
    > correct <frameworks> and <classpath> entries.
    > It works fine for both Frameworks and Apps.
    > Once the new Eclipse/WOLips are released i'll rework it to take your
    > changes into account.
    >
    >
    >
    >
    >
    >
    > All the Frameworks and classpath components defined here are
    > extracted from the .classpath file . This makes it quite a heavy
    > process :(
    > On top of it, it breaks compilation from within Eclipse. Wich forces
    > to have to build files per project ( maintenance nightmare ).
    > I was wondering what would be a clean way to make it work
    > automatically.
    > Is there a way to generate a "command line compatible" build file
    > from within eclipse/WOLips ? It this feature planned ?
    > Otherwise i was thinking of building a shell script to extract all
    > the missing params from the .classpath and automatically build a
    > command line compatible build.xml file from the WOLips version ....
    > Any other suggestion is welcome !
    > Let me know what you think !
    >
    >
    > We should enable the generation of the ant.* files for frameworks
    > plus some additions to the build.xml.
    > I don't follow you here. For me ( WOLips 1.0.7.50 , eclipse 2.1.3 )
    > the ant.* files are generated also for Frameworks. Am i missing
    > something ?
    >
    >
    > Sorry, my fault. The WOFramework wizard does not generate these
    > files. Anyway they get generated on a classpath change.
    >
    >
    >
    > Ulrich
    >
    >
    > **********************************************************************
    > This email and any files transmitted with it are intended solely for
    > the use of the individual or entity to whom they are addressed.
    > If you have received this email in error please notify the sender
    > of this message. (Pierre.Bernar..cl.lu)
    > This email message has been checked for the presence of computer
    > viruses; however this protection does not ensure this message is
    > virus free.
    > Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
    > **********************************************************************
    >





    This archive was generated by hypermail 2.0.0 : Fri Apr 16 2004 - 11:38:16 EDT