You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2004/03/21 22:26:21 UTC

cvs commit: cocoon-lenya/src/targets ide-build.xml properties-build.xml

gregor      2004/03/21 13:26:21

  Modified:    .        build.properties.sample
               src/targets ide-build.xml properties-build.xml
  Added:       src/resources/dev/eclipse project classpath-tmpl.xml
                        make-classpath.xsl
  Log:
  the eclipse-project target is now able to create an eclipse project for lenya.
  
  some new properties in build.properties:
  
  cocoon.dir
  ide.eclipse.outputdir
  ide.eclipse.export.libs
  
  Revision  Changes    Path
  1.1                  cocoon-lenya/src/resources/dev/eclipse/project
  
  Index: project
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <projectDescription>
  	<name>cocoon-lenya</name>
  	<comment></comment>
  	<projects>
  		<project>cocoon-2.1</project>
  	</projects>
  	<buildSpec>
  		<buildCommand>
  			<name>org.eclipse.jdt.core.javabuilder</name>
  			<arguments>
  			</arguments>
  		</buildCommand>
  	</buildSpec>
  	<natures>
  		<nature>org.eclipse.jdt.core.javanature</nature>
  	</natures>
  </projectDescription>
  
  
  
  1.1                  cocoon-lenya/src/resources/dev/eclipse/classpath-tmpl.xml
  
  Index: classpath-tmpl.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <data>
    <src-dirs><item>@SRC_DIRS@</item></src-dirs>
    <libs><item>@LIBS@</item></libs>
    <output>@OUTPUT_DIR@</output>
  </data>
  
  
  1.1                  cocoon-lenya/src/resources/dev/eclipse/make-classpath.xsl
  
  Index: make-classpath.xsl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
    Copyright 1999-2004 The Apache Software Foundation
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->
  <!--
    Build the Eclipse .classpath file from a list of path items
    (see "eclipse-project" target in build.xml)
    
    $Id: make-classpath.xsl,v 1.1 2004/03/21 21:26:21 gregor Exp $
  -->
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:output indent="yes" method="xml"/>
    <xsl:param name="exportlib"/>
    
    <xsl:strip-space elements="*"/>
  
    <xsl:template match="/data">
      <classpath>
  
        <!-- 1. source dirs -->
        <xsl:for-each select="src-dirs/item">
          <!-- alphabetical sorting, complete path -->
          <xsl:sort select="."/>
          <classpathentry kind="src" path="{.}"/>
        </xsl:for-each>
            
        <!-- 2. libraries -->
        <xsl:for-each select="libs/item">
          <!-- alphabetical sorting, only file name -->
          <!-- heavy calculation, but here's the logic:
               1. returns the string after 4 slashes (4 is the max (blocks)),
                  returns empty string if string does not contain 4 slashes
               2. ... 3 slashes ...
               3. ... 2 slashes ... (the minimum) -->
          <xsl:sort select="concat(substring-after(substring-after(substring-after(substring-after(., '/'), '/'), '/'), '/'),
                                                   substring-after(substring-after(substring-after(., '/'), '/'), '/'),
                                                                   substring-after(substring-after(., '/'), '/'))"/>
          <classpathentry exported="{$exportlib}" kind="lib" path="{.}"/>
        </xsl:for-each>
  
        <!-- 3. JRE runtime -->
  	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
       
        <!-- 4. output directory
             Build in a separate dir since Eclipse is confused
             by classes compiled externally by Sun's Javac -->
        <classpathentry kind="output" path="{output}"/>
  
        <!-- 5. Dependance on Cocoon. There needs to be a cocoon-2.1 eclipse project -->
  	  <classpathentry kind="src" path="/cocoon-2.1"/>
  
      </classpath>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.38      +12 -4     cocoon-lenya/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/build.properties.sample,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- build.properties.sample	25 Feb 2004 11:06:43 -0000	1.37
  +++ build.properties.sample	21 Mar 2004 21:26:21 -0000	1.38
  @@ -1,13 +1,15 @@
  -# Properties controlling the build process
  +# Properties controlling the build process
   
   
   #------------------------------------------------------------------------------------
   # The original, unmodified and expanded cocoon webapp directory
   
  -cocoon.webapp.dir=../cocoon-2.1.4/build/webapp
  -# or Cocoon-2.1.5-dev
  -#cocoon.webapp.dir=../cocoon-2.1/build/webapp
  +cocoon.webapp.dir=../cocoon-2.1/build/webapp
   
  +#------------------------------------------------------------------------------------
  +# The root of the Cocoon source tree
  +
  +cocoon.dir=../cocoon-2.1
   
   #------------------------------------------------------------------------------------
   # Root directories where publications are located
  @@ -83,6 +85,12 @@
   
   #anteater.home=/usr/local/anteater
   #webtest.home = /usr/local/canoo-webtest
  +
  +#------------------------------------------------------------------------------------
  +# Eclipse Properties for use with the eclipse-project target
  +
  +ide.eclipse.outputdir=build/eclipse/classes
  +ide.eclipse.export.libs=false
   
   #------------------------------------------------------------------------------------
   # Xopus context name
  
  
  
  1.3       +16 -47    cocoon-lenya/src/targets/ide-build.xml
  
  Index: ide-build.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/targets/ide-build.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ide-build.xml	21 Mar 2004 18:35:15 -0000	1.2
  +++ ide-build.xml	21 Mar 2004 21:26:21 -0000	1.3
  @@ -20,24 +20,6 @@
       IDE targets
     </description>
   
  -  <!-- Generate the Emacs JDE project file -->
  -  <target name="emacs-project" depends="prepare" description="Generate the Emacs project files">
  -    <path id="jar.files">
  -      <fileset dir="${build.webapp}/WEB-INF/lib">
  -        <include name="*.jar"/>
  -      </fileset>
  -      <pathelement path="${build.context}/WEB-INF/classes"/>
  -    </path>
  -    <property name="jar.files" refid="jar.files"/>
  -    <copy file="${tools}/ide/emacs/prj.el.in" tofile="prj.el" filtering="yes">
  -      <filterset>
  -        <filter token="jar.files" value="${jar.files}"/>
  -        <filter token="src" value="${java}"/>
  -        <filter token="build.webapp" value="${build.webapp}"/>
  -      </filterset>
  -    </copy>
  -  </target>
  -
     <!-- Build the Eclipse projects files -->
     <target name="eclipse-project" depends="prepare" description="Generate the Eclipse project files">
   
  @@ -46,27 +28,14 @@
       <!-- prepare the various paths that will form the project -->
       <path id="srcs">
         <!-- main source dir -->
  -      <pathelement path="${src}/java"/>
  -      <!-- deprecated source dir -->
  -      <pathelement path="${src}/deprecated/java"/>
  +      <pathelement path="${src.java.dir}"/>
         <!-- test source dir -->
  -      <pathelement path="${src}/test"/>
  -      <!-- blocks source dirs -->
  -      <dirset dir="${blocks}">
  -        <include name="*/java"/>
  -        <include name="*/java${target.vm}"/>
  -      </dirset>
  -    </path>
  -
  -    <path id="mockss">
  -      <dirset dir="${src}">
  -        <include name="**/mocks"/>
  -      </dirset>
  +      <pathelement path="${src.test.dir}"/>
       </path>
   
       <path id="libs">
  -      <!-- main libs -->
  -      <fileset dir="${lib}">
  +      <!-- Cocoon libs -->
  +      <fileset dir="${cocoon.dir}/${lib.dir}">
           <include name="core/*.jar"/>
           <!-- Currently, we have no JVM dependent libraries       
             <include name="core/jvm${target.vm}/*.jar"/>
  @@ -75,33 +44,36 @@
           <include name="local/*.jar"/>
           <include name="endorsed/*.jar"/>
         </fileset>
  -      <!-- blocks lib -->
  -      <fileset dir="${blocks}">
  +      <!-- Cocoon blocks lib -->
  +      <fileset dir="${cocoon.dir}/src/blocks">
           <include name="**/*.jar"/>
         </fileset>
  -      <!-- tools libs -->
  -      <fileset dir="${tools}/lib">
  +      <!-- Cocoon tools libs -->
  +      <fileset dir="${cocoon.dir}/tools/lib">
           <include name="*.jar"/>
           <exclude name="xalan*.jar"/>
           <exclude name="xml-api*.jar"/>
           <exclude name="xerces*.jar"/>
         </fileset>      
  +      <!-- main libs -->
  +      <fileset dir="${lib.dir}">
  +        <include name="*.jar"/>
  +        <include name="endorsed/*.jar"/>
  +      </fileset>
       </path>
   
       <!-- convert paths to properties -->
       <property name="srcs" refid="srcs"/>
  -    <property name="mockss" refid="mockss"/>
       <property name="libs" refid="libs"/>
   
       <!-- expand properties in the template file -->
  -    <copy file="${tools}/ide/eclipse/classpath-tmpl.xml"
  +    <copy file="src/resources/dev/eclipse/classpath-tmpl.xml"
             tofile="${build.temp}/classpath-temp.xml"
             filtering="yes"
             overwrite="yes">
         <filterset>
           <filter token="SRC_DIRS" value="${srcs}"/>
           <filter token="LIBS" value="${libs}"/>
  -        <filter token="MOCKS_DIRS" value="${mockss}"/>
           <filter token="OUTPUT_DIR" value="${ide.eclipse.outputdir}"/>
         </filterset>
       </copy>
  @@ -123,17 +95,14 @@
       <!-- now build the .classpath file -->
       <xslt in="${build.temp}/classpath-temp.xml" out="${basedir}/.classpath"
             processor="trax"
  -          style="${tools}/ide/eclipse/make-classpath.xsl">
  +          style="src/resources/dev/eclipse/make-classpath.xsl">
          <param name="exportlib" expression="${ide.eclipse.export.libs}"/>
       </xslt>
   
       <!-- copy the project file (expand version) -->
  -    <copy file="${tools}/ide/eclipse/project"
  +    <copy file="src/resources/dev/eclipse/project"
             tofile="${basedir}/.project"
             overwrite="yes">
  -      <filterset>
  -        <filter token="VERSION" value="${version}"/>
  -      </filterset>
       </copy>
     </target>
   
  
  
  
  1.16      +7 -4      cocoon-lenya/src/targets/properties-build.xml
  
  Index: properties-build.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/targets/properties-build.xml,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- properties-build.xml	21 Mar 2004 18:35:15 -0000	1.15
  +++ properties-build.xml	21 Mar 2004 21:26:21 -0000	1.16
  @@ -40,10 +40,12 @@
     <property name="fullname" value="${ant.project.name}-${version}"/>
   
     
  +  <!-- The root of the cocoon source tree -->
  +  <property name="cocoon.dir" value="../cocoon-2.1"/>
  +
     <!-- The libraries we use and which are not already included in the cocoon package -->
     <property name="lib.dir" value="lib"/>
   
  -
     <!-- All compilation and preparation takes place in build.root -->
     <property name="build.root" value="build"/>
     
  @@ -53,13 +55,14 @@
     <!-- Destination for the filtered source files  -->
     <property name="build.src" value="${build.dir}/src"/>
     
  +  <!-- Destination for temporary files during the build  -->
  +  <property name="build.temp" value="${build.dir}/temp"/>
  +  
     <!-- Destination for the class files of the "compile" target -->
     <property name="build.dest" value="${build.dir}/classes"/>
     
     <!-- This is where we assemble the webapp directory in the "webapp" task -->
     <property name="build.webapp" value="${build.dir}/webapp"/>
  -
  -
     
     <!-- This is where the source of the tests are located -->
     <property name="src.test" value="src/test"/>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org