Skip to content

Commit 87423da

Browse files
committed
Ant build script reorganization for patches and clean-netbeans
1. Placed patch files in separate lines to ease merges and reduce conflicts. 2. Added string parsing and trimming of the patches list to allow for placing patch files in separate lines. - Also added a check for empty patch list when applying or unapplying the patches. 3. Added a "clean-netbeans" target, similar to the "build-netbeans" target, to help in cleaning just the netbeans build artifacts. Signed-off-by: Siddharth Srinivasan <[email protected]>
1 parent e3b3877 commit 87423da

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

build.xml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,37 @@
3131
<property name="nbplatform.default.harness.dir" location="${nbplatform.default.netbeans.dest.dir}/harness" />
3232
<property name="nbantext.jar" location="netbeans/nbbuild/build/nbantext.jar" />
3333
<property name="nb_all" location="netbeans" />
34-
<property name="patches" value="patches/6330.diff patches/7001.diff patches/7271.diff patches/7353.diff patches/7368.diff patches/7370.diff patches/7382.diff patches/7491-preliminary.diff patches/7543.diff patches/7548.diff patches/7621.diff patches/7583.diff patches/mvn-sh.diff patches/generate-dependencies.diff patches/rename-debugger.diff patches/remove-db.diff patches/nbjavac-not-required.diff" />
34+
<loadresource property="patch-files">
35+
<string>
36+
patches/6330.diff
37+
patches/7001.diff
38+
patches/7271.diff
39+
patches/7353.diff
40+
patches/7368.diff
41+
patches/7370.diff
42+
patches/7382.diff
43+
patches/7491-preliminary.diff
44+
patches/7543.diff
45+
patches/7548.diff
46+
patches/7621.diff
47+
patches/7583.diff
48+
patches/mvn-sh.diff
49+
patches/generate-dependencies.diff
50+
patches/rename-debugger.diff
51+
patches/remove-db.diff
52+
patches/nbjavac-not-required.diff
53+
</string>
54+
<filterchain>
55+
<tokenfilter delimoutput=" ">
56+
<replaceregex pattern="\s+" replace=""/>
57+
</tokenfilter>
58+
</filterchain>
59+
</loadresource>
60+
<property name="patches" value="${patch-files}"/>
61+
<condition property="has-patches">
62+
<length string="${patches}" trim="true" when="greater" length="0"/>
63+
</condition>
64+
3565
<condition property="cmd.suffix" value=".cmd" else="">
3666
<os family="windows"/>
3767
</condition>
@@ -175,7 +205,8 @@
175205
</exec>
176206
</target>
177207

178-
<target name="apply-patches">
208+
<target name="apply-patches" if="has-patches">
209+
<echo>${patches}</echo>
179210
<exec executable="git">
180211
<arg value="apply"/>
181212
<arg value="--directory=netbeans"/>
@@ -184,7 +215,7 @@
184215
</exec>
185216
</target>
186217

187-
<target name="unapply-patches">
218+
<target name="unapply-patches" if="has-patches">
188219
<!--in the reverse order:-->
189220
<echo file="${build.dir}/Reverse.java">
190221
import java.util.Arrays;
@@ -218,6 +249,10 @@
218249
<ant dir="netbeans" inheritAll="false" inheritRefs="false" useNativeBasedir="true"/>
219250
</target>
220251

252+
<target name="clean-netbeans">
253+
<ant dir="netbeans" target="clean" inheritAll="false" inheritRefs="false" useNativeBasedir="true"/>
254+
</target>
255+
221256
<target name="generate-netbeans-license-summary" depends="-set-use-jdk-javac,proxy-setup" description="Generate license summary">
222257
<delete dir="${build.dir}/nblic" />
223258
<mkdir dir="${build.dir}/nblic/nbcode" />

0 commit comments

Comments
 (0)