You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by rg...@apache.org on 2007/08/29 17:37:42 UTC

svn commit: r570839 - /forrest/trunk/whiteboard/forrest2/core/build.xml

Author: rgardler
Date: Wed Aug 29 08:37:41 2007
New Revision: 570839

URL: http://svn.apache.org/viewvc?rev=570839&view=rev
Log:
Bring back run targets from original build system - We need to be able to run as well as build

Modified:
    forrest/trunk/whiteboard/forrest2/core/build.xml

Modified: forrest/trunk/whiteboard/forrest2/core/build.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/build.xml?rev=570839&r1=570838&r2=570839&view=diff
==============================================================================
--- forrest/trunk/whiteboard/forrest2/core/build.xml (original)
+++ forrest/trunk/whiteboard/forrest2/core/build.xml Wed Aug 29 08:37:41 2007
@@ -15,7 +15,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<project default="resolve" basedir="." name="forrest2">
+<project default="run" basedir="." name="forrest2">
 
   <description>
     Ivy based build system for Apache Forrest2.
@@ -23,7 +23,12 @@
     
   <property file="local.build.properties"/>
   <property file="build.properties"/>
-        
+   
+  <property name="content.object.dir" location="src/examples/helloWorld"/>
+  <property name="content.object.start.uri" value="helloWorld.html"/>
+  <property name="content.object.src.dir" location="${content.object.dir}/src"/>
+  <property name="content.object.build.dir" location="${content.object.dir}/build"/>
+   
   <!-- try to load ivy here from local tools/ivy dir, in case the user has not already dropped
 	      it into ant's lib dir (note that the latter copy will always take precedence).
 	      We will not fail as long as local lib dir exists (it may be empty) and
@@ -36,4 +41,32 @@
     
   <import file="${ivy.repository.dir}/build-scripts/common-java.xml"/>
 
+  <target name="copy-content-object-resources" depends="init">
+    <copy todir="${content.object.build.dir}">
+      <fileset dir="${content.object.src.dir}">
+        <exclude name="**/*.java"/>
+      </fileset>
+    </copy>
+  </target>
+
+  <target name="compile-content-object" depends="compile-core, copy-content-object-resources">
+    <javac destdir="${content.object.build.dir}" debug="${compile.debug}">
+      <classpath>
+        <pathelement path="${project.build.classes.dir}"/>
+      </classpath>
+      <src path="${content.object.src.dir}" />
+    </javac>
+  </target>
+    
+  <target name="run" depends="compile-content-object">
+    <java classname="org.apache.forrest.cli.CLI" 
+			dir="${content.object.dir}" fork="yes" failonerror="yes">
+      <classpath>
+        <path refid="run.path.id" />
+        <pathelement path="${project.build.classes.dir}"/>
+        <pathelement path="${content.object.build.dir}"/>
+      </classpath>
+      <arg line="${content.object.start.uri}"/>
+    </java>
+  </target>
 </project>