Skip to content

Commit 7b8a8d6

Browse files
committed
core-js: build.xml: use eclipse.bin to beautify the repackaged code :)
1 parent 6b7f8e5 commit 7b8a8d6

File tree

3 files changed

+315
-2
lines changed

3 files changed

+315
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/target
22
/lib
3+
/build.properties

build.xml

+23-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
htmlunit-core-js is a Rhino fork containing patches that haven't (yet) been
66
applied in Rhino but that are needed for HtmlUnit.
77
8-
The build file tries to ensure that no patch is kept when it is not needed anymore.
9-
108
CAUTION: before to release, the rhinoDiff.txt needs to be generated to respect
119
the terms of the MPL.
1210
11+
"eclipse.bin" should be defined in 'build.properties', and is used to beautify the source code.
12+
1313
Marc Guillemot
1414
Ahmed Ashour
1515
====================================================================== -->
@@ -19,6 +19,7 @@ Ahmed Ashour
1919

2020
<property name="target-jvm" value="1.5"/>
2121
<property name="source-level" value="1.5"/>
22+
<property file="build.properties"/>
2223
<property name="rhino.basedir" location="../htmlunit-rhino-fork"/>
2324
<property name="classes" value="${rhino.basedir}/build/classes"/>
2425
<property name="repackaged-rhino.dir" value="target/repackaged-rhino"/>
@@ -61,6 +62,8 @@ Ahmed Ashour
6162
<replace dir="${corejs.dir}" token="org.mozilla" value="net.sourceforge.htmlunit.corejs"/>
6263
<replace dir="${corejs.dir}" token="org/mozilla" value="net/sourceforge/htmlunit/corejs"/>
6364

65+
<antcall target="beautify"/>
66+
6467
<mkdir dir='${repackaged-rhino.dir}/classes'/>
6568
<javac destdir='${repackaged-rhino.dir}/classes' debug='true' encoding="ISO-8859-1" source='1.5' target='1.5' includeAntRuntime='false'>
6669
<src path='${repackaged-rhino.dir}/src' />
@@ -72,6 +75,24 @@ Ahmed Ashour
7275
</copy>
7376
</target>
7477

78+
<target name="beautify" depends="beautify-check" if="eclipse.bin">
79+
<exec executable="${eclipse.bin}" failonerror="true">
80+
<arg value="-nosplash"/>
81+
<arg value="-application"/>
82+
<arg value="org.eclipse.jdt.core.JavaCodeFormatter"/>
83+
<arg value="-verbose"/>
84+
<arg value="-config"/>
85+
<arg value="eclipse.formatter.prefs"/>
86+
<arg value="${repackaged-rhino.dir}/src/"/>
87+
</exec>
88+
</target>
89+
90+
<target name="beautify-check" unless="eclipse.bin">
91+
<echo message="*******************************************************************"/>
92+
<echo message="&quot;eclipse.bin&quot; is not defined, skipping beautifying the source code."/>
93+
<echo message="*******************************************************************"/>
94+
</target>
95+
7596
<target name="jar-with-source" depends="repackage, generate-rhino-diff">
7697
<basename property="rhino.diff.filename" file="${rhino.diff}"/>
7798
<dirname property="rhino.diff.dirname" file="${rhino.diff}"/>

0 commit comments

Comments
 (0)