You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by cb...@apache.org on 2009/01/04 05:55:11 UTC

svn commit: r731175 - in /ibatis/trunk/java/ibatis-3: ./ ant-lib/ ant-lib/emma.jar ant-lib/emma_ant.jar ant-lib/maven-ant-tasks-2.0.9.jar build.xml common.xml version.properties

Author: cbegin
Date: Sat Jan  3 20:55:08 2009
New Revision: 731175

URL: http://svn.apache.org/viewvc?rev=731175&view=rev
Log:
Added Ant build for creating distributable packages.

Added:
    ibatis/trunk/java/ibatis-3/ant-lib/
    ibatis/trunk/java/ibatis-3/ant-lib/emma.jar   (with props)
    ibatis/trunk/java/ibatis-3/ant-lib/emma_ant.jar   (with props)
    ibatis/trunk/java/ibatis-3/ant-lib/maven-ant-tasks-2.0.9.jar   (with props)
    ibatis/trunk/java/ibatis-3/build.xml
    ibatis/trunk/java/ibatis-3/common.xml
    ibatis/trunk/java/ibatis-3/version.properties
Modified:
    ibatis/trunk/java/ibatis-3/   (props changed)

Propchange: ibatis/trunk/java/ibatis-3/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Jan  3 20:55:08 2009
@@ -3,3 +3,4 @@
 ibatis-3.iws
 derby.log
 ibderby
+build

Added: ibatis/trunk/java/ibatis-3/ant-lib/emma.jar
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ant-lib/emma.jar?rev=731175&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ibatis/trunk/java/ibatis-3/ant-lib/emma.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ibatis/trunk/java/ibatis-3/ant-lib/emma_ant.jar
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ant-lib/emma_ant.jar?rev=731175&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ibatis/trunk/java/ibatis-3/ant-lib/emma_ant.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ibatis/trunk/java/ibatis-3/ant-lib/maven-ant-tasks-2.0.9.jar
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ant-lib/maven-ant-tasks-2.0.9.jar?rev=731175&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ibatis/trunk/java/ibatis-3/ant-lib/maven-ant-tasks-2.0.9.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ibatis/trunk/java/ibatis-3/build.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/build.xml?rev=731175&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/build.xml (added)
+++ ibatis/trunk/java/ibatis-3/build.xml Sat Jan  3 20:55:08 2009
@@ -0,0 +1,43 @@
+<project name="iBATIS-3" default="all" basedir="." >
+
+  <target name="all">
+    <antcall target="_external_run">
+      <param name="target" value="all"/>
+    </antcall>
+  </target>
+
+  <target name="clean">
+    <antcall target="_external_run">
+      <param name="target" value="clean"/>
+    </antcall>
+  </target>
+
+  <target name="compile">
+    <antcall target="_external_run">
+      <param name="target" value="compile"/>
+    </antcall>
+  </target>
+
+  <target name="test">
+    <antcall target="_external_run">
+      <param name="target" value="test.coverage"/>
+    </antcall>
+  </target>
+
+  <target name="dist">
+    <antcall target="_external_run">
+      <param name="target" value="dist"/>
+    </antcall>
+  </target>
+
+  <target name="_external_run">
+    <ant antfile="common.xml" target="${target}">
+      <property name="module" value="ibatis-3-core"/>
+    </ant>
+    <ant antfile="common.xml" target="${target}">
+      <property name="module" value="ibatis-3-compat"/>
+    </ant>
+  </target>
+
+
+</project>
\ No newline at end of file

Added: ibatis/trunk/java/ibatis-3/common.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/common.xml?rev=731175&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/common.xml (added)
+++ ibatis/trunk/java/ibatis-3/common.xml Sat Jan  3 20:55:08 2009
@@ -0,0 +1,209 @@
+<project name="Maven Module Builder" default="all" basedir="." xmlns:artifact="urn:maven-artifact-ant">
+
+  <!-- INPUTS -->
+  <!-- <property name="module" value="some-module-name" /> -->
+  <property name="src.dir" value="${module}/src/main/java" />
+  <property name="test.dir" value="${module}/src/test/java" />
+
+  <!-- OUTPUTS -->
+  <property name="build.root" value="./build/${module}"/>
+
+  <property name="classes" value="${build.root}/classes"/>
+  <property name="classes.test" value="${build.root}/classes-test"/>
+  <property name="classes.instrumented" value="${build.root}/classes-instrumented"/>
+
+  <property name="reports.junit" value="${build.root}/reports-junit"/>
+  <property name="reports.coverage" value="${build.root}/reports-coverage"/>
+
+  <property name="deploy.exploded" value="${build.root}/exploded"/>
+  <property name="deploy.dist" value="${build.root}/dist"/>
+
+  <!-- MAVEN -->
+
+  <path id="maven-ant-tasks.classpath"
+        path="ant-lib/maven-ant-tasks-2.0.9.jar" />
+
+  <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
+           uri="urn:maven-artifact-ant"
+           classpathref="maven-ant-tasks.classpath" />
+
+  <artifact:pom id="${module}.pom" file="${module}/pom.xml" />
+
+  <artifact:dependencies pathId="runtime.src" usescope="compile" pomrefid="${module}.pom" />
+  <artifact:dependencies pathId="test.src" usescope="test" pomrefid="${module}.pom" />
+
+  <!-- EMMA -->
+
+  <path id="emma.classpath">
+    <pathelement  location="ant-lib/emma_ant.jar" />
+    <pathelement  location="ant-lib/emma.jar" />
+  </path>
+
+  <taskdef resource="emma_ant.properties"
+           classpathref="emma.classpath" />
+
+  <!-- PATHS -->
+
+  <path id="classes-to-instrument">
+    <pathelement location="${classes}"/>
+  </path>
+
+  <path id="classpath">
+    <pathelement location="${classes}"/>
+    <pathelement location="${classes.test}"/>
+    <path refid="emma.classpath"/>
+    <path refid="runtime.src"/>
+    <path refid="test.src"/>
+  </path>
+
+  <target name="clean">
+    <delete dir="${build.root}"/>
+    <delete dir="ibderby"/>
+    <delete>
+      <fileset dir="./">
+        <include name="junit*.properties"/>
+        <include name="coverage.ec"/>
+        <include name="derby.log"/>
+      </fileset>
+    </delete>
+  </target>
+
+  <target name="prepare" depends="clean">
+    <mkdir dir="${build.root}"/>
+    <mkdir dir="${classes}"/>
+    <mkdir dir="${classes.test}"/>
+    <mkdir dir="${classes.instrumented}"/>
+    <mkdir dir="${reports.junit}"/>
+    <mkdir dir="${reports.coverage}"/>
+    <mkdir dir="${deploy.exploded}"/>
+    <mkdir dir="${deploy.dist}"/>
+    <!-- Prepare Release Docs -->
+    <propertyfile file="version.properties" comment="Build version info">
+      <entry key="buildDate" type="date" value="now"/>
+      <entry key="buildNum" default="0" type="int" operation="+" value="1"/>
+    </propertyfile>
+  </target>
+
+  <target name="compile" depends="prepare">
+    <javac srcdir="${src.dir}" destdir="${classes}" classpathref="classpath" deprecation="false" debug="true"/>
+    <copy todir="${classes}">
+      <fileset dir="${src.dir}" >
+        <exclude name="**/*.java"/>
+      </fileset>
+    </copy>
+    <javac srcdir="${test.dir}" destdir="${classes.test}" classpathref="classpath" deprecation="false" debug="true"/>
+    <copy todir="${classes.test}">
+      <fileset dir="${test.dir}" >
+        <exclude name="**/*.java"/>
+      </fileset>
+    </copy>
+  </target>
+
+  <target name="test.instrument" depends="compile">
+    <emma>
+      <instr instrpathref="classes-to-instrument"
+        destdir="${classes.instrumented}"
+        metadatafile="./coverage.ec"
+        merge="true"/>
+    </emma>
+  </target>
+
+  <target name="test.run" depends="test.instrument">
+    <junit printsummary="true" showoutput="true">
+      <formatter type="xml"/>
+      <batchtest todir="${reports.junit}" fork="yes" haltonerror="no" failureproperty="testsFailed">
+        <fileset dir="${classes.test}">
+          <include name="**/*Test.class"/>
+          <exclude name="**/Base*Test.class"/>
+        </fileset>
+      </batchtest>
+      <classpath path="${classes.instrumented}"/>
+      <classpath refid="classpath"/>
+    </junit>
+  </target>
+
+  <target name="test.report" depends="test.run" >
+    <junitreport todir="${reports.junit}">
+      <fileset dir="${reports.junit}">
+        <include name="TEST-*.xml"/>
+      </fileset>
+      <report format="frames" todir="${reports.junit}"/>
+    </junitreport>
+  </target>
+
+  <target name="test.coverage" depends="test.report" >
+    <emma>
+      <report sourcepath="${src.dir}"
+        sort="+block,+name,+method,+class"
+        metrics="method:70,block:80,line:80,class:100"
+        >
+        <fileset dir="./">
+          <include name="*.ec"/>
+        </fileset>
+        <html outfile="${reports.coverage}/coverage.html"
+          depth="method"
+          columns="name,class,method,block,line"
+          />
+      </report>
+    </emma>
+  </target>
+
+  <target name="dist.jar.lib" depends="compile">
+    <property file="version.properties"/>
+    <jar jarfile="${deploy.exploded}/${module}-${version}.${buildNum}.jar">
+      <manifest>
+        <attribute name="Built-On" value="${buildDate}"/>
+	      <section name="${module}">
+          <attribute name="Implementation-Title" value="${module}"/>
+          <attribute name="Implementation-Version" value="${version} build# ${buildNum}"/>
+          <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
+        </section>
+      </manifest>
+      <fileset dir="${classes}"/>
+      <fileset dir="./">
+        <include name="LICENSE"/>
+        <include name="NOTICE"/>
+      </fileset>
+    </jar>
+  </target>
+
+  <target name="dist.jar.src" depends="compile">
+    <property file="version.properties"/>
+    <jar jarfile="${deploy.exploded}/${module}-src-${version}.${buildNum}.zip">
+      <manifest>
+        <attribute name="Built-On" value="${buildDate}"/>
+	      <section name="${module}">
+          <attribute name="Implementation-Title" value="${module}"/>
+          <attribute name="Implementation-Version" value="${version} build# ${buildNum}"/>
+          <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
+        </section>
+      </manifest>
+      <fileset dir="${src.dir}"/>
+      <fileset dir="./">
+        <include name="LICENSE"/>
+        <include name="NOTICE"/>
+      </fileset>
+    </jar>
+  </target>
+
+  <target name="dist.assemble" depends="dist.jar.lib,dist.jar.src">
+    <copy todir="${deploy.exploded}">
+      <fileset dir="./">
+        <include name="LICENSE"/>
+        <include name="NOTICE"/>
+      </fileset>
+    </copy>
+  </target>
+
+  <target name="dist" depends="dist.assemble">
+    <property file="version.properties"/>
+    <jar jarfile="${deploy.dist}/${module}-${version}.${buildNum}.zip">
+      <fileset dir="${deploy.exploded}"/>
+    </jar>
+  </target>
+
+  <target name="all" depends="test.coverage,dist">
+    <fail if="testsFailed" message="The tests did not pass"/>
+  </target>
+
+</project>

Added: ibatis/trunk/java/ibatis-3/version.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/version.properties?rev=731175&view=auto
==============================================================================
--- ibatis/trunk/java/ibatis-3/version.properties (added)
+++ ibatis/trunk/java/ibatis-3/version.properties Sat Jan  3 20:55:08 2009
@@ -0,0 +1,5 @@
+#Build version info
+#Sat Jan 03 21:48:44 MST 2009
+version=3.0.0
+buildDate=2009/01/03 21\:48
+buildNum=102