logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carn...@apache.org
Subject svn commit: r1161367 - /logging/log4j/companions/component/trunk/build.xml
Date Thu, 25 Aug 2011 02:53:11 GMT
Author: carnold
Date: Thu Aug 25 02:53:11 2011
New Revision: 1161367

URL: http://svn.apache.org/viewvc?rev=1161367&view=rev
Log:
Reverting rev 1161366 due to Gump breakage

Modified:
    logging/log4j/companions/component/trunk/build.xml

Modified: logging/log4j/companions/component/trunk/build.xml
URL: http://svn.apache.org/viewvc/logging/log4j/companions/component/trunk/build.xml?rev=1161367&r1=1161366&r2=1161367&view=diff
==============================================================================
--- logging/log4j/companions/component/trunk/build.xml (original)
+++ logging/log4j/companions/component/trunk/build.xml Thu Aug 25 02:53:11 2011
@@ -28,9 +28,100 @@ Specify -Dcompanion.jar=foo.jar to test 
     <!--  use build.properties file or command line to override these properties  -->
     <property file="build.properties"/>
 	
-	<property name="svnsite.url" value="https://svn.apache.org/repos/asf/logging/site/trunk/docs/log4j/companions/component"/>
+	<!--  project details  -->
+    <property name="project.name" value="apache-log4j-component"/>
+    <property name="project.title" value="Apache Component Companion for log4j 1.2."/>
+    <property name="project.version" value="1.0"/>
+    <property name="project.jar" value="${project.name}-${project.version}.jar"/>
+    
+    <!--  Location of local Maven 2 repository   -->
+    <property name="m2_repo" location="${user.home}/.m2/repository"/>
+
+	<!--  Versions for dependencies   -->
+    <property name="log4j.version" value="1.2.15"/>
+    <property name="junit.version" value="3.8.1"/>
+	
+	<!--  Dependency locations - assumed to be in Maven 2 repository   -->
+    <property name="junit.jar" 
+       location="${m2_repo}/junit/junit/${junit.version}/junit-${junit.version}.jar"/>
+    <property name="log4j.jar" 
+       location="${m2_repo}/log4j/log4j/${log4j.version}/log4j-${log4j.version}.jar"/>
+
+    <!--   Java compiler settings   -->
+    <property name="javac.source" value="1.2"/>
+    <property name="javac.target" value="1.1"/>   
+    <property name="javac.deprecation" value="true"/>
+    <property name="javac.debug" value="true"/>
+	
+    <property name="svnrepo.url" value="https://svn.apache.org/repos/asf"/>
+	<property name="svnsite.url" value="${svnrepo.url}/logging/site/trunk/docs/log4j/companions/component"/>
 	<available property="svn-available" file="target/site-deploy/.svn"/>
 	
+       
+    <target name="init"/>
+    
+    <target name="clean" depends="init" description="Clean up generated files">
+    	<delete dir="target"/>
+    </target>
+    
+    
+    <target name="compile" depends="init" unless="companion.jar" description="Compile
implementation files">
+        <mkdir dir="target/classes"/>
+    	<javac destdir="target/classes"
+           srcdir="src/main/java"
+    	   deprecation="${javac.deprecation}"
+    	   debug="${javac.debug}"
+    	   target="${javac.target}"
+    	   source="${javac.source}"
+    	   classpath="${log4j.jar}"/>
+    	<copy todir="target/classes" overwrite="true">
+    	    <fileset dir="src/main/resources"/>
+    	</copy>
+    </target>
+    
+    <target name="jar" depends="compile" unless="companion.jar" description="Create jar">
+    	<jar destfile="target/${project.jar}"
+    	     basedir="target/classes">
+    	  	<manifest>
+    			<attribute name="Built-By" value="${user.name}"/>
+    			<section name="common">
+      				<attribute name="Implementation-Title" value="${project.title}"/>
+      				<attribute name="Implementation-Version" value="${project.version}"/> 
+      				<attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
+    			</section>
+    		</manifest>    	     
+    	</jar>
+    </target>    
+
+    <target name="test-compile" depends="jar" description="Compile test files">
+	    <property name="companion.jar" value="target/${project.jar}"/>
+        <mkdir dir="target/test-classes"/>
+    	<javac destdir="target/test-classes"
+           srcdir="src/test/java"
+    	   deprecation="${javac.deprecation}"
+    	   debug="${javac.debug}"
+    	   target="${javac.target}"
+    	   source="${javac.source}"
+    	   classpath="${companion.jar}:${log4j.jar}:${junit.jar}"/>
+    	<copy todir="target/test-classes" overwrite="true">
+    		<fileset dir="src/test/resources"/>
+    	</copy>
+    </target>    
+
+
+    <target name="test" depends="test-compile" description="Run unit tests">
+    	<junit printsummary="yes" fork="true" dir="target">
+    	    <classpath path="target/test-classes:${companion.jar}:${log4j.jar}:${junit.jar}"/>
+    		<batchtest>
+    			<fileset dir="src/test/java/">
+    				<include name="**/Test*.java"/>
+    				<include name="**/*TestCase.java"/>
+    			</fileset>
+    	    </batchtest>
+    	    <formatter type="plain" usefile="false"/>
+    	</junit>
+    </target>    
+	
 	<target name="checkout-site" unless="svn-available">
 		<exec executable="svn">
 			<arg value="co"/>
@@ -46,8 +137,10 @@ Specify -Dcompanion.jar=foo.jar to test 
 	</target>
 
 	<target name="post-site" depends="checkout-site, update-site"/>
+
+
         <target name="mime=html">
-        <exec executable="svn">
+            <exec executable="svn">
 		<arg value="propset"/>
                 <arg value="svn:mime-type"/>
                 <arg value="text/html"/>
@@ -56,32 +149,32 @@ Specify -Dcompanion.jar=foo.jar to test 
         </target>
 
         <target name="mime=css">
-        <exec executable="svn">
+            <exec executable="svn">
 		<arg value="propset"/>
                 <arg value="svn:mime-type"/>
                 <arg value="text/css"/>
                 <arg value="${src.css}"/>
             </exec>
-    </target>
+        </target>
+	
 
 	<target name="site-deploy">
 		<!-- Add any new files (and generate innocuous warnings for the existing content)  -->
-        <delete file="target/site-deploy/svn-commit.tmp~"/>
+                <delete file="target/site-deploy/svn-commit.tmp~"/>
 		<exec executable="bash" dir="target/site-deploy" failonerror="true">
 			<arg line='-c "svn add --force *"'/>
 		</exec>
-       
-	    <taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" />
-        <foreach target="mime=html" param="src.html">
-            <path>
-                <fileset dir="target/site-deploy" includes="**/*.html"/>
-            </path>
-         </foreach>
-         <foreach target="mime=css" param="src.css">
-            <path>
-                <fileset dir="target/site-deploy" includes="**/*.css"/> 
-            </path>
-         </foreach>
+                <taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" />
+                <foreach target="mime=html" param="src.html">
+                        <path>
+                                <fileset dir="target/site-deploy" includes="**/*.html"/>
+                        </path>
+                </foreach>
+                <foreach target="mime=css" param="src.css">
+                        <path>
+                                <fileset dir="target/site-deploy" includes="**/*.css"/>
+                        </path>
+                </foreach>
 		<!--  requires that SVN_EDITOR, VISUAL or EDITOR being set to edit commit description
-->
 		<exec executable="svn" dir="target/site-deploy" failonerror="true">
 		    <arg value="commit"/>



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message