forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r123864 - /forrest/trunk/main/forrest.build.xml /forrest/trunk/plugins/build.xml
Date Sun, 02 Jan 2005 01:42:27 GMT
Author: rgardler
Date: Sat Jan  1 17:42:26 2005
New Revision: 123864

URL: http://svn.apache.org/viewcvs?view=rev&rev=123864
Log:
enable plugins to provide additional libraries and their own java classes
Modified:
   forrest/trunk/main/forrest.build.xml
   forrest/trunk/plugins/build.xml

Modified: forrest/trunk/main/forrest.build.xml
Url: http://svn.apache.org/viewcvs/forrest/trunk/main/forrest.build.xml?view=diff&rev=123864&p1=forrest/trunk/main/forrest.build.xml&r1=123863&p2=forrest/trunk/main/forrest.build.xml&r2=123864
==============================================================================
--- forrest/trunk/main/forrest.build.xml	(original)
+++ forrest/trunk/main/forrest.build.xml	Sat Jan  1 17:42:26 2005
@@ -336,6 +336,10 @@
          <pathelement location="${forrest.core.webapp}/WEB-INF/classes"/>
          <pathelement location="${forrest.build.lib-dir}/xml-forrest.jar"/>
          <pathelement location="${project.classes-dir}"/>
+         <fileset dir="${forrest.plugins-dir}" casesensitive="no">
+           <include name="**/lib/*.jar"/>
+           <include name="**/lib/*.zip"/>
+         </fileset>
          <fileset dir="${forrest.jetty.lib-dir}" casesensitive="no">
            <include name="*.jar"/>
            <include name="*.zip"/>

Modified: forrest/trunk/plugins/build.xml
Url: http://svn.apache.org/viewcvs/forrest/trunk/plugins/build.xml?view=diff&rev=123864&p1=forrest/trunk/plugins/build.xml&r1=123863&p2=forrest/trunk/plugins/build.xml&r2=123864
==============================================================================
--- forrest/trunk/plugins/build.xml	(original)
+++ forrest/trunk/plugins/build.xml	Sat Jan  1 17:42:26 2005
@@ -38,6 +38,11 @@
   <property name="deploy.svn.svn-dir"         location="${forrest.build.dir}/svn-plugins-deploy"/>
   <property name="deploy.svn.svn-filestoadd"  location="build/svn-deploy.toadd"/>
   
+  <property name="build.dir"             location="build"/>
+  <property name="build.classes"         location="${build.dir}/classes"/>
+  
+  <property name="java.dir"              location="src/java"/>
+  
   
   <taskdef resource="net/sf/antcontrib/antcontrib.properties">
     <classpath>
@@ -52,8 +57,51 @@
   </taskdef>
   
   <target name="init">
+    <tstamp>
+      <format property="YEAR" pattern="yyyy" locale="en"/>
+    </tstamp>
+    
+    <property name="build.compiler.emacs"       value="on"/>
+    <property name="build.compiler.warnings"    value="true"/>
+    <property name="build.compiler.pedantic"    value="false"/>
+    <property name="build.compiler.depend"      value="true"/>
+    <property name="build.compiler.fulldepend"  value="true"/>
+    <property name="build.compiler.debug"       value="on"/>    
+    <property name="build.compiler.optimize"    value="off"/>
+    <property name="build.compiler.deprecation" value="on"/>
+    <property name="build.compiler.nowarn"      value="on"/>    
+    <property name="build.compiler.type"        value="classic"/>
+    <property name="build.compiler.vm"          value="1.2"/>
+    
     <input message="Which plugin you which to operate on?"
            addproperty="plugin-name"/>
+           
+    <mkdir dir="${build.dir}"/>
+    
+    <buildnumber file="${build.dir}/build.number"/>
+    <echo>
+      --------------------------------------------------------------
+
+      Using ${ant.version}
+      Build file ${ant.file}
+      Use 'build.[sh|bat] -projecthelp' to see other options.
+      Build system home ${ant.home}
+      Build number ${build.number}
+      Project Name ${ant.project.name}
+      Java Version ${ant.java.version}      
+      Timestamp ${DSTAMP}${TSTAMP}
+      
+      --------------------------------------------------------------
+    </echo>
+    
+    <path id="classpath">
+      <fileset dir="${forrest.home}/lib" includes="**/*.jar"/>
+      <fileset dir="lib" includes="*.jar"/>
+      <fileset dir="lib" includes="*.zip"/>
+    </path>
+  	
+  	<available file="${java.dir}" property="java_exists" type="dir"/>
+    
   </target>
   
   <target name="clean" depends="init">
@@ -64,15 +112,18 @@
   <!-- FIXME: Forrest should really use the plugins in-place if they are available as
source -->
   <target name="local-deploy"
           description="Deploy a plugin locally"
-          depends="init">
+          depends="init, jar">
           
     <echo>Locally deploying ${plugin-name}</echo>
     
     <copy toDir="${plugins.localDeploy-dir}/${plugin-name}">
       <fileset dir="${plugins.dir}/${plugin-name}">
-       <exclude name="**/build/**"/>
+        <exclude name="**/${build.dir}/**"/>
       </fileset>
     </copy>
+  	<copy toFile="${plugins.localDeploy-dir}/${plugin-name}/lib/${plugin-name}.jar"
+  	      file="${build.dir}/${plugin-name}.jar"
+  	      failonerror="false"/>
     <!-- FIXME: execute local build file -->
     <antcall target="build"/>
   </target>
@@ -150,8 +201,6 @@
   <target name="seedPlugin"
     description="Create a new plugin directory in the current working directory and seed
it with initial set of files"
     depends="init">
-    <input message="What is the name of your new plugin?"
-           addproperty="plugin-name"/>
     <mkdir dir="${plugin-name}"/>
     <mkdir dir="${plugin-name}/${plugin.src.dir}"/>
     <mkdir dir="${plugin-name}/${plugin.resources.dir}"/>
@@ -171,6 +220,29 @@
           tofile="${plugin-name}/${plugin-type}.xmap"/>
   </target>
   
+  <!-- =================================================================== -->
+  <!-- Compile Cocoon java classes                                         -->
+  <!-- =================================================================== -->
+  <target name="compile" depends="init" if="java_exists">
+    <mkdir dir="${build.classes}"/>
+    <javac srcdir=   "${java.dir}"
+      destdir=       "${build.classes}"
+      debug=         "${build.compiler.debug}"
+      optimize=      "${build.compiler.optimize}"
+      deprecation=   "${build.compiler.deprecation}"
+      nowarn=        "${build.compiler.nowarn}"
+      classpathref=  "classpath">
+    </javac>
+  </target>
+	
+  <!-- =================================================================== -->
+  <!-- Jar Cocoon classes                                                  -->
+  <!-- =================================================================== -->
+  <target name="jar" depends="init, compile" if="java_exists">
+    <jar destfile="${build.dir}/${plugin-name}.jar"
+	     basedir="${build.classes}"/>
+  </target>
+	
   <target name="test" depends="init, clean, docs"/>
 </project>
   

Mime
View raw message