There are a few places in the build where only windows systems are catered for. Here's one. It is in the 6.1.x branch from github.
In portal/portal-impl/build.xml is this fragment:
1
2 <target name="build-icu4j">
3 <tstamp>
4 <format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />
5 </tstamp>
6
7 <unzip src="${project.dir}/tools/icu4j-4_0_1-src.jar" dest="${tstamp.value}" />
8
9 <move file="${tstamp.value}/src/com/ibm" todir="${tstamp.value}/src/com/liferay" />
10
11 <replace dir="${tstamp.value}" includes="build.xml,**/*.java,**/*.properties">
12 <replacefilter token="com.ibm" value="com.liferay.ibm" />
13 <replacefilter token="com/ibm" value="com/liferay/ibm" />
14 </replace>
15
16 <replace file="${tstamp.value}/build.xml">
17 <replacetoken><![CDATA[<unjar src="${icudatajar.file}" dest="${build.dir}" />]]></replacetoken>
18 <replacevalue><![CDATA[<unjar src="${icudatajar.file}" dest="${build.dir}" />
19 <move file="classes/com/ibm" todir="classes/com/liferay" />]]></replacevalue>
20 </replace>
21
22 <!--
23 Use exec because of a bug with com.liferay.ibm.icu.dev.tool.index.IndexGenerator
24 not picking up the correct base directory.
25
26 <ant dir="${tstamp.value}" target="core" inheritAll="false" />
27 <ant dir="${tstamp.value}" target="jar" inheritAll="false" />-->
28
29 <exec dir="${tstamp.value}" executable="cmd.exe" os="${os.windows}">
30 <arg line="/c ant core jar" />
31 </exec>
32
33 <move file="${tstamp.value}/icu4j.jar" tofile="${project.dir}/lib/portal/liferay-icu4j.jar.new" />
34
35 <delete dir="${tstamp.value}" />
36 </target>
Three things stand out here.
1) Why the windows-only exec? There is a section of the ant manual call "Running Ant in Java" which describes how to "exec" ant from within ant using the <java/> task. That is, how to perform the above windows-only action in an os-independent manner.
2) Why the changes to the package definition of icu4j? There are only a couple of places in the code where packages beginning com.liferay.ibm are used. So why not just bundle icu4j and be done with it?
3) The distribution packages, and then hacks, the icu4j sources for version 4.0.1. The current version is 49.1 (equivalent to 4.9.1 - the numbering system has been modified.) The hack above no longer works with the current icu4j build files. That seems like another reason to just bundle iuc4j.
So, why is it being done this way?
Please sign in to flag this as inappropriate.