You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ni...@apache.org on 2004/03/16 10:06:08 UTC

cvs commit: avalon/buildsystem maven-common-gump-build-reactor.xml

niclas      2004/03/16 01:06:08

  Added:       buildsystem maven-common-gump-build-reactor.xml
  Log:
  Putting common stuff in common place.
  
  Revision  Changes    Path
  1.1                  avalon/buildsystem/maven-common-gump-build-reactor.xml
  
  Index: maven-common-gump-build-reactor.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <!-- this ant buildfile provides base functionality for gump
       integration. You should not normally have to modify this
       by hand. -->
  <project name="Gump Build Support" default="warning" basedir=".">
      <!-- note the lack of property file inclusion. You should
           do that from the script which calls this file. -->
  
      <target name="avalon:warning" unless="do.not.warn">
          <echo>
  =======================================================================
                            WARNING!
  
    This buildfile is only here for gump integration. Please use
    maven (http://maven.apache.org/) for normal builds.
  =======================================================================
          </echo>
      </target>
  
      <target name="avalon:debug" unless="do.not.debug">
          <echo>
  =======================================================================
  DEBUG INFO
  
    maven.src.dir             = ${maven.src.dir}
    maven.build.dir           = ${maven.build.dir}
    maven.compile.debug       = ${maven.compile.debug}
    maven.compile.deprecation = ${maven.compile.deprecation}
    maven.compile.optimize    = ${maven.compile.optimize}
  
    project.name              = ${project.name}
    project.version           = ${project.version}
    project.copyright.year    = ${project.copyright.year}
  
    java sources = ${maven.src.dir}/java
    java classes = ${maven.build.dir}/classes
    jarfile      = ${maven.build.dir}/${project.name}-${project.version}.jar
    javadocs     = ${maven.build.dir}/docs/apidocs
    junitreports = ${maven.build.dir}/docs/junitreports
  =======================================================================
          </echo>
      </target>
  
      <target name="avalon:warn-project.name" unless="project.name.set">
          <echo>
  =======================================================================
                            WARNING!
  
    The property 'project.name' has not been set. This will result in a
    jar file with a rather dumb name, being
  
    ${maven.build.dir}/${project.name}-${project.version}.jar
  
    To fix this, add a property to the gump build definition or the
    properties file for the current component.
  =======================================================================
          </echo>
      </target>
      <target name="avalon:init">
          <antcall target="avalon:warning"/>
  
          <!-- defaults -->
          <property name="maven.src.dir" value="${basedir}/src"/>
          <property name="maven.build.dir" value="${basedir}/target"/>
          <property name="maven.compile.debug" value="on"/>
          <property name="maven.compile.optimize" value="off"/>
          <property name="maven.compile.deprecation" value="off"/>
          <property name="maven.junit.fork" value="off"/>
          <property name="maven.junit.dir" value="${basedir}"/>
          <property name="maven.junit.usefile" value="true"/>
  
          <property name="project.name" value="some-nameless-gump-built-component"/>
          <tstamp>
              <format property="project.version" pattern="yyyyMMdd"/>
          </tstamp>
          <property name="project.copyright.year" value="1997-2003"/>
  
          <condition property="project.name.set">
              <isset property="project.name"/>
          </condition>
          <antcall target="avalon:warn-project.name"/>
  
          <available file="${basedir}/src/java" property="java.src.present"/>
          <available file="${basedir}/src/test" property="test.src.present"/>
  
          <condition property="no.sources.available">
                  <and>
                      <not><isset property="java.src.present"/></not>
                      <not><isset property="test.src.present"/></not>
                  </and>
          </condition>
          <antcall target="avalon:debug"/>
      </target>
  
      <target name="avalon:compile" depends="avalon:init">
          <antcall target="avalon:reactor">
              <param name="target" value="jar"/>
          </antcall>
  
          <echo>
  =======================================================================
   Gathering sources and classes from subprojects
  =======================================================================
          </echo>
          <mkdir dir="${maven.build.dir}"/>
          <mkdir dir="${maven.build.dir}/classes"/>
          <copy todir="${maven.build.dir}/classes">
              <fileset dir="api/target/classes"/>
              <fileset dir="impl/target/classes"/>
          </copy>
          <mkdir dir="${maven.build.dir}/src"/>
          <copy todir="${maven.build.dir}/src">
              <fileset dir="api/src/java"/>
              <fileset dir="impl/src/java"/>
          </copy>
      </target>
  
      <target name="avalon:test" depends="avalon:compile">
          <echo>
  =======================================================================
   Consolidating test reports
  =======================================================================
          </echo>
  
          <!-- note: this completely deviates from the approach maven
               takes to generating the junit reports and stores them
               in a different location. -->
  
          <mkdir dir="${maven.build.dir}/docs/junitreports"/>
  
          <mkdir dir="api/target/test-reports"/><!-- make sure fileset works -->
          <mkdir dir="impl/target/test-reports"/><!-- make sure fileset works -->
  
          <junitreport todir="${maven.build.dir}/docs/junitreports">
              <fileset dir="api/target/test-reports">
                  <include name="TEST-*.xml"/>
              </fileset>
              <fileset dir="impl/target/test-reports">
                  <include name="TEST-*.xml"/>
              </fileset>
              <report format="frames" todir="${maven.build.dir}/docs/junitreports"/>
          </junitreport>
      </target>
  
      <target name="avalon:jar" depends="avalon:init,avalon:compile,avalon:test">
          <echo>
  =======================================================================
   Generating combined jar
  =======================================================================
          </echo>
          <mkdir dir="${maven.build.dir}/classes"/>
          <jar destfile="${maven.build.dir}/${project.name}-${project.version}.jar" basedir="${maven.build.dir}/classes"/>
      </target>
  
      <target name="avalon:javadocs" depends="avalon:init,avalon:compile">
          <antcall target="avalon:reactor">
              <param name="target" value="javadocs"/>
          </antcall>
          <echo>
  =======================================================================
   Generating combined javadocs
  =======================================================================
          </echo>
  
          <mkdir dir="${maven.build.dir}/docs"/>
          <mkdir dir="${maven.build.dir}/docs/apidocs"/>
          <mkdir dir="${maven.build.dir}/classes"/><!-- to ensure <classpath/> works -->
  
          <property name="copyright"
            value="Copyright &amp;copy; ${project.copyright.year} Apache Software Foundation. All Rights Reserved." />
  
          <property name="title" value="Avalon ${project.name} API"/>
  
          <javadoc
            sourcepath="${maven.build.dir}/src"
            packagenames="org.apache.*"
            destdir="${maven.build.dir}/docs/apidocs"
            windowtitle="${title}"
            doctitle="${title}"
            bottom="${copyright}">
  
            <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
            <link href="http://avalon.apache.org/framework/api/"/>
            <classpath>
              <path location="${maven.build.dir}/classes"/>
            </classpath>
          </javadoc>
      </target>
  
      <target name="avalon:dist" depends="avalon:init,avalon:jar">
          <antcall target="avalon:reactor">
              <param name="target" value="dist"/>
          </antcall>
  
          <mkdir dir="${maven.build.dir}"/>
          <mkdir dir="${maven.build.dir}/${project.name}-${project.version}"/>
          <mkdir dir="${maven.build.dir}/dist"/>
  
          <echo>
  =======================================================================
   Building Source/Binary Distribution
  =======================================================================
          </echo>
          <mkdir dir="${maven.build.dir}/${project.name}-${project.version}/bin"/>
          <copy todir="${maven.build.dir}/${project.name}-${project.version}/bin">
              <fileset dir="${maven.build.dir}">
                  <include name="*.jar"/>
                  <include name="*.txt"/>
                  <include name="*.zip"/>
                  <include name="docs"/>
              </fileset>
              <fileset dir="api/target/">
                  <include name="*.jar"/>
                  <include name="*.zip"/>
              </fileset>
              <fileset dir="impl/target/">
                  <include name="*.jar"/>
                  <include name="*.zip"/>
              </fileset>
          </copy>
          <zip destfile="${maven.build.dir}/${project.name}-${project.version}/bin/scr.zip">
              <zipfileset dir="${maven.build.dir}/src"/>
          </zip>
          <zip destfile="${maven.build.dir}/dist/${project.name}-${project.version}.zip">
              <zipfileset dir="${maven.build.dir}/${project.name}-${project.version}/bin"
                  prefix="${project.name}-${project.version}"/>
          </zip>
      </target>
  
      <target name="avalon:distclean" depends="avalon:init">
          <delete dir="${maven.build.dir}"/>
          <delete dir="api/target"/>
          <delete dir="impl/target"/>
      </target>
  
  
  
  
      <target name="avalon:reactor"
              depends="avalon:init">
          <echo>
  =======================================================================
   Building the api/ and impl/ subprojects, target ${target}
  =======================================================================
          </echo>
  
          <condition property="reactor.target.isset">
              <isset property="target"/>
          </condition>
  
          <available file="api/build.xml" property="api.proj.present"/>
          <available file="impl/build.xml" property="impl.proj.present"/>
          <antcall target="avalon:reactor-run-api"/>
          <antcall target="avalon:reactor-run-impl"/>
      </target>
  
      <target name="avalon:reactor-run-api" if="api.proj.present">
          <antcall target="avalon:reactor-run">
              <param name="dir" value="api"/>
          </antcall>
      </target>
  
      <target name="avalon:reactor-run-impl" if="impl.proj.present">
          <antcall target="avalon:reactor-run">
              <param name="dir" value="impl"/>
          </antcall>
      </target>
  
      <target name="avalon:reactor-run" if="reactor.target.isset">
          <ant dir="${dir}" target="${target}" inheritAll="false">
              <property name="project.version" value="${project.version}"/>
          </ant>
      </target>
  </project>
  
  

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