You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ca...@apache.org on 2007/05/15 02:43:20 UTC

svn commit: r538030 - in /logging/log4j/branches/v1_2-branch: ./ src/main/java/org/apache/log4j/nt/ src/ntdll/

Author: carnold
Date: Mon May 14 17:43:19 2007
New Revision: 538030

URL: http://svn.apache.org/viewvc?view=rev&rev=538030
Log:
Bug 37930: Maven now builds NTEventLogAppender.dll

Added:
    logging/log4j/branches/v1_2-branch/src/ntdll/   (with props)
    logging/log4j/branches/v1_2-branch/src/ntdll/EventLogCategories.mc
      - copied unchanged from r537960, logging/log4j/branches/v1_2-branch/src/main/java/org/apache/log4j/nt/EventLogCategories.mc
    logging/log4j/branches/v1_2-branch/src/ntdll/MSG00001.bin
      - copied unchanged from r537960, logging/log4j/branches/v1_2-branch/src/main/java/org/apache/log4j/nt/MSG00001.bin
    logging/log4j/branches/v1_2-branch/src/ntdll/NTEventLogAppender.rc
      - copied unchanged from r537960, logging/log4j/branches/v1_2-branch/src/main/java/org/apache/log4j/nt/NTEventLogAppender.rc
    logging/log4j/branches/v1_2-branch/src/ntdll/build.xml   (with props)
    logging/log4j/branches/v1_2-branch/src/ntdll/nteventlog.cpp
      - copied unchanged from r537960, logging/log4j/branches/v1_2-branch/src/main/java/org/apache/log4j/nt/nteventlog.cpp
Removed:
    logging/log4j/branches/v1_2-branch/src/main/java/org/apache/log4j/nt/EventLogCategories.mc
    logging/log4j/branches/v1_2-branch/src/main/java/org/apache/log4j/nt/MSG00001.bin
    logging/log4j/branches/v1_2-branch/src/main/java/org/apache/log4j/nt/NTEventLogAppender.rc
    logging/log4j/branches/v1_2-branch/src/main/java/org/apache/log4j/nt/nteventlog.cpp
Modified:
    logging/log4j/branches/v1_2-branch/build.xml
    logging/log4j/branches/v1_2-branch/pom.xml

Modified: logging/log4j/branches/v1_2-branch/build.xml
URL: http://svn.apache.org/viewvc/logging/log4j/branches/v1_2-branch/build.xml?view=diff&rev=538030&r1=538029&r2=538030
==============================================================================
--- logging/log4j/branches/v1_2-branch/build.xml (original)
+++ logging/log4j/branches/v1_2-branch/build.xml Mon May 14 17:43:19 2007
@@ -360,15 +360,44 @@
     </target>
 
 
+    <target name="compile.ntdll">
+		<javah class="org.apache.log4j.nt.NTEventLogAppender,org.apache.log4j.Priority"
+           destdir="${target.dir}"
+           classpath="${compile.classpath}"/>
+    
+		<exec executable="windres"   dir="${java.source.dir}/org/apache/log4j/nt/">
+      <arg value="-o"/>
+      <arg file="${javac.dest}/NTEventLogAppender.o"/>
+      <arg file="${java.source.dir}org/apache/log4j/nt/NTEventLogAppender.rc"/>
+    </exec>
+    
+    <property name="jni.include.dir" location="${java.home}\..\include"/>
+    <exec executable="gcc">
+      <arg value="-Wall"/>
+      <arg value="-D_JNI_IMPLEMENTATION_"/>
+      <arg value="-Wl,--kill-at"/>
+      <arg value="-I${jni.include.dir}"/>
+      <arg value="-I${jni.include.dir}\win32"/>
+      <arg value="-I${javac.dest}"/>
+      <arg value="-shared"/>
+      <arg file="${java.source.dir}org/apache/log4j/nt/nteventlog.cpp"/>
+      <arg file="${javac.dest}/NTEventLogAppender.o"/>
+      <arg value="-o"/>
+      <arg file="${jar.dest}/NTEventLogAppender.dll"/>
+    </exec>
+    
+  </target>
+
+
     <target name="build.nt" depends="log4j.jar" description="Build NTEventLogAppender.dll">
     <javah class="org.apache.log4j.nt.NTEventLogAppender,org.apache.log4j.Priority"
            destdir="${javac.dest}"
            classpath="${jar.dest}/${jar.filename}"/>
     
-    <exec executable="windres"   dir="${java.source.dir}/org/apache/log4j/nt/">
+    <exec executable="windres"   dir="src/ntdll">
       <arg value="-o"/>
       <arg file="${javac.dest}/NTEventLogAppender.o"/>
-      <arg file="${java.source.dir}org/apache/log4j/nt/NTEventLogAppender.rc"/>
+      <arg file="src/ntdll/NTEventLogAppender.rc"/>
     </exec>
     
     <property name="jni.include.dir" location="${java.home}\..\include"/>
@@ -380,7 +409,7 @@
       <arg value="-I${jni.include.dir}\win32"/>
       <arg value="-I${javac.dest}"/>
       <arg value="-shared"/>
-      <arg file="${java.source.dir}org/apache/log4j/nt/nteventlog.cpp"/>
+      <arg file="src/ntdll/nteventlog.cpp"/>
       <arg file="${javac.dest}/NTEventLogAppender.o"/>
       <arg value="-o"/>
       <arg file="${jar.dest}/NTEventLogAppender.dll"/>

Modified: logging/log4j/branches/v1_2-branch/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/branches/v1_2-branch/pom.xml?view=diff&rev=538030&r1=538029&r2=538030
==============================================================================
--- logging/log4j/branches/v1_2-branch/pom.xml (original)
+++ logging/log4j/branches/v1_2-branch/pom.xml Mon May 14 17:43:19 2007
@@ -113,6 +113,28 @@
           </archive>
         </configuration>
       </plugin>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+		  <!--   generate NTEventLogAppender.dll    -->
+          <execution>
+            <phase>process-classes</phase>
+			<id>ntdll</id>
+            <configuration>
+              <tasks>
+				  <ant antfile="src/ntdll/build.xml">
+					  <property name="target.dir" location="target"/>
+					  <property name="classes.dir" location="target/classes"/>
+					  <property name="src.dir" location="src/ntdll"/>
+				  </ant>
+			  </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>	  
     </plugins>      
     <testSourceDirectory>tests/src/java</testSourceDirectory>
 </build>

Propchange: logging/log4j/branches/v1_2-branch/src/ntdll/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon May 14 17:43:19 2007
@@ -0,0 +1 @@
+target

Added: logging/log4j/branches/v1_2-branch/src/ntdll/build.xml
URL: http://svn.apache.org/viewvc/logging/log4j/branches/v1_2-branch/src/ntdll/build.xml?view=auto&rev=538030
==============================================================================
--- logging/log4j/branches/v1_2-branch/src/ntdll/build.xml (added)
+++ logging/log4j/branches/v1_2-branch/src/ntdll/build.xml Mon May 14 17:43:19 2007
@@ -0,0 +1,77 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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="ntdll" default="build" basedir=".">
+   <property name="target.dir" value="target"/>
+   <property name="object.dir" value="target/classes"/>
+   <property name="src.dir" location="${basedir}"/>
+   <property name="classes.dir" location="../../target/classes"/>
+   <property name="failonerror" value="false"/>
+   <property name="failifexecutionfails" value="${failonerror}"/>
+
+   <target name="clean" description="Deletes generated files">
+        <delete dir="${target.dir}"/>
+   </target>
+
+   <target name="windres" description="Compiles resources">
+        <mkdir dir="${object.dir}"/>
+    	<exec executable="windres"
+	   dir="${src.dir}"
+	   resultproperty="windres_status"
+	   failonerror="${failonerror}"
+	   failifexecutionfails="${failifexecutionfails}">
+      		<arg value="-o"/>
+      		<arg file="${object.dir}/NTEventLogAppender.o"/>
+      		<arg file="${src.dir}/NTEventLogAppender.rc"/>
+    	</exec>
+        <condition property="windres_success">
+	     <equals arg1="${windres_status}" arg2="0"/>
+        </condition>
+   </target>
+
+   <target name="compile" depends="windres" if="windres_success">
+    <javah class="org.apache.log4j.nt.NTEventLogAppender,org.apache.log4j.Priority"
+           destdir="${object.dir}"
+           classpath="${classes.dir}"/>
+    
+    <property name="jni.include.dir" location="${java.home}\..\include"/>
+    <exec executable="gcc">
+      <arg value="-Wall"/>
+      <arg value="-D_JNI_IMPLEMENTATION_"/>
+      <arg value="-Wl,--kill-at"/>
+      <arg value="-I${jni.include.dir}"/>
+      <arg value="-I${jni.include.dir}\win32"/>
+      <arg value="-I${object.dir}"/>
+      <arg value="-shared"/>
+      <arg file="${src.dir}/nteventlog.cpp"/>
+      <arg file="${object.dir}/NTEventLogAppender.o"/>
+      <arg value="-o"/>
+      <arg file="${target.dir}/NTEventLogAppender.dll"/>
+    </exec>
+   </target>
+
+   <target name="warn" depends="windres" unless="windres_success">
+	<echo>windres could not be found or failed.  
+MinGW toolkit must be on path to build NTEventLogAppender.dll</echo>
+   </target>
+
+   <target name="build" depends="compile, warn">
+   </target>
+
+</project>
\ No newline at end of file

Propchange: logging/log4j/branches/v1_2-branch/src/ntdll/build.xml
------------------------------------------------------------------------------
    svn:executable = *



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