Author: nickboldt
Date: 2012-10-11 19:49:52 -0400 (Thu, 11 Oct 2012)
New Revision: 44453
Added:
trunk/build/aggregate/getArch.sh
Modified:
trunk/build/aggregate/build.xml
Log:
getArch and old build.xml script refactored into new location as target platform builder
no longer needs them
Modified: trunk/build/aggregate/build.xml
===================================================================
--- trunk/build/aggregate/build.xml 2012-10-11 22:54:22 UTC (rev 44452)
+++ trunk/build/aggregate/build.xml 2012-10-11 23:49:52 UTC (rev 44453)
@@ -508,18 +508,6 @@
</if>
</target>
- <target name="get.eclipse">
- <ant antfile="../target-platforms/scripts/build.xml"
target="get.eclipse">
- <property name="getArch"
value="${output.dir}/../../target-platforms/scripts/getArch.sh"/>
- <property name="eclipse.version" value="4.2.1" />
- <property name="eclipse.type" value="platform" />
- <property name="eclipse.URL"
value="http://www.eclipse.org/downloads/download.php?r=1&fil...
- <property name="downloadDir" value="${WORKINGDIR}"/>
- <property name="unpackDir" value="${tmpdir}"/>
- </ant>
- <var name="eclipseDir" value="${tmpdir}/eclipse"/>
- </target>
-
<target name="install.releng.tools" depends="get.eclipse">
<!-- install releng tools; want more verbose output? use -consolelog -debug -console
-->
<exec executable="${eclipseDir}/eclipse" failonerror="true"
dir="${eclipseDir}" timeout="300000" taskname="p2">
@@ -942,6 +930,83 @@
</antcall>
</target>
+ <target name="get.arch">
+ <condition property="ext" value="tar.gz"
else="zip">
+ <os family="unix" />
+ </condition>
+ <condition property="os1" value="linux-gtk"
else="win32">
+ <os family="unix" />
+ </condition>
+ <condition property="os" value="macosx-cocoa"
else="${os1}">
+ <os family="mac" />
+ </condition>
+ <if>
+ <os family="unix" />
+ <then>
+ <available file="getArch.sh"
property="getArchInSamePath"/>
+ <if>
+ <isset property="getArchInSamePath"/>
+ <then>
+ <property name="getArch" value="getArch.sh"/>
+ </then>
+ <else>
+ <property name="getArch"
value="${output.dir}/../getArch.sh"/>
+ </else>
+ </if>
+
+ <!-- Ant thinks that ${os.arch} == i386 for x86_64, so use `uname` instead -->
+ <exec executable="bash" outputproperty="arch">
+ <arg line="${getArch}" />
+ </exec>
+ </then>
+ <else>
+ <condition property="arch" value="x86_64"
else="">
+ <os arch="amd64" />
+ </condition>
+ </else>
+ </if>
+ </target>
+
+ <!-- TODO: replace this cruft with something less crufty - mojo? -->
+ <target name="get.eclipse" depends="get.arch">
+ <!-- NOTE: must use same platform (50M) or SDK (103M - 168M) version as feature
version on target platform, or will get install/update conflicts -->
+ <property name="eclipse.version" value="4.2.1" />
+ <property name="eclipse.type" value="platform" />
+ <property name="eclipse.URL"
value="http://www.eclipse.org/downloads/download.php?r=1&fil...
+ <property name="downloadDir" value="${WORKINGDIR}"/>
+ <property name="unpackDir" value="${tmpdir}"/>
+ <property name="eclipseDir" value="${tmpdir}/eclipse"/>
+ <!-- <property name="eclipse.version" value="M20120829-1000"
/>
+ <property name="eclipse.type" value="platform" />
+ <property name="eclipse.URL"
value="http://www.eclipse.org/downloads/download.php?r=1&fil...
-->
+ <if>
+ <equals arg1="${arch}" arg2="x86" />
+ <then>
+ <property name="eclipse.file"
value="eclipse-${eclipse.type}-${eclipse.version}-${os}.${ext}" />
+ </then>
+ <else>
+ <property name="eclipse.file"
value="eclipse-${eclipse.type}-${eclipse.version}-${os}-${arch}.${ext}" />
+ </else>
+ </if>
+
+ <if>
+ <not>
+ <available file="${downloadDir}/${eclipse.file}" type="file"
/>
+ </not>
+ <then>
+ <get src="${eclipse.URL}/${eclipse.file}"
dest="${downloadDir}/${eclipse.file}" ignoreerrors="false"/>
+ </then>
+ </if>
+
+ <!-- purge previous eclipse install to avoid conflicts w/ Eclipse feature versions
-->
+ <delete dir="${unpackDir}" includeemptydirs="true"
quiet="true" />
+
+ <untar compression="gzip" dest="${unpackDir}"
src="${downloadDir}/${eclipse.file}" overwrite="true" />
+
+ <!-- make eclipse executable -->
+ <chmod perm="+x" file="${unpackDir}/eclipse/eclipse" />
+ </target>
+
<target name="cleanup">
<delete dir="${tmpdir}" quiet="true"
includeemptydirs="true" />
</target>
Added: trunk/build/aggregate/getArch.sh
===================================================================
--- trunk/build/aggregate/getArch.sh (rev 0)
+++ trunk/build/aggregate/getArch.sh 2012-10-11 23:49:52 UTC (rev 44453)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+if uname -m > /dev/null 2>&1; then
+ arch=`uname -m`
+else
+ arch=`uname -p`
+fi
+# Massage arch for Eclipse-uname differences
+case $arch in
+ i[0-9]*86)
+ arch=x86 ;;
+ ia64)
+ arch=ia64 ;;
+ ppc)
+ arch=ppc ;;
+ ppc64)
+ arch=ppc ;;
+ x86_64)
+ arch=x86_64 ;;
+ *)
+ echo "ERROR: Unrecognized architecture: $arch"
+ exit 1 ;;
+esac
+echo $arch
\ No newline at end of file