Updated dist method to reflect modern practice. Added optional isolated compilation for releases (requires a pre-1.4 JVM to run the ant tasks and the executable.javac1.4 build property to be set). Artifacts are built in new subdirectory with file ending standardisation. Ant lacks a svn task so will consider whether the source artifacts should also be created by dist.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@372020 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -38,3 +38,8 @@ junit.jar=lib/junit-3.8.1.jar
|
||||
# Those committers using agents may like to use
|
||||
#maven.username=rdonkin
|
||||
#logging.cvs=lserver:rdonkin@cvs.apache.org:/home/cvs
|
||||
|
||||
|
||||
# The path to a 1.4 JSDK javac
|
||||
# Optional - used when building with a 1.2 JVM for releases
|
||||
# executable.javac1.4=/opt/java/jdks/j2sdk1.4.2_10/bin/javac
|
||||
|
||||
76
build.xml
76
build.xml
@@ -33,6 +33,11 @@
|
||||
- * run ant as "ant -lib path-to-junit-jar"
|
||||
- * put the junit jar in $CLASSPATH
|
||||
-
|
||||
- Note when building JCL for release it is strongly recommended that a 1.2 JVM
|
||||
- is used for the main compile and the home.jdk4 property used to specify
|
||||
- the path to a 1.4 J2SDK. This will be used to compile those classes
|
||||
- which require the 1.4 API.
|
||||
-
|
||||
- $Id$
|
||||
-->
|
||||
|
||||
@@ -98,18 +103,24 @@
|
||||
<!-- The base directory for distribution targets -->
|
||||
<property name="dist.home" value="dist"/>
|
||||
|
||||
<!-- The base directory for releases -->
|
||||
<property name="artifacts.home" value="artifacts"/>
|
||||
|
||||
<!-- The base directory for component sources -->
|
||||
<property name="source.home" value="src/java"/>
|
||||
|
||||
<!-- The base directory for unit test sources -->
|
||||
<property name="test.home" value="src/test"/>
|
||||
|
||||
|
||||
<!-- jar names -->
|
||||
<property name="core.jar.name" value="commons-${component.name}-${component.version}.jar"/>
|
||||
<property name="api.jar.name" value="commons-${component.name}-api-${component.version}.jar"/>
|
||||
<property name="adapters.jar.name" value="commons-${component.name}-adapters-${component.version}.jar"/>
|
||||
|
||||
<!-- dist names -->
|
||||
<property name="windows.dist.name" value="commons-${component.name}-${component.version}.zip"/>
|
||||
<property name="nix.dist.name" value="commons-${component.name}-${component.version}.tar.gz"/>
|
||||
|
||||
<!-- ========== Compiler Defaults ========================================= -->
|
||||
|
||||
<!-- Version of java class files to generate. -->
|
||||
@@ -236,8 +247,6 @@
|
||||
<mkdir dir="${build.home}"/>
|
||||
<mkdir dir="${build.home}/classes"/>
|
||||
<mkdir dir="${build.home}/conf"/>
|
||||
<mkdir dir="${build.home}/docs"/>
|
||||
<mkdir dir="${build.home}/docs/api"/>
|
||||
<mkdir dir="${build.home}/tests"/>
|
||||
</target>
|
||||
|
||||
@@ -313,7 +322,7 @@
|
||||
</target>
|
||||
|
||||
<target name='warning'
|
||||
depends='log4j12-warning,log4j13-warning,logkit-warning,jdk1.4-warning,avalon-framework-warning'/>
|
||||
depends='log4j12-warning,log4j13-warning,logkit-warning,jdk1.4-warning,avalon-framework-warning,compile-1.4'/>
|
||||
|
||||
<target name="compile-only"
|
||||
depends="prepare,discovery,warning,show-lib-presence,compile-non-log4j,compile-log4j12,compile-log4j13,build-jar"/>
|
||||
@@ -351,6 +360,38 @@
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="compile-1.4" depends="prepare,discovery,compile-non-log4j" if='executable.javac1.4'>
|
||||
<!--
|
||||
Compiles those classes which require a 1.4+ JSDK.
|
||||
This target will only be executed when ant is running a pre-1.4 JVM
|
||||
and the home.jdk4 property is set.
|
||||
This configuration is typically used to create a release only.
|
||||
-->
|
||||
<echo message=""/>
|
||||
<echo message="************************************************************"/>
|
||||
<echo message=" Compiling 1.4 only classes using compiler@${executable.javac1.4}"/>
|
||||
<echo message="************************************************************"/>
|
||||
<echo message=""/>
|
||||
<javac srcdir="${source.home}"
|
||||
destdir="${build.home}/classes"
|
||||
debug="${compile.debug}"
|
||||
deprecation="${compile.deprecation}"
|
||||
optimize="${compile.optimize}"
|
||||
source="${source.version}"
|
||||
target="${target.version}"
|
||||
compiler='javac1.4'
|
||||
fork='yes'
|
||||
executable='${executable.javac1.4}'>
|
||||
|
||||
<classpath refid="compile.classpath"/>
|
||||
|
||||
<include name="org/apache/commons/logging/impl/Jdk13LumberjackLogger.java"
|
||||
unless="jdk.1.4.present"/>
|
||||
<include name="org/apache/commons/logging/impl/Jdk14Logger.java"
|
||||
unless="jdk.1.4.present"/>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="compile-log4j12" depends="prepare,discovery">
|
||||
<!-- compile the log4j1.2 support classes -->
|
||||
<javac srcdir="${source.home}"
|
||||
@@ -523,8 +564,11 @@
|
||||
|
||||
<target name="clean"
|
||||
description="Clean build and distribution directories">
|
||||
<delete dir="${build.home}"/>
|
||||
<delete includeemptydirs='yes'>
|
||||
<fileset dir="${build.home}" excludes='docs/**/*'/>
|
||||
</delete>
|
||||
<delete dir="${dist.home}"/>
|
||||
<delete dir="${artifacts.home}"/>
|
||||
</target>
|
||||
|
||||
|
||||
@@ -532,7 +576,7 @@
|
||||
description="Clean and compile all components"/>
|
||||
|
||||
|
||||
<target name="dist" depends="compile"
|
||||
<target name="dist" depends="all"
|
||||
description="Create binary distribution">
|
||||
|
||||
<!--
|
||||
@@ -561,6 +605,26 @@
|
||||
<copy todir="${dist.home}/src" filtering="on">
|
||||
<fileset dir="${source.home}"/>
|
||||
</copy>
|
||||
<mkdir dir="${dist.home}/docs"/>
|
||||
<copy todir="${dist.home}/docs">
|
||||
<fileset dir="${build.home}/docs"/>
|
||||
</copy>
|
||||
<mkdir dir="${artifacts.home}"/>
|
||||
<fixcrlf srcdir='${dist.home}' eol='dos' includes='**/*.txt,**/*.java,**/*.html'/>
|
||||
<zip destfile='${artifacts.home}/${windows.dist.name}'>
|
||||
<zipfileset dir='${dist.home}' prefix='commons-${component.name}-${component.version}'/>
|
||||
</zip>
|
||||
<fixcrlf srcdir='${dist.home}' eol='unix' includes='**/*.txt,**/*.java,**/*.html'/>
|
||||
<tar compression="gzip" destfile='${artifacts.home}/${nix.dist.name}'>
|
||||
<tarfileset dir='${dist.home}' prefix='commons-${component.name}-${component.version}'/>
|
||||
</tar>
|
||||
<copy todir="${artifacts.home}">
|
||||
<fileset dir="${build.home}">
|
||||
<include name="${core.jar.name}"/>
|
||||
<include name="${api.jar.name}"/>
|
||||
<include name="${adapters.jar.name}"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user