Re: Weird Compile Error

From: Chuck Hill (chil..lobal-village.net)
Date: Wed Jul 11 2007 - 16:45:16 EDT

  • Next message: Andrew Lindesay: "Re: Zip the dist"

    Grrrr. Grrr.

    The build files supplied with a new project are broken / crap /
    (your adjective here).

    I have sent some suggested changes to Mike for review, but if you
    want to preview these changes, here is what to do:

    (A) Add this to the end of setProps (and actually do on of the three
    things it says, no really, you have to):

    --------------------
                <!-- woproject.jar needs to be available to Ant for these
    definitions to work. Here are three ways to do this:
                     1. Copy it into the Ant library (/Developer/Java/Ant/lib/
    on OS X)
            
                     2. Specify it on the command line each time you run Ant,
    for example:
                     ant -lib /Developer/Applications/eclipse/plugins/
    org.objectstyle.wolips.woproject.ant_2.0.0.4058/lib/ compile
            
                     3. Define the path to woproject.jar in one of your
    properties files like this:
                     woproject.path=/Developer/Applications/eclipse/plugins/
    org.objectstyle.wolips.woproject.ant_2.0.0.4058/lib/woproject.jar
                     and add it to the taskdef and typedef like this
                     <taskdef name="wocompile"
                              classname="org.objectstyle.woproject.ant.WOCompile"
                              classpath="${woproject.path}" />
                     <typedef name="wopath"
                                    classname="org.objectstyle.woproject.ant.WOPath"
                                    classpath="${woproject.path}" />
                -->
                <taskdef name="wocompile"
    classname="org.objectstyle.woproject.ant.WOCompile"/>
                <typedef name="wopath"
    classname="org.objectstyle.woproject.ant.WOPath" />
                <taskdef name="woframework"
    classname="org.objectstyle.woproject.ant.WOFramework"/>
                <taskdef name="woapplication"
    classname="org.objectstyle.woproject.ant.WOApplication"/>
    -------------

    (B) Remove taskdef task from framework and application tasks.

    (C) Change the compile task to:

       <target name = "compile" depends = "setProps,init.build" >
         <mkdir dir = "bin"/>

         <!-- Non-source Classpath for project-->
         <wopath id="project.classpath">
           <path>
              <!-- Define webobjects.extensions=/Library/WebObjects/
    Extenstions in wobuild.properties
                   if you want those jars included. -->
              <fileset dir="${webobjects.extensions}" />
           </path>

           <frameworks root="${wo.wosystemroot}">
             <patternset>
               <includesfile name="woproject/
    ant.frameworks.wo.wosystemroot"/>
             </patternset>
           </frameworks>
           <frameworks root="${wo.wolocalroot}">
             <patternset>
               <includesfile name="woproject/
    ant.frameworks.wo.wolocalroot"/>
             </patternset>
           </frameworks>
           <frameworks root="${user.home}">
             <patternset>
               <includesfile name="woproject/ant.frameworks.user.home"/>
             </patternset>
           </frameworks>
         </wopath>

           <wocompile srcdir="src"
                                 destdir="bin">
               <classpath refid="project.classpath"/>
             </wocompile>
       </target>

    Profit.

    Example attached.




    Chuck

    On Jul 11, 2007, at 1:37 PM, Jonathan Miller wrote:

    > Hi,
    >
    > Does anyone have a solution to this?
    >
    > Steps to reproduce
    >
    > Right click build.xml in the Package Explorer.
    > Choose option WOLips Ant Tools -> Install
    >
    > Expected Result - Compile WO application and put it in /Library/
    > WebObjects/Applications
    >
    > Real Result:
    >
    > Buildfile: /Users/ijohnny/Projects/workspace/MOLContentManager/
    > build.xml
    > setProps:
    > init.install:
    > init.build:
    > compile:
    > [javac] Compiling 7 source files to /Users/ijohnny/Projects/
    > workspace/MOLContentManager/bin
    >
    > BUILD FAILED
    > /Users/ijohnny/Projects/workspace/MOLContentManager/build.xml:221:
    > IO error scanning directory /.Spotlight-V100
    >
    > Total time: 600 milliseconds
    >
    >
    > Compiling on OS X 10.4.10, Eclipse 3.2.2 WOLIPS
    >
    > Thanks in advance
    >
    > Jon
    >
    > p.s. wobuild.properties
    >
    > #This file stores the wo specific properties
    > #Thu Jun 14 16:51:05 HST 2007
    > wo.dir.root=/
    > wo.woroot=/System
    > wo.dir.user.home.library.frameworks=/Users/ijohnny/Library/Frameworks
    > wo.dir.local=/
    > wo.wosystemroot=/System
    > wo.dir.library=/System/Library
    > wo.dir.user.home.library=/Users/ijohnny/Library
    > wo.dir.local.library=/Library
    > wo.dir.library.frameworks=/System/Library/Frameworks
    > wo.dir.local.library.frameworks=/Library/Frameworks
    > wo.wolocalroot=/
    > wo.dir.system=/System
    > wo.dir.reference.api=/Developer/ADC%20Reference%20Library/
    > documentation/WebObjects/Reference/API/
    >
    >

    -- 
    

    Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects



    This archive was generated by hypermail 2.0.0 : Wed Jul 11 2007 - 16:46:12 EDT