netbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] JaroslavTulach commented on a change in pull request #172: [NETBEANS-54] Module Review o.apache.xml.resolver
Date Thu, 01 Jan 1970 00:00:00 GMT
JaroslavTulach commented on a change in pull request #172: [NETBEANS-54] Module Review o.apache.xml.resolver
URL: https://github.com/apache/incubator-netbeans/pull/172#discussion_r146254955
 
 

 ##########
 File path: o.apache.xml.resolver/build.xml
 ##########
 @@ -20,5 +20,43 @@
 
 -->
 <project name="o.apache.xml.resolver" default="netbeans" basedir=".">
+
     <import file="../nbbuild/templates/projectized.xml"/>
+
+    <!-- A task to check if the binary 'external/resolver-1.2.jar exists -->
+    <target name="-check-requires-patching-maven-sources">
+        <available file="external/resolver-1.2.jar" property="sources-already-patched"
/>
+    </target>
+
+    <!-- 
+         '-javac-init' task is invoked after maven sources have been downloaded 
+         to 'external/xml-resolver-1.2-sources.jar'
+         (see external/binaries-list).
+         Then if 'external/resolver-1.2.jar does NOT exist...
+    -->
+    <target name="-prepare-patched-binary" depends="-check-requires-patching-maven-sources"
unless="sources-already-patched">
+        <echo message="Patching xml-resolver-1.2-sources.jar for Netbeans..." />
+        <!-- ... 1. Prepares a 'build/external-patch/[sources|classes]' working directories
-->
+        <delete dir="build/external-patch" />
+        <mkdir dir="build/external-patch/sources" />
+        <!-- ... 2. Unzips maven sources -->
+        <unzip src="external/xml-resolver-1.2-sources.jar" dest="build/external-patch/sources"
/>
+        <!-- ... 3. Applies patch 'external/xml-resolver-1.2-netbeans.patch -->
+        <patch dir="build/external-patch/sources"
+            patchfile="external/xml-resolver-1.2-netbeans.patch"
+            strip="0" />
+        <!-- ... 4. Compiles sources to build/external-patch/classes -->
+        <mkdir dir="build/external-patch/classes" />
+        <javac srcdir="build/external-patch/sources"
+            destdir="build/external-patch/classes" >
+            <exclude name="org/apache/xml/resolver/tests/**" />
+        </javac>
+        <!-- ... 5. Creates a jar in 'external/resolver-1.2.jar' -->
+        <jar destfile="external/resolver-1.2.jar">
+            <fileset dir="build/external-patch/classes" />
+        </jar>
 
 Review comment:
   Looks like a clean way to solve the need for patches. Should this be more common, it would
be good to move most of the script into `projectized.xml` and just configure it with properties
from `nbproject/project.properties`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message