[jboss-cvs] jboss-seam/seam-gen/build-scripts ...

Emmanuel Bernard emmanuel.bernard at jboss.com
Wed Apr 18 02:40:05 EDT 2007


  User: ebernard
  Date: 07/04/18 02:40:05

  Modified:    seam-gen/build-scripts  build-war.xml
  Log:
  JBSEAM-1199 Support for .groovy deployment in WEB-INF/dev Cannot be used to write EJB 3 Groovy session beans
  JBSEAM-1200 Support for Groovy in the seam-gen environment
  
  Revision  Changes    Path
  1.13      +73 -4     jboss-seam/seam-gen/build-scripts/build-war.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: build-war.xml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/seam-gen/build-scripts/build-war.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- build-war.xml	9 Apr 2007 18:35:53 -0000	1.12
  +++ build-war.xml	18 Apr 2007 06:40:05 -0000	1.13
  @@ -36,13 +36,51 @@
           <fileset refid="lib" />
       </path>
       
  +    <taskdef name ="groovyc"
  +        classname ="org.codehaus.groovy.ant.Groovyc"
  +        classpathref="build.classpath"/> <!-- really only the groovy jar is necessary -->
  +    <taskdef name="groovy"
  +        classname="org.codehaus.groovy.ant.Groovy"
  +        classpathref="build.classpath"/> <!-- really only the groovy jar is necessary -->
  +
  +
       <target name="init" description="Initialize the build">
           <mkdir dir="${classes.model.dir}" />
           <mkdir dir="${classes.action.dir}" />
           <mkdir dir="${dist.dir}" />
  +        <!-- if a .groovy file is in model or action, set groovy.present -->
  +        <groovy>
  +          File file = new File("${properties.basedir}/${properties.'src.action.dir'}")
  +          boolean isGroovy
  +          file.eachFileRecurse {
  +            //use an exception for short exit
  +            if ( it.name.endsWith('.groovy') ) isGroovy = true
  +          }
  +
  +          if (!isGroovy) {
  +            file = new File("${properties.basedir}/${properties.'src.model.dir'}")
  +            file.eachFileRecurse {
  +              //use an exception for short exit
  +              if ( it.name.endsWith('.groovy') ) isGroovy = true
  +            }
  +          }
  +          if (isGroovy) properties.'groovy.present' = true
  +        </groovy>
  +        <condition property="groovy.dynamic" value="true">
  +            <and>
  +                <isset property="groovy.present"/>
  +                <istrue value="${debug}"/>
  +            </and>
  +        </condition>
  +        <condition property="groovy.static" value="true">
  +            <and>
  +                <isset property="groovy.present"/>
  +                <isfalse value="${debug}"/>
  +            </and>
  +        </condition>
       </target>
       
  -    <target name="compilemodel" depends="init" 
  +    <target name="compilemodel" depends="init,groovy.compilemodel"
               description="Compile the Java source code"
               unless="eclipse.running">
           <javac classpathref="build.classpath" 
  @@ -54,7 +92,15 @@
           </javac>
       </target>
       
  -    <target name="compileactions" depends="init" 
  +    <target name="groovy.compilemodel" if="groovy.present">
  +        <!-- model is always compiled -->
  +        <groovyc classpathref="build.classpath"
  +               destdir="${classes.model.dir}"
  +               srcdir="${src.model.dir}" >
  +        </groovyc>
  +    </target>
  +    
  +    <target name="compileactions" depends="init,groovy.compileactions,groovy.copyactions"
               description="Compile the Java source code"
               unless="eclipse.running">
           <javac classpathref="build.classpath" 
  @@ -67,9 +113,30 @@
           </javac>
       </target>
       
  -    <target name="copyclasses" depends="init" 
  +    <target name="groovy.compileactions" if="groovy.static">
  +        <path id="groovy.action.classpath">
  +            <path refid="build.classpath"/>
  +            <dirset dir="${classes.model.dir}"/>
  +        </path>
  +        <groovyc classpathref="groovy.action.classpath"
  +               destdir="${classes.action.dir}"
  +               srcdir="${src.action.dir}" >
  +        </groovyc>
  +    </target>
  +
  +    <target name="groovy.copyactions" if="groovy.dynamic">
  +        <!-- copy the action groovy files into action if not compiled -->
  +        <copy todir="${classes.action.dir}">
  +            <fileset dir="${src.action.dir}">
  +                <include name="**/*.groovy"/>
  +            </fileset>
  +        </copy>
  +    </target>
  +    
  +    <target name="copyclasses" depends="init,groovy.copyactions"
               description="Copy the classes that were compiled by eclipse"
               if="eclipse.running">
  +        <!-- TODO check how the groovy eclipse plugin works, does it compile? -->
           <copy todir="${classes.model.dir}">
               <fileset dir="classes/model">
                   <include name="**/*.class"/>
  @@ -109,6 +176,7 @@
                   <include name="*.*"/>
                   <include name="classes/**/*.*"/>
                   <exclude name="classes/**/*.class"/>
  +                <exclude name="classes/**/*.groovy"/>
               </fileset>
               <filterset>
                   <filter token="debug"       value="${debug}" />
  @@ -137,6 +205,7 @@
                   <include name="antlr-*.jar"/>
                   <include name="commons-jci-*.jar"/>
                   <include name="stringtemplate-*.jar"/>
  +                <include name="groovy-*.jar" if="groovy.present"/>
               </fileset>
           </copy>
           
  
  
  



More information about the jboss-cvs-commits mailing list