cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r164017 - /cocoon/trunk/tools/external-project-build/generic-build.xml
Date Thu, 21 Apr 2005 09:42:04 GMT
Author: reinhard
Date: Thu Apr 21 02:42:01 2005
New Revision: 164017

URL: http://svn.apache.org/viewcvs?rev=164017&view=rev
Log:
fix dependencies, start with support for unit tests

Added:
    cocoon/trunk/tools/external-project-build/generic-build.xml

Added: cocoon/trunk/tools/external-project-build/generic-build.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/tools/external-project-build/generic-build.xml?rev=164017&view=auto
==============================================================================
--- cocoon/trunk/tools/external-project-build/generic-build.xml (added)
+++ cocoon/trunk/tools/external-project-build/generic-build.xml Thu Apr 21 02:42:01 2005
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  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.
+-->
+<project name="Cocoon build system" default="cocoon:init">
+
+    <target name="cocoon:core-setProperties" depends="cocoon:before-setProperties">
+        <!-- get the properties of properties configuration files -->
+        <property name="cocoon.server" value="localhost"/>
+        <property file="${cocoon.server}.build.properties"/>
+
+        <property file="project.properties"/>
+
+        <!-- conditions depending on property values -->
+        <property name="cocoon.container.use" value="false"/>
+        <property name="cocoon.classesToJAR" value="false"/>
+        <condition property="cocoon.cond.container.use">
+          <istrue value="${cocoon.container.use}"/>
+        </condition>
+        <condition property="cocoon.cond.webapp.in.context">
+          <equals arg1="${cocoon.webapp.path}" arg2=""/>
+        </condition>           
+        <condition property="cocoon.cond.classesToJAR">
+          <and>
+              <istrue value="${cocoon.cond.webapp.in.context}"/>
+              <istrue value="${cocoon.classesToJAR}"/>
+          </and>
+        </condition>
+
+        <!-- repository directory structure -->
+        <property name="cocoon.rep.cocoon.dir" value="${cocoon.rep}/cocoon/${cocoon.version}"/>
+        <property name="cocoon.rep.cocoon.webapp.dir" value="${cocoon.rep.cocoon.dir}/webapp"/>
+        <property name="cocoon.rep.cocoon.lib.dir" value="${cocoon.rep.cocoon.dir}/webapp/WEB-INF/lib"/>
+        <property name="cocoon.rep.cocoon.classes.dir" value="${cocoon.rep.cocoon.dir}/webapp/WEB-INF/classes"/>
+        <property name="cocoon.rep.cocoon.db.dir" value="${cocoon.rep.cocoon.webapp.dir}/WEB-INF/db"/>
+        <property name="cocoon.rep.container.dir" value="${cocoon.rep}/container/${cocoon.container.version}"/>
+    	
+		<!-- container properties -->
+        <property file="${cocoon.rep.container.dir}/server.properties"/>
+        	
+        <!-- target directory structure -->
+        <property name="cocoon.build.dir" value="build"/>
+        <property name="cocoon.build.java" value="${cocoon.build.dir}/java"/>   
+        <property name="cocoon.build.java.classes" value="${cocoon.build.java}/classes"/>
          
+        <property name="cocoon.build.junit" value="${cocoon.build.dir}/test/junit"/>
   
+        <property name="cocoon.build.junit.classes" value="${cocoon.build.junit}/classes"/>
                    
+        <property name="cocoon.build.junit.output" value="${cocoon.build.junit}/output"/>
        
+        <property name="cocoon.build.htmlunit" value="${cocoon.build.dir}/test/htmlunit"/>
      
+        <property name="cocoon.build.htmlunit.classes" value="${cocoon.build.htmlunit}/classes"/>
           
+        <property name="cocoon.build.htmlunit.output" value="${cocoon.build.htmlunit}/output"/>
                   
+        <property name="cocoon.build.webapp.war.dir" value="${cocoon.build.dir}/${cocoon.server}_webapp"/>
+        <property name="cocoon.build.webapp.dir" value="${cocoon.build.dir}/${cocoon.server}_webapp/ROOT"/>
+        <property name="cocoon.build.container.dir" value="${cocoon.build.dir}/${cocoon.server}_container"/>
+
+        <!-- local directories -->
+        <property name="cocoon.local.webapp.dir" value="webapp"/>
+        <property name="cocoon.local.src.dir" value="java"/>
+        <property name="cocoon.local.junit.dir" value="test/junit"/>   
+        <property name="cocoon.local.lib.dir" value="lib"/>
+        <property name="cocoon.local.conf.dir" value="conf"/>
+
+        <!-- default values for compiler settings -->
+        <property name="cocoon.compiler" value="modern"/>
+        <property name="cocoon.compiler.debug" value="on"/>
+        <property name="cocoon.compiler.optimize" value="on"/>
+        <property name="cocoon.compiler.deprecation" value="off"/>
+        <property name="cocoon.compiler.nowarn" value="on"/>
+        <property name="cocoon.compiler.source.vm" value="1.3"/>
+        <property name="cocoon.compiler.target.vm" value="1.3"/>
+     
+        <!-- classpaths -->
+        <path id="cocoon:classpath">
+            <fileset dir="${cocoon.rep.cocoon.lib.dir}">
+                <include name="*.jar" />
+            </fileset>
+            <fileset dir="${cocoon.local.lib.dir}">
+                <include name="*.jar" />
+            </fileset>
+            <dirset dir="${cocoon.rep.cocoon.classes.dir}" />
+        </path>
+    </target>
+
+    <target name="cocoon:init" depends="cocoon:setProperties, cocoon:setFilters">
+        <!-- global filters -->
+        <filter token="cocoon.filter.webapp.path" value="${cocoon.webapp.path}"/>
+    </target>
+
+    <target name="cocoon:core-webapp" depends="cocoon:before-webapp">
+        <mkdir dir="${cocoon.build.webapp.dir}"/>
+
+        <!-- copy Cocoon -->
+        <copy todir="${cocoon.build.webapp.dir}">
+            <fileset dir="${cocoon.rep.cocoon.webapp.dir}">
+                <include name="WEB-INF/**"/>
+            </fileset>
+        </copy>
+
+        <!-- copy local resources if the application runs *within* the servlet context
-->
+        <antcall target="cocoon:copyWebapp"/>
+
+        <copy todir="${cocoon.build.webapp.dir}" filtering="on">
+            <fileset dir="${cocoon.local.webapp.dir}">
+                <include name="sitemap.xmap"/>
+            </fileset>
+        </copy>
+
+        <!-- customize Cocoon -->
+        <copy todir="${cocoon.build.webapp.dir}/WEB-INF/xconf" filtering="on" overwrite="true">
+            <fileset dir="${cocoon.local.conf.dir}">
+                <include name="*xconf"/>
+            </fileset>
+        </copy>
+
+        <!-- add own Java classes -->
+        <antcall target="cocoon:compile"/>
+        <antcall target="cocoon:classesToJAR"/>
+
+        <!-- copy local libraries -->
+        <copy todir="${cocoon.build.webapp.dir}/WEB-INF/lib" filtering="off">
+            <fileset dir="${cocoon.local.lib.dir}"/>
+        </copy>
+    </target>
+    
+    <target name="cocoon:copyWebapp" if="cocoon.cond.webapp.in.context">
+        <echo message=".... copyWebapp"/>
+        <copy todir="${cocoon.build.webapp.dir}" filtering="off">
+            <fileset dir="${cocoon.local.webapp.dir}">
+                <exclude name="sitemap.xmap"/>
+            </fileset>
+        </copy>      
+    </target>
+
+    <target name="cocoon:classesToJAR" if="cocoon.cond.classesToJAR">
+        <zip destfile="${cocoon.build.webapp.dir}/WEB-INF/lib/_project.jar">
+            <fileset dir="${cocoon.build.webapp.dir}/WEB-INF/classes"/>
+        </zip>
+        <delete dir="${cocoon.build.webapp.dir}/WEB-INF/classes"/>
+    </target>
+
+    <target name="cocoon:core-war" depends="cocoon:before-war">
+        <zip destfile="${cocoon.build.webapp.war.dir}/ROOT.war">
+            <fileset dir="${cocoon.build.webapp.dir}"/>
+        </zip>
+    </target>
+
+    <target name="cocoon:core-container" depends="cocoon:before-container">
+        <ant antfile="${cocoon.rep.container.dir}/container-build.xml"
+            target="cocoon:create" inheritall="true"/>
+    </target>
+
+    <target name="cocoon:core-run" depends="cocoon:before-run">
+        <ant antfile="${cocoon.rep.container.dir}/container-build.xml"
+            target="cocoon:run" inheritall="true"/>      
+    </target>
+
+    <target name="cocoon:core-stop" depends="cocoon:init, cocoon:before-stop">
+        <ant antfile="${cocoon.rep.container.dir}/container-build.xml"
+            target="cocoon:stop" inheritall="true"/>
+    </target>
+    
+    <target name="cocoon:core-compile" depends="cocoon:before-compile">
+        <!-- TODO support more than one directory with Java classes -->
+        <mkdir dir="${cocoon.build.java}"/>
+        <mkdir dir="${cocoon.build.java.classes}"/>   
+        <mkdir dir="${cocoon.build.webapp.dir}/WEB-INF/classes"/>
+        <copy todir="${cocoon.build.java.classes}" filtering="on">
+            <fileset dir="${cocoon.local.src.dir}">
+                <exclude name="**/*.java"/>
+                <exclude name="**/.svn"/>   
+            </fileset>
+        </copy>
+        <javac classpathref="cocoon:classpath"
+               compiler="${cocoon.compiler}"
+               nowarn="${cocoon.compiler.nowarn}"
+               source="${cocoon.compiler.source.vm}"
+               target="${cocoon.compiler.target.vm}"
+               deprecation="${cocoon.compiler.deprecation}"
+               optimize="${cocoon.compiler.optimize}"
+               debug="${cocoon.compiler.debug}"
+               destdir="${cocoon.build.java.classes}"
+               srcdir="${cocoon.local.src.dir}" />
+        <copy todir="${cocoon.build.webapp.dir}/WEB-INF/classes" filtering="off">
+            <fileset dir="${cocoon.build.java.classes}">
+                <exclude name="**/*.java"/>
+                <exclude name="**/.svn"/>   
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="cocoon:core-clean" depends="cocoon:before-clean">
+        <delete includeEmptyDirs="true">
+          <fileset dir="${cocoon.build.dir}">
+              <include name="*_container/**"/>
+              <include name="*_webapp/**"/>
+          </fileset>
+        </delete>
+    </target>
+
+    <target name="cocoon:core-clean-all" depends="cocoon:before-clean-all">
+        <delete dir="${cocoon.build.dir}"/>
+    </target>
+
+    <!-- interception targets -->
+    <target name="cocoon:before-setProperties"/>
+    <target name="cocoon:after-setProperties" depends="cocoon:core-setProperties"/>
+    <target name="cocoon:before-webapp" depends="cocoon:init"/>
+    <target name="cocoon:after-webapp" depends="cocoon:core-webapp"/>
+    <target name="cocoon:before-war" depends="cocoon:webapp"/>
+    <target name="cocoon:after-war" depends="cocoon:core-war"/>
+    <target name="cocoon:before-container" depends="cocoon:init"/>
+    <target name="cocoon:after-container" depends="cocoon:core-container"/>
+    <target name="cocoon:before-run" depends="cocoon:init"/>
+    <target name="cocoon:after-run" depends="cocoon:core-run"/>
+    <target name="cocoon:before-stop" depends="cocoon:init"/>
+    <target name="cocoon:after-stop" depends="cocoon:core-stop"/>
+    <target name="cocoon:before-compile" depends="cocoon:init" if="cocoon.cond.webapp.in.context"/>
+    <target name="cocoon:after-compile" depends="cocoon:core-compile" if="cocoon.cond.webapp.in.context"/>
+    <target name="cocoon:before-clean" depends="cocoon:init"/>
+    <target name="cocoon:after-clean" depends="cocoon:core-clean"/>
+    <target name="cocoon:before-clean-all" depends="cocoon:init"/>
+    <target name="cocoon:after-clean-all" depends="cocoon:core-clean-all"/>
+
+    <!-- public available targets 
+         DO NOT OVERRIDE THEM but use the before/after/core targets for this purpose
+    -->
+    <target name="cocoon:container" depends="cocoon:after-container" description="screate
a container (uses the property 'container.version')"/>
+    <target name="cocoon:webapp" depends="cocoon:after-webapp" description="create the
web application"/>
+    <target name="cocoon:war" depends="cocoon:after-war" description="create a web archive
(WAR)"/>
+    <target name="cocoon:run" depends="cocoon:after-run" description="run the container
(currently it only works on windows boxes)"/>
+    <target name="cocoon:stop" depends="cocoon:after-stop" description="run the container
(currently it only works on windows boxes)"/>
+    <target name="cocoon:compile" depends="cocoon:after-compile" description="Compile
Java classes" if="cocoon.cond.webapp.in.context"/>
+    <target name="cocoon:clean" depends="cocoon:after-clean" description="clean webapps
and container"/>
+    <target name="cocoon:clean-all" depends="cocoon:after-clean-all" description="clean
*everything* in the build dir"/>
+
+	<!-- short versions for public cocoon:* targets - as these are very common names they
might be
+	     overriden in a custom project build file -->
+    <target name="container" depends="cocoon:container" if="cond.container.use" description="short
version for cocoon:container"/>
+    <target name="webapp" depends="cocoon:webapp" description="short version for cocoon:webapp"/>
+    <target name="war" depends="cocoon:war" description="short version for cocoon:war"/>
+    <target name="run" depends="cocoon:run" description="short version for cocoon:run"/>
+    <target name="stop" depends="cocoon:stop" description="short version for cocoon:stop"/>
+    <target name="compile" depends="cocoon:compile" description="short version for cocoon:compile"
if="cocoon.cond.webapp.in.context"/>
+    <target name="clean" depends="cocoon:clean" description="short version for cocoon:clean"/>
+    <target name="clean-all" depends="cocoon:clean-all" description="short version for
cocoon:clean-all"/>	
+	
+    <!-- internally available targets -->
+    <target name="cocoon:setProperties" depends="cocoon:after-setProperties"/>
+
+    <!-- empty targets to be overriden -->
+    <target name="cocoon:setFilters"/>
+    <target name="cocoon:complete-ant"/>
+
+</project>
\ No newline at end of file



Mime
View raw message