blob: 1a01a09a73599479dd06b519ad2fce4a9e15f9f0 [file] [log] [blame]
<project name="Eclipse SDK build" default="provision.sdk" basedir=".">
<tstamp>
<format property="timestamp" pattern="yyyyMMddHHmmss" />
</tstamp>
<record name="build_${timestamp}.log" />
<echo message="Build log is available in build_${timestamp}.log" />
<property name="baseBuilder" value="${basedir}/bootstrap" />
<property name="launcher" value="${basedir}/bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
<property name="eclipse.pdebuild.scripts" value="${basedir}/bootstrap/plugins/org.eclipse.pde.build/scripts" />
<property file="build.properties" />
<available file="eclipse-${label}-src.tar.bz2" property="sdkSourcePresent" value="true" />
<available file="eclipse/plugins/org.eclipse.equinox.launcher/build.properties" property="extractedSdkSourcePresent" value="true" />
<condition property="onlyExtractedSdkSourcePresent">
<and>
<isfalse value="${sdkSourcePresent}" />
<istrue value="${extractedSdkSourcePresent}" />
</and>
</condition>
<condition property="sdkSourceTarballPresent">
<or>
<isset property="sdkSourcePresent" />
<isset property="extractedSdkSourcePresent" />
</or>
</condition>
<available file="eclipse-build-generatedScripts.tar.bz2" property="scriptsPresent" value="true" />
<available file="eclipse-sdktests-${label}-src.tar.bz2" property="testsSourcePresent" value="true" />
<available file="eclipse-sdktests-${label}-scripts.tar.bz2" property="testsScriptsPresent" value="true" />
<!-- Check what has already been done -->
<available property="unpack.complete" file="unpack-stamp" value="true" />
<uptodate property="testsunpack.complete" srcfile="${basedir}/eclipse-sdktests-${label}-src.tar.bz2" targetfile="testsunpack-stamp" />
<uptodate property="buildId.complete" srcfile="unpack-stamp" targetfile="buildId-stamp" />
<uptodate property="patch.complete" srcfile="unpack-stamp" targetfile="patch-stamp" />
<uptodate property="symlinks.complete" srcfile="patch-stamp" targetfile="symlinks-stamp" />
<uptodate property="testspatch.complete" srcfile="testsunpack-stamp" targetfile="testspatch-stamp" />
<uptodate property="compilelibs.complete" srcfile="unpack-stamp" targetfile="compilelibs-stamp" />
<uptodate property="build.complete" srcfile="patch-stamp" targetfile="build-stamp" />
<uptodate property="p2prep.complete" srcfile="build-stamp" targetfile="p2prep-stamp" />
<uptodate property="testsbuild.complete" srcfile="testspatch-stamp" targetfile="testsbuild-stamp" />
<uptodate property="provision.platform.complete" srcfile="build-stamp" targetfile="provision.platform-stamp" />
<uptodate property="provision.cvs.complete" srcfile="build-stamp" targetfile="provision.cvs-stamp" />
<uptodate property="provision.sdk.complete" srcfile="build-stamp" targetfile="provision.sdk-stamp" />
<uptodate property="provision.tests.complete" srcfile="testsbuild-stamp" targetfile="provision.tests-stamp" />
<uptodate property="provisionSDKinDropins.complete" srcfile="build-stamp" targetfile="provisionSDKinDropins-stamp" />
<available file="bootstrap/plugins" property="bootstrapped" value="true" />
<property name="topBuildDir" value="${basedir}/build" />
<property name="testsBuildDir" value="${basedir}/testsBuild" />
<property name="homeDir" value="${basedir}/home" />
<property name="baseworkspace" value="${basedir}/baseworkspace" />
<property name="buildworkspace" value="${basedir}/buildworkspace" />
<property name="buildDirectory" value="${topBuildDir}/eclipse-${label}-src" />
<property name="testsBuildDirectory" value="${testsBuildDir}/eclipse-sdktests-${label}-src" />
<property name="buildConfigs" value="${buildDirectory}/buildConfigs" />
<property name="buildConfig" value="${buildConfigs}/eclipse-build-config" />
<property name="productFiles" value="${buildConfig}/productFiles" />
<property name="reposource" value="${buildDirectory}/reposource" />
<property name="provisionDir" value="${buildDirectory}/installation" />
<property name="provisionWithTestsDir" value="${buildDirectory}/installationWithTests" />
<!-- Distros with alternative JUnit 4 JAR locations should pass this
parameter in to ant -->
<property name="junit4JarLocation" value="/usr/share/java/junit4.jar" />
<!-- Determine host architecture -->
<exec executable="uname" outputproperty="uname-m">
<arg line="-m" />
</exec>
<condition property="hostArch" value="arm">
<matches pattern="^arm.*" string="${uname-m}" />
</condition>
<condition property="hostArch" value="x86">
<matches pattern="i[0-9]*86" string="${uname-m}" />
</condition>
<condition property="hostArch" value="PA_RISC">
<matches pattern="^parisc.*" string="${uname-m}" />
</condition>
<condition property="hostArch" value="sparc">
<matches pattern="sparcv9" string="${uname-m}" />
</condition>
<condition property="hostArch" value="${uname-m}">
<not>
<isset property="hostArch" />
</not>
</condition>
<condition property="buildArch" value="${hostArch}">
<not>
<isset property="buildArch" />
</not>
</condition>
<echo message="uname -m: ${uname-m}. Build eclipse on ${hostArch} for ${buildArch}." />
<property name="destDir" value="" />
<property name="prefix" value="/usr/local" />
<!-- Do we want /usr/lib64 if it's a 64-bit architecture? -->
<property name="multilib" value="false" />
<condition property="setLib64">
<and>
<istrue value="${multilib}" />
<or>
<!-- Is it a 64-bit architecture? -->
<equals arg1="${buildArch}" arg2="x86_64" />
<equals arg1="${buildArch}" arg2="ppc64" />
</or>
</and>
</condition>
<condition property="build.libgnomeproxy">
<equals arg1="${buildArch}" arg2="x86" />
</condition>
<target name="setLib64Dir" if="setLib64">
<property name="libDir" value="lib64" />
</target>
<target name="setLibDir" depends="setLib64Dir">
<property name="libDir" value="lib" />
<property name="installationDir" value="${destDir}${prefix}/${libDir}/eclipse" />
</target>
<target name="getInstallationDir" depends="setLibDir">
<echo message="Installation directory will be ${destDir}/${prefix}/${libDir}" />
</target>
<property name="doTests" value="true" />
<target name="bootstrap" unless="bootstrapped">
<ant inheritall="false" antfile="pdebuild.xml">
<property name="buildId" value="${buildId}" />
<property name="buildArch" value="${buildArch}" />
<property name="buildDirectory" value="../../" />
</ant>
</target>
<!-- Run this target with antRunner application -->
<target name="generateBuildXmls" depends="unpack">
<ant antfile="pdebuild.xml" target="generateScripts" />
</target>
<target name="fetch" unless="sdkSourceTarballPresent">
<fail message="SDK source tarball is not present. Please either download a file such as eclipse-3.6.1-src.tar.bz2 from http://download.eclipse.org/technology/linuxtools/eclipse-build/ or generate one by running ./buildSDKSource.sh." />
</target>
<target name="fetchTestSources" unless="testsSourcePresent">
<fail message="SDK tests source tarball is not present. Please either download a file such as eclipse-sdktests-3.6.1-sources.tar.bz2 from http://download.eclipse.org/technology/linuxtools/eclipse-build/ or generate one by running ./buildSDKSource.sh." />
</target>
<target name="fetchTestScripts" unless="testsScriptsPresent">
<fail message="Scripts for the SDK tests tarball is not present. Please either download a file such as eclipse-sdktests-3.6.1-scripts.tar.bz2 from http://download.eclipse.org/technology/linuxtools/eclipse-build/ or generate one by running ./buildSDKSource.sh." />
</target>
<target name="extractBuildXmls" if="scriptsPresent">
<untar compression="bzip2" dest="${basedir}/build/eclipse-${label}-src" src="${basedir}/eclipse-build-generatedScripts.tar.bz2" />
<exec executable="${basedir}/jasper7.sh">
<arg value="${label}"/>
</exec>
<!--
<fail message="Build scripts to bootstrap PDE Build must be generated and present in eclipse-build-generatedScripts.tar.bz2. See pdebuild.xml for details."/>
-->
</target>
<target name="extractSource" unless="onlyExtractedSdkSourcePresent">
<echo message="Extracting SDK source (tar jxf eclipse-${label}-src.tar.bz2)" />
<untar dest="${topBuildDir}" src="${basedir}/eclipse-${label}-src.tar.bz2" compression="bzip2" />
</target>
<target name="copySource" unless="sdkSourcePresent">
<echo message="Copy SDK source (cp -rd --not-target-directory eclipse ${buildDirectory})" />
<exec executable="cp" failonerror="true">
<arg value="-rd" />
<arg value="--no-target-directory" />
<arg value="eclipse" />
<arg value="${buildDirectory}" />
</exec>
</target>
<available file="${basedir}/eclipse-build-feature" property="buildFeaturePresent" value="true" />
<target name="symlinkBuildFeature" unless="buildFeaturePresent">
<echo message="creating link to feature dir (../eclipse-build-feature)" />
<symlink link="${basedir}/eclipse-build-feature" resource="${basedir}/../eclipse-build-feature"/>
</target>
<available file="${basedir}/eclipse-build-config" property="buildConfigPresent" value="true" />
<target name="symlinkBuildConfig" unless="buildConfigPresent">
<echo message="creating link to config dir (../eclipse-build-config)" />
<symlink link="${basedir}/eclipse-build-config" resource="${basedir}/../eclipse-build-config"/>
</target>
<target name="unpack" depends="fetch,setLibDir,symlinkBuildFeature,symlinkBuildConfig" unless="unpack.complete">
<delete dir="${topBuildDir}" />
<mkdir dir="${topBuildDir}" />
<!-- User home used for build -->
<delete dir="${homeDir}" />
<mkdir dir="${homeDir}" />
<!-- Workspaces used for build -->
<delete dir="${baseworkspace}" />
<mkdir dir="${baseworkspace}" />
<delete dir="${buildworkspace}" />
<mkdir dir="${buildworkspace}" />
<antcall target="extractSource" />
<antcall target="copySource" />
<antcall target="extractBuildXmls" />
<delete dir="${buildDirectory}/buildConfigs" />
<mkdir dir="${buildDirectory}/buildConfigs" />
<echo message="Copying eclipse-build main feature source" />
<copy todir="${buildConfigs}/eclipse-build-config">
<fileset dir="eclipse-build-config" />
</copy>
<echo message="Copying eclipse-build builder" />
<copy todir="${buildDirectory}/features/eclipse-build-feature">
<fileset dir="eclipse-build-feature" />
</copy>
<delete verbose="true">
<fileset dir="${buildDirectory}/plugins" includes="**/ECLIPSEF.SF" />
<fileset dir="${buildDirectory}/plugins" includes="**/ECLIPSEF.RSA" />
</delete>
<!-- add additional archs -->
<untar compression="bzip2" dest="${basedir}/build/eclipse-${label}-src/plugins" src="${basedir}/eclipse-build-additionalArchs.tar.bz2" />
<!-- prepare ecf build tree -->
<delete>
<fileset dir="${buildDirectory}/plugins" includes="org.eclipse.ecf*" />
<fileset dir="${buildDirectory}/plugins" includes="org.mortbay.jetty_5*" />
</delete>
<delete dir="${buildDirectory}/plugins/org.eclipse.equinox.http.jetty_1.1.100" />
<!-- Create a stamp file -->
<echo file="unpack-stamp" />
</target>
<target name="unpackTests" depends="fetchTestSources,fetchTestScripts" unless="testsunpack.complete">
<delete dir="${testsBuildDir}" />
<mkdir dir="${testsBuildDir}" />
<!-- User home used for build -->
<delete dir="${homeDir}" />
<mkdir dir="${homeDir}" />
<!-- Workspaces used for build -->
<delete dir="${baseworkspace}" />
<mkdir dir="${baseworkspace}" />
<delete dir="${buildworkspace}" />
<mkdir dir="${buildworkspace}" />
<echo message="Extracting SDK tests source (tar jxf eclipse-sdktests-${label}-src.tar.bz2)" />
<untar dest="${testsBuildDir}" src="${basedir}/eclipse-sdktests-${label}-src.tar.bz2" compression="bzip2" />
<untar dest="${testsBuildDir}" src="${basedir}/eclipse-sdktests-${label}-scripts.tar.bz2" compression="bzip2" />
<move todir="${testsBuildDir}">
<fileset dir="${testsBuildDir}/eclipse-sdktests-${label}-scripts">
<include name="**/*" />
</fileset>
</move>
<!-- Create a stamp file -->
<echo file="testsunpack-stamp" />
</target>
<target name="clean-sdk">
<delete dir="${homeDir}" />
<delete dir="${baseworkspace}" />
<delete dir="${buildworkspace}" />
<delete dir="${topBuildDir}" />
<delete dir="${testsBuildDir}" />
<delete dir="configuration" />
<delete dir="p2" />
<delete dir="workspace" />
<delete dir="${basedir}/task-bin" />
<delete>
<fileset dir="." includes="*-stamp" />
</delete>
<delete file="sdk-tests.properties" />
</target>
<target name="clean" depends="clean-sdk">
<delete dir="bootstrap/configuration/org.eclipse.core.runtime" />
<delete dir="bootstrap/configuration/org.eclipse.equinox.app" />
<delete dir="bootstrap/configuration/org.eclipse.osgi" />
<delete dir="bootstrap/p2" />
<delete dir="bootstrap/plugins" />
<delete dir="bootstrap/workspace" />
</target>
<target name="distclean" depends="clean">
<delete>
<fileset dir="." includes="*.log" />
</delete>
<delete includeemptydirs="true">
<fileset dir="." includes="tests_*/**" />
</delete>
</target>
<target name="insertBuildId" depends="unpack" unless="buildId.complete">
<replace dir="${buildDirectory}/plugins" value="${buildId}" token="@build@">
<include name="**/about.mappings" />
</replace>
<replace dir="${buildDirectory}" value="${buildId}" token="@build@">
<include name="**/configuration/config.ini" />
</replace>
<echo file="buildId-stamp" />
</target>
<target name="applyPatches" depends="insertBuildId" unless="patch.complete">
<!-- eclipse-build-only patches -->
<patch patchfile="${basedir}/patches/eclipse-buildswtnatives.patch" dir="${buildDirectory}" strip="1" />
<!--
<patch patchfile="${basedir}/patches/eclipse-swt-buildagainstxulrunner.patch" dir="${buildDirectory}" strip="1" />
-->
<patch patchfile="${basedir}/patches/eclipse-addArchesAnd64bitSWT.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/eclipse-add-archs-filesystem.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/eclipse-add-archs-swt.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/eclipse-add-archs-executable.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/eclipse-add-ppc64-sparc64-s390-s390x.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/donotstorebuildlogsinfiles.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/donotsetjavahomeandoptimizeliblocalfile.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/eclipse-pde.build-add-package-build.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/gnomeproxy-makefile.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/eclipse-no-jetty5.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/eclipse-nosourcebundlesfordependencies.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/osgi-util.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/eclipse-xpcom-h.patch" dir="${buildDirectory}/plugins/org.eclipse.swt/Eclipse SWT Mozilla/common/library"/>
<replace file="${buildDirectory}/plugins/org.eclipse.pde.build/templates/package-build/build.properties" token="/usr/share/eclipse" value="/usr/${libDir}/eclipse" />
<chmod dir="${buildDirectory}/plugins/org.eclipse.pde.build/templates/package-build" includes="*.sh" perm="a+x" />
<!-- end eclipse-build-only patches -->
<!-- Only build for one target (bug #293952) -->
<copy file="${buildConfigs}/eclipse-build-config/build.properties.in" tofile="${buildConfigs}/eclipse-build-config/build.properties" />
<replace file="${buildConfigs}/eclipse-build-config/build.properties" token="@build_arch@" value="${buildArch}" />
<patch patchfile="${basedir}/patches/eclipse-core-resources-compilation-profile.patch" dir="${buildDirectory}" strip="0" />
<patch patchfile="${basedir}/patches/eclipse-equinox-util.patch" dir="${buildDirectory}" strip="0" />
<patch patchfile="${basedir}/patches/0001-Fix-Program.launch-for-remote-uri-in-the-pure-gio-en.patch" dir="${buildDirectory}/plugins" strip="2" />
<patch patchfile="${basedir}/patches/remove-lucene-dependency.patch" dir="${buildDirectory}" strip="1" />
<patch patchfile="${basedir}/patches/eclipse-equinox-jsp-jasper.patch" dir="${buildDirectory}" strip="0" />
<patch patchfile="${basedir}/patches/eclipse-equinox-http-jetty.patch" dir="${buildDirectory}" strip="0" />
<patch patchfile="${basedir}/patches/eclipse-equinox-http-servlet.patch" dir="${buildDirectory}" strip="0" />
<patch patchfile="${basedir}/patches/eclipse-help-feature.patch" dir="${buildDirectory}" strip="0" />
<patch patchfile="${basedir}/patches/nonRelativeLicense.patch" dir="${buildDirectory}" strip="0" />
<patch patchfile="${basedir}/patches/eclipse-dont-link-in-orbit2.patch" dir="${buildDirectory}" strip="1" />
<echo file="patch-stamp" />
</target>
<target name="applyTestPatches" depends="unpackTests" unless="testspatch.complete">
<patch patchfile="${basedir}/patches/tests-noapttests.patch" dir="${testsBuildDirectory}/features/org.eclipse.sdk.tests" strip="0" />
<patch patchfile="${basedir}/patches/tests-noequinoxregiontests.patch" dir="${testsBuildDirectory}/features/org.eclipse.sdk.tests" strip="0" />
<patch patchfile="${basedir}/patches/tests-BZ295666.patch" dir="${testsBuildDirectory}" strip="0" />
<patch patchfile="${basedir}/patches/tests-org.eclipse.pde.ui.tests-LocalTargetDefinitionTests.patch" dir="${testsBuildDirectory}/plugins/org.eclipse.pde.ui.tests" strip="0" />
<patch patchfile="${basedir}/patches/tests-nop2discoverytests.patch" dir="${testsBuildDirectory}/features/org.eclipse.sdk.tests" strip="0" />
<patch patchfile="${basedir}/patches/tests-org.eclipse.ant.tests.core.patch" dir="${testsBuildDirectory}/plugins/org.eclipse.ant.tests.core" strip="0" />
<patch patchfile="${basedir}/patches/tests-org.eclipse.ant.tests.ui.patch" dir="${testsBuildDirectory}/plugins/org.eclipse.ant.tests.ui" strip="0" />
<patch patchfile="${basedir}/patches/eclipse-ua.patch" dir="${testsBuildDirectory}/plugins" strip="1" />
<echo file="testspatch-stamp" />
</target>
<target name="buildHelperTask">
<mkdir dir="task-bin" />
<javac compiler="modern" target="1.5" source="1.5" debug="true" srcdir="${basedir}/task-src" destdir="${basedir}/task-bin" />
</target>
<target name="defineTasks" depends="buildHelperTask">
<taskdef name="symlinkOSGiJars" classname="org.eclipse.linuxtools.eclipsebuild.SymlinkOSGiJars" classpath="${basedir}/task-bin" />
<taskdef name="symlinkInstalledOSGiJars" classname="org.eclipse.linuxtools.eclipsebuild.SymlinkInstalledOSGiJars" classpath="${basedir}/task-bin" />
<taskdef name="symlinkNonOSGiJars" classname="org.eclipse.linuxtools.eclipsebuild.SymlinkNonOSGiJars" classpath="${basedir}/task-bin" />
</target>
<target name="symlinkDeps" depends="applyPatches,defineTasks" unless="symlinks.complete">
<symlinkOSGiJars dependencies="${basedir}/dependencies.properties" topLevelDir="${buildDirectory}/plugins" manifests="${basedir}/dependencyManifests" copyFiles="${copyFiles}"/>
<symlinkNonOSGiJars dependencies="${basedir}/nonosgidependencies.properties" topLevelDir="${buildDirectory}/plugins" copyFiles="${copyFiles}"/>
<symlinkOSGiJars dependencies="${basedir}/jdtdependencies.properties" topLevelDir="${buildDirectory}/plugins" manifests="${basedir}/dependencyManifests" copyFiles="${copyFiles}"/>
<symlinkNonOSGiJars dependencies="${basedir}/jdtnonosgidependencies.properties" topLevelDir="${buildDirectory}/plugins" copyFiles="${copyFiles}"/>
<symlinkOSGiJars dependencies="${basedir}/sdkdependencies.properties" topLevelDir="${buildDirectory}/plugins" manifests="${basedir}/dependencyManifests" copyFiles="${copyFiles}"/>
<replaceregexp file="${buildDirectory}/plugins/org.apache.ant_1.8.2.v20110505-1300/META-INF/MANIFEST.MF" flags="m,g,s">
<regexp pattern="^Name.*" />
<substitution expression="" />
</replaceregexp>
<replaceregexp file="${buildDirectory}/plugins/org.apache.ant_1.8.2.v20110505-1300/META-INF/MANIFEST.MF" flags="m,g,s">
<regexp pattern="^SHA1-Digest.*" />
<substitution expression="" />
</replaceregexp>
<replaceregexp file="${buildDirectory}/plugins/org.junit_3.8.2.v3_8_2_v20100427-1100/META-INF/MANIFEST.MF" flags="m,g,s">
<regexp pattern="^Name.*" />
<substitution expression="" />
</replaceregexp>
<replaceregexp file="${buildDirectory}/plugins/org.junit_3.8.2.v3_8_2_v20100427-1100/META-INF/MANIFEST.MF" flags="m,g,s">
<regexp pattern="^SHA1-Digest.*" />
<substitution expression="" />
</replaceregexp>
<replaceregexp file="${buildDirectory}/plugins/org.junit_3.8.2.v3_8_2_v20100427-1100/META-INF/MANIFEST.MF" flags="m,g,s">
<regexp pattern="junit\.jar" />
<substitution expression="\." />
</replaceregexp>
<replaceregexp file="${buildDirectory}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/META-INF/MANIFEST.MF" flags="m,g,s">
<regexp pattern="^Name.*" />
<substitution expression="" />
</replaceregexp>
<replaceregexp file="${buildDirectory}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/META-INF/MANIFEST.MF" flags="m,g,s">
<regexp pattern="^SHA1-Digest.*" />
<substitution expression="" />
</replaceregexp>
<replaceregexp file="${buildDirectory}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/META-INF/MANIFEST.MF" flags="m,g,s">
<regexp pattern="junit\.jar" />
<substitution expression="\." />
</replaceregexp>
<jar destfile="${buildDirectory}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705.jar" manifest="${buildDirectory}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/META-INF/MANIFEST.MF">
<fileset dir="${buildDirectory}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/"/>
<zipfileset src="/usr/share/java/junit4.jar"/>
</jar>
<jar destfile="${buildDirectory}/plugins/org.junit_3.8.2.v3_8_2_v20100427-1100.jar" manifest="${buildDirectory}/plugins/org.junit_3.8.2.v3_8_2_v20100427-1100/META-INF/MANIFEST.MF">
<fileset dir="${buildDirectory}/plugins/org.junit_3.8.2.v3_8_2_v20100427-1100/"/>
<zipfileset src="/usr/share/java/junit4.jar"/>
</jar>
<delete dir="${buildDirectory}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/"/>
<delete dir="${buildDirectory}/plugins/org.junit_3.8.2.v3_8_2_v20100427-1100/"/>
<!-- Create a stamp file -->
<echo file="symlinks-stamp" />
</target>
<target name="copyDeps">
<antcall target="symlinkDeps">
<param name="copyFiles" value="true"/>
</antcall>
</target>
<target name="build" depends="applyPatches,symlinkDeps,bootstrap,compilelibs" unless="build.complete">
<echo message="build.xml: eclipse.pdebuild.scripts = ${eclipse.pdebuild.scripts}" />
<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${basedir}" failonerror="true">
<classpath>
<pathelement path="bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
</classpath>
<arg line="-configuration configuration " />
<arg line="-application org.eclipse.ant.core.antRunner " />
<arg line="-buildfile ${eclipse.pdebuild.scripts}/build.xml" />
<arg line="-propertyfile ${basedir}/build.properties " />
<arg line="-Dbuilder=${buildConfig} " />
<arg line="-DbuildDirectory=${buildDirectory} " />
<arg line="-consolelog " />
<jvmarg value="-Xmx512M" />
</java>
<!-- build equinox initializer -->
<mkdir dir="${buildDirectory}/home" />
<java classname="org.eclipse.core.launcher.Main" dir="${buildDirectory}/plugins/org.eclipse.equinox.initializer" fork="true">
<classpath>
<pathelement path="bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
</classpath>
<arg line="-data ${buildworkspace} " />
<arg line="-Duser.home=${buildDirectory}/home" />
<arg line="-application org.eclipse.ant.core.antRunner" />
<arg line="-f build.xml" />
<arg line="build.update.jar" />
<jvmarg value="-Xmx512M" />
</java>
<!--
<ant antfile="build.xml" dir="${eclipse.pdebuild.scripts}">
<property name="arch" value="${buildArch}"/>
<property name="builder" value="${buildConfig}" />
</ant>
-->
<echo file="build-stamp" />
</target>
<!--
<target name="checkBuildTests" depends="buildTests.check" if="buildTests.run">
</target>
<target name="buildTests.check">
<condition property="buildTests.run">
<and>
<istrue value="${doTests}"/>
<not>
<istrue value="${testsbuild.complete}"/>
</not>
</and>
</condition>
</target>
-->
<target name="buildTests" depends="provision.sdk,applyTestPatches" unless="testsbuild.complete">
<path id="pdebuilddir.id">
<dirset dir="${provisionDir}/plugins">
<include name="org.eclipse.pde.build_*" />
</dirset>
</path>
<property name="pdebuilddir" refid="pdebuilddir.id" />
<!-- Test framework -->
<exec executable="${provisionDir}/eclipse">
<arg line="-nosplash " />
<arg line="-consolelog " />
<arg line="-application org.eclipse.ant.core.antRunner " />
<arg line="-buildfile ${pdebuilddir}/scripts/build.xml" />
<arg line="-propertyfile ${basedir}/build.properties " />
<arg line="-DbuildDirectory=${testsBuildDirectory} " />
<arg line="-Dtype=feature -Did=org.eclipse.test " />
<arg line="-DbaseLocation=${provisionDir} " />
<arg line="-DbuildLabel=${testsBuildLabel} " />
<arg line="-data ${buildworkspace} " />
</exec>
<!-- SDK tests -->
<exec executable="${provisionDir}/eclipse">
<arg line="-nosplash " />
<arg line="-consolelog " />
<arg line="-application org.eclipse.ant.core.antRunner " />
<arg line="-buildfile ${pdebuilddir}/scripts/build.xml" />
<arg line="-propertyfile ${basedir}/build.properties " />
<arg line="-DbuildDirectory=${testsBuildDirectory} " />
<arg line="-Dtype=feature -Did=org.eclipse.sdk.tests " />
<arg line="-DbaseLocation=${provisionDir} " />
<arg line="-DbuildLabel=${testsBuildLabel} " />
<arg line="-data ${buildworkspace} " />
</exec>
<echo file="testsbuild-stamp" />
</target>
<target name="compile.libgnomeproxy" if="build.libgnomeproxy">
<!-- build libgnomeproxy -->
<exec dir="${buildDirectory}/plugins/org.eclipse.core.net/natives/unix/linux" executable="make" failonerror="true" />
<copy file="${buildDirectory}/plugins/org.eclipse.core.net/natives/unix/linux/libgnomeproxy-1.0.0.so" todir="${buildDirectory}/plugins/org.eclipse.core.net.linux.${buildArch}/" />
<move file="${buildDirectory}/plugins/org.eclipse.core.net/natives/unix/linux/libgnomeproxy-1.0.0.so" todir="${buildDirectory}/plugins/org.eclipse.core.net/fragments/org.eclipse.core.net.linux.${buildArch}/" />
</target>
<target name="compilelibs" unless="compilelibs.complete">
<delete verbose="true">
<fileset dir="${buildDirectory}/features/org.eclipse.equinox.executable">
<include name="eclipse" />
</fileset>
<fileset dir="${buildDirectory}">
<include name="**/*.so" />
</fileset>
</delete>
<ant antfile="build.xml" target="build.nativeLibraries" dir="${buildDirectory}/plugins/org.eclipse.swt.gtk.linux.${buildArch}" />
<property name="launcherlibs" value="${buildDirectory}/features/org.eclipse.equinox.executable" />
<exec dir="${launcherlibs}/library/gtk/" executable="sh" failonerror="true">
<arg line="build.sh" />
</exec>
<property name="launcherfragment" value="org.eclipse.equinox.launcher.gtk.linux.${buildArch}" />
<copy file="${launcherlibs}/library/gtk/eclipse" todir="${buildDirectory}/features/org.eclipse.equinox.executable/bin/gtk/linux/${buildArch}/" />
<copy todir="${buildDirectory}/plugins/${launcherfragment}">
<fileset dir="${launcherlibs}/library/gtk">
<include name="**/*.so" />
</fileset>
</copy>
<!-- build liblocalfile -->
<exec dir="${buildDirectory}/plugins/org.eclipse.core.filesystem/natives/unix/linux" executable="make" failonerror="true" />
<move file="${buildDirectory}/plugins/org.eclipse.core.filesystem/natives/unix/linux/libunixfile_1_0_0.so" todir="${buildDirectory}/plugins/org.eclipse.core.filesystem.linux.${buildArch}/os/linux/${buildArch}">
</move>
<!-- build libgnomeproxy -->
<antcall target="compile.libgnomeproxy" />
<!-- build libupdate -->
<ant dir="${buildDirectory}/plugins/org.eclipse.update.core.linux/src" antfile="build.xml" />
<echo file="compilelibs-stamp" />
</target>
<target name="p2prep" depends="build" unless="p2prep.complete">
<!--<property name="builtZip" value="${buildDirectory}/${buildLabel}/${featureToBuild}-${buildTag}-group.group.group.zip" />-->
<!-- archiveName is set in the build config's customTargets.xml -->
<!-- FIXME buildLabel should be used here but it's not defined so we cheat and use I.${buildId} instead. -->
<property name="builtZip" value="${buildDirectory}/I.${buildId}/eclipse-SDK-${buildId}.zip" />
<!--<property name="builtZip" value="${basedir}/eclipse-SDK-${buildId}.zip"/>-->
<replace token="@qualifier@" file="${productFiles}/sdk/sdk.product" value="${buildId}" />
<replace token="@qualifier@" file="${productFiles}/platform/platform.product" value="${buildId}" />
<property name="tempexec" value="${buildDirectory}/tempexec" />
<antcall target="createRepo" />
<antcall target="extractLauncher" />
<antcall target="publishLauncher" />
<antcall target="createAndPublishLauncherFeature" />
<antcall target="publishSDK" />
<antcall target="publishPlatform" />
<echo file="p2prep-stamp" />
</target>
<target name="createRepo">
<delete dir="${reposource}" />
<mkdir dir="${reposource}" />
<echo message="Unzipping ${builtZip} into ${reposource}" />
<unzip dest="${reposource}" src="${builtZip}" />
</target>
<target name="extractLauncher">
<delete dir="${tempexec}" />
<mkdir dir="${tempexec}" />
<copy todir="${tempexec}">
<fileset dir="${reposource}">
<include name="features/org.eclipse.equinox.executable_*.jar" />
</fileset>
</copy>
<unzip dest="${tempexec}">
<fileset dir="${tempexec}/features">
<include name="*.jar" />
</fileset>
</unzip>
</target>
<target name="publishLauncher">
<!-- Do we need a full path for ${reposource}?
<property name="buildDirectoryAbsoluteTemp" value="${buildDirectory}/absolutetemp.txt" />
<echo message="${reposource}" file="${buildDirectoryAbsoluteTemp}" />
<replaceregexp file="${buildDirectoryAbsoluteTemp}" match="org.eclipse.releng.eclipsebuilder/../src/" replace="src/" />
<loadfile property="buildDirectoryAbsolute" srcFile="${buildDirectoryAbsoluteTemp}" failonerror="false" />
<delete file="${buildDirectoryAbsoluteTemp}" />
-->
<!-- This next part merges metadata for the launcher binary into the rest of the metadata -->
<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${basedir}" failonerror="true">
<classpath>
<pathelement path="bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
</classpath>
<arg line="-configuration configuration " />
<arg line="-application org.eclipse.ant.core.antRunner " />
<arg line="-buildfile ${tempexec}/build.xml" />
<arg line="-propertyfile ${basedir}/build.properties " />
<arg line="-Dbuilder=${buildConfig} " />
<arg line="-DbuildDirectory=${buildDirectory} " />
<arg line="-Dp2.gathering=true " />
<arg line="-Dp2.build.repo=file:/${reposource} " />
<arg line="-consolelog " />
<arg line="publish.bin.parts " />
<jvmarg value="-Xmx512M" />
</java>
</target>
<target name="createAndPublishLauncherFeature">
<!--
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=40000"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=40001"/>
-->
<!-- This next part creates and publishs a feature including the binary launcher -->
<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${productFiles}/rcpConfig" failonerror="true">
<classpath>
<pathelement path="bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
</classpath>
<arg line="-configuration configuration " />
<arg line="-application org.eclipse.ant.core.antRunner " />
<arg line="-buildfile buildConfiguration.xml" />
<arg line="-propertyfile ${basedir}/build.properties " />
<arg line="-Dconfigs=linux,gtk,${buildArch} " />
<arg line="-Dreposource=${reposource} " />
<arg line="-Dbasedir=${productFiles}/rcpConfig" />
<arg line="-DbuildId=${buildId} " />
<arg line="-DbaseBuildPath=${buildDirectory} " />
<arg line="-DbaseLocation=${buildDirectory} " />
<arg line="-Declipse.pdebuild.scripts=${eclipse.pdebuild.scripts} " />
<arg line="-consolelog " />
<jvmarg value="-Xmx512M" />
</java>
<!--
<ant target="main" antfile="buildConfiguration.xml" dir="${productFiles}/rcpConfig" />
-->
</target>
<target name="publishPlatform">
<antcall target="publishProduct">
<param name="productFile" value="${productFiles}/platform/platform.product" />
</antcall>
</target>
<target name="publishSDK">
<antcall target="publishProduct">
<param name="productFile" value="${productFiles}/sdk/sdk.product" />
</antcall>
</target>
<target name="publishProduct">
<!-- http://wiki.eclipse.org/Equinox/p2/Publisher -->
<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${basedir}" failonerror="true">
<classpath>
<pathelement path="${launcher}" />
</classpath>
<arg line="-configuration configuration " />
<arg line="-application org.eclipse.ant.core.antRunner " />
<arg line="-buildfile publishProduct.xml" />
<arg line="-propertyfile ${basedir}/build.properties " />
<arg line="-DbuildArch=${buildArch} " />
<arg line="-Dreposource=${reposource} " />
<arg line="-DbuildConfig=${buildConfig} " />
<arg line="-DproductFile=${productFile} " />
<arg line="-DbuildDirectory=${buildDirectory} " />
<arg line="-consolelog " />
<jvmarg value="-Xmx512M" />
</java>
<!-- The following (using the app. instead of the ant task) doesn't work
as of 2010-08-11 -->
<!--
<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${basedir}" failonerror="true">
<classpath>
<pathelement path="bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
</classpath>
<arg line="-configuration configuration " />
<arg line="-consoleLog" />
<arg line="-application org.eclipse.equinox.p2.publisher.ProductPublisher " />
<arg line="-flavor tooling" />
<arg line="-configs gtk.linux.${buildArch}" />
<arg line="-productFile ${productFile}" />
<arg line="-metadataRepository file:${reposource}" />
<arg line="-artifactRepository file:${reposource}" />
<arg line="-compress" />
<arg line="-featureVersions ${buildDirectory}/finalFeaturesVersions.properties" />
<arg line="-pluginVersions ${buildDirectory}/finalPluginsVersions.properties" />
</java>
-->
</target>
<target name="provision.platform" depends="p2prep" unless="provision.platform.complete">
<echo message="Installing into: ${provisionDir}" />
<antcall target="provision">
<param name="p2.director.installIU" value="org.eclipse.platform.ide" />
<param name="profileName" value="PlatformProfile" />
</antcall>
<!-- Re-symlink system JARs -->
<symlinkInstalledOSGiJars dependencies="${basedir}/dependencies.properties" topLevelDir="${provisionDir}/plugins" />
<symlinkNonOSGiJars dependencies="${basedir}/nonosgidependencies.properties" topLevelDir="${provisionDir}/plugins" />
<echo file="provision.platform-stamp" />
</target>
<!-- This is here as a convenience task for distributions which want
CVS functionality to be present in "platform" installations. -->
<target name="provision.cvs" depends="p2prep" unless="provision.cvs.complete">
<echo message="Installing into: ${provisionDir}" />
<antcall target="provision">
<param name="p2.director.installIU" value="org.eclipse.platform.ide,org.eclipse.cvs.feature.group,org.eclipse.equinox.initializer" />
<param name="profileName" value="PlatformProfile" />
</antcall>
<!-- Re-symlink system JARs -->
<symlinkInstalledOSGiJars dependencies="${basedir}/dependencies.properties" topLevelDir="${provisionDir}/plugins" />
<symlinkNonOSGiJars dependencies="${basedir}/nonosgidependencies.properties" topLevelDir="${provisionDir}/plugins" />
<echo file="provision.cvs-stamp" />
</target>
<target name="provision.sdk" depends="p2prep" unless="provision.sdk.complete">
<echo message="Installing into: ${provisionDir}" />
<antcall target="provision">
<param name="p2.director.installIU" value="org.eclipse.sdk.ide" />
<param name="profileName" value="SDKProfile" />
</antcall>
<fileset id="junit4.jar" dir="${provisionDir}/plugins">
<include name="**/org.junit4_**/junit.jar" />
</fileset>
<property name="junit4jar.path" refid="junit4.jar" />
<delete file="${provisionDir}/plugins/${junit4jar.path}" />
<symlink link="${provisionDir}/plugins/${junit4jar.path}" resource="${junit4JarLocation}" />
<!-- Re-symlink system JARs -->
<symlinkInstalledOSGiJars dependencies="${basedir}/dependencies.properties" topLevelDir="${provisionDir}/plugins" />
<symlinkNonOSGiJars dependencies="${basedir}/nonosgidependencies.properties" topLevelDir="${provisionDir}/plugins" />
<symlinkInstalledOSGiJars dependencies="${basedir}/jdtdependencies.properties" topLevelDir="${provisionDir}/plugins" />
<symlinkNonOSGiJars dependencies="${basedir}/jdtnonosgidependencies.properties" topLevelDir="${provisionDir}/plugins" />
<symlinkInstalledOSGiJars dependencies="${basedir}/sdkdependencies.properties" topLevelDir="${provisionDir}/plugins" />
<echo file="provision.sdk-stamp" />
</target>
<target name="provision" depends="p2prep">
<echo message="Installing into: ${provisionDir}" />
<antcall target="run.director">
<param name="p2.director.installIU" value="${p2.director.installIU}" />
<param name="p2.director.version" value="${p2.director.version}" />
<param name="p2.director.profile" value="${profileName}" />
<param name="p2.director.install.path" value="${provisionDir}" />
<param name="p2.director.extraArgs" value="-profileProperties org.eclipse.update.install.features=true" />
<param name="p2.os" value="linux" />
<param name="p2.ws" value="gtk" />
<param name="p2.arch" value="${buildArch}" />
<param name="p2.repo" value="${reposource}" />
</antcall>
</target>
<target name="provision.installed" depends="p2prep">
<echo message="Installing into: ${provisionDir}" />
<property name="directorToRun" value="${provisionDir}/eclipse" />
<antcall target="run.installed.director">
<param name="p2.director.installIU" value="${p2.director.installIU}" />
<param name="p2.director.version" value="${p2.director.version}" />
<param name="p2.director.profile" value="${profileName}" />
<param name="p2.director.install.path" value="${provisionDir}" />
<param name="p2.director.extraArgs" value="-profileProperties org.eclipse.update.install.features=true" />
<param name="p2.os" value="linux" />
<param name="p2.ws" value="gtk" />
<param name="p2.arch" value="${buildArch}" />
<param name="p2.repo" value="${reposource}" />
</antcall>
</target>
<target name="checkDebugAndVerbose">
<condition property="bothDebugAndVerbose.set">
<and>
<isset property="debugTests" />
<isset property="verboseTests" />
</and>
</condition>
</target>
<target name="setDebugAndVerbose" depends="checkDebugAndVerbose" if="bothDebugAndVerbose.set">
<property name="testSwitches" value="-dv" />
</target>
<target name="setDebugTests" if="debugTests">
<property name="testSwitches" value="-d" />
</target>
<target name="setVerboseTests" if="verboseTests">
<property name="testSwitches" value="-v" />
</target>
<target name="setDebugAndVerboseArgs" depends="setDebugAndVerbose,setDebugTests,setVerboseTests" />
<target name="runTests" depends="buildTests,setDebugAndVerboseArgs">
<!-- These two next calls just set the properties to an empty string if they are not previously set -->
<property name="debugTestsSwitch" value="" />
<property name="verboseTestsSwitch" value="" />
<!-- Install a clean SDK for testing -->
<antcall target="provision">
<param name="provisionDir" value="${provisionWithTestsDir}"/>
<param name="p2.director.installIU" value="org.eclipse.sdk.ide" />
<param name="profileName" value="SDKProfile" />
</antcall>
<fileset id="junit4.jar" dir="${provisionWithTestsDir}/plugins">
<include name="**/org.junit4_**/junit.jar" />
</fileset>
<property name="junit4jar.path" refid="junit4.jar" />
<delete file="${provisionWithTestsDir}/plugins/${junit4jar.path}" />
<symlink link="${provisionWithTestsDir}/plugins/${junit4jar.path}" resource="${junit4JarLocation}" />
<!-- Re-symlink system JARs -->
<symlinkInstalledOSGiJars dependencies="${basedir}/dependencies.properties" topLevelDir="${provisionWithTestsDir}/plugins" />
<symlinkNonOSGiJars dependencies="${basedir}/nonosgidependencies.properties" topLevelDir="${provisionWithTestsDir}/plugins" />
<symlinkInstalledOSGiJars dependencies="${basedir}/jdtdependencies.properties" topLevelDir="${provisionWithTestsDir}/plugins" />
<symlinkNonOSGiJars dependencies="${basedir}/jdtnonosgidependencies.properties" topLevelDir="${provisionWithTestsDir}/plugins" />
<symlinkInstalledOSGiJars dependencies="${basedir}/sdkdependencies.properties" topLevelDir="${provisionWithTestsDir}/plugins" />
<!-- Install test framework -->
<antcall target="provision">
<param name="provisionDir" value="${provisionWithTestsDir}"/>
<param name="reposource" value="${testsBuildDirectory}/buildRepo" />
<param name="p2.director.installIU" value="org.eclipse.test.feature.group" />
<param name="profileName" value="SDKProfile" />
</antcall>
<echo message="###################################################################" />
<echo message="# #" />
<echo message="# Please post and discuss results here: #" />
<echo message="# http://wiki.eclipse.org/Linux_Tools_Project/Eclipse_Build/Tests #" />
<echo message="# #" />
<echo message="###################################################################" />
<echo message="" />
<tstamp>
<format property="timestamp" pattern="yyyyMMddHHmmss" />
</tstamp>
<chmod perm="ugo+rx" file="${basedir}/runtests.sh" />
<!--
<echo message="Calling runtests with (debug, verbose) = (${testSwitches})" />
-->
<exec executable="${basedir}/runtests.sh" dir="${basedir}">
<arg value="-t${timestamp}" />
<arg value="-b ${testsBuildDirectory}" />
<arg value="-p ${provisionWithTestsDir}" />
<arg value="${testSwitches}" />
</exec>
<property name="testResultDir" value="${basedir}/tests_${timestamp}/results" />
<!-- Copy over the XML to generate a top-level report for all of the tests -->
<mkdir dir="${testResultDir}/origXml" />
<copy failonerror="false" todir="${testResultDir}/origXml">
<fileset dir="${testResultDir}/xml">
<include name="**/*" />
</fileset>
</copy>
<!-- Un-"collect" the results -->
<replace dir="${testResultDir}/origXml" value="">
<include name="**/*.xml" />
<replacetoken>&lt;testsuites&gt;</replacetoken>
</replace>
<replace dir="${testResultDir}/origXml" value="">
<include name="**/*.xml" />
<replacetoken>&lt;/testsuites&gt;</replacetoken>
</replace>
<!-- Aggregate XML report files -->
<junitreport todir="${testResultDir}/xml" tofile="org.eclipse.sdk.tests.xml">
<fileset dir="${testResultDir}/origXml" includes="*.xml" />
</junitreport>
<!-- Generate top-level HTML report -->
<xslt style="${provisionWithTestsDir}/plugins/${testframework}/JUNIT.XSL" basedir="${testResultDir}/xml" includes="org.eclipse.sdk.tests.xml" destdir="${testResultDir}/html" />
</target>
<target name="run.director">
<property name="baseBuilderConfig" value="${baseBuilder}/p2" />
<!-- FIXME: When we move to bootstrap by default, investigate using <exec> on the bootstrapped launcher
like in eclipsebuilder's equinox.prov/run.xml -->
<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${baseBuilder}" failonerror="true">
<classpath>
<pathelement location="${launcher}" />
</classpath>
<arg line="-data ${buildworkspace} " />
<arg line="-application org.eclipse.equinox.p2.director " />
<arg line="-consoleLog" />
<!--<arg line="-help" />-->
<arg line="-flavor ${p2.flavor}" />
<arg line="-installIU ${p2.director.installIU}" />
<arg line="-p2.os ${p2.os}" />
<arg line="-p2.ws ${p2.ws}" />
<arg line="-p2.arch ${p2.arch}" />
<arg line="-roaming" />
<arg line="-profile ${p2.director.profile}" />
<arg line="${p2.director.extraArgs}" />
<arg line="-metadatarepository file:${p2.repo}" />
<arg line="-artifactrepository file:${p2.repo}" />
<arg line="-destination ${p2.director.install.path}" />
<arg line="-bundlepool ${p2.director.install.path}" />
<arg line="-vmargs" />
<arg line="-Declipse.p2.data.area=${p2.director.install.path}/p2" />
<arg line="-Declipse.p2.MD5Check=false" />
<arg line="-Declipse.p2.profile=@none" />
<arg line="-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=" />
<arg line="-propertyfile ${basedir}/build.properties " />
<!--
<jvmarg value="-Xms512M" />
<jvmarg value="-Xmx2048M" />
<jvmarg value="-XX:MaxPermSize=512M" />
-->
<jvmarg value="-Declipse.p2.data.area=${p2.director.install.path}/p2" />
<jvmarg value="-Xmx512M" />
</java>
</target>
<target name="run.installed.director">
<chmod perm="ugo+rx" file="${directorToRun}" />
<exec executable="${directorToRun}">
<arg line="-nosplash " />
<arg line="-consoleLog" />
<arg line="-data ${buildworkspace} " />
<arg line="-application org.eclipse.equinox.p2.director " />
<arg line="-flavor ${p2.flavor}" />
<arg line="-installIU ${p2.director.installIU}" />
<arg line="-profile ${p2.director.profile}" />
<arg line="-destination ${p2.director.install.path}" />
<arg line="-p2.os ${p2.os}" />
<arg line="-p2.ws ${p2.ws}" />
<arg line="-p2.arch ${p2.arch}" />
<arg line="${p2.director.extraArgs}" />
<arg line="-metadatarepository file:${p2.repo}" />
<arg line="-artifactrepository file:${p2.repo}" />
</exec>
</target>
<target name="run.installed.director.uninstall">
<chmod perm="ugo+rx" file="${directorToRun}" />
<exec executable="${directorToRun}">
<arg line="-nosplash " />
<arg line="-consoleLog" />
<arg line="-data ${buildworkspace} " />
<arg line="-application org.eclipse.equinox.p2.director " />
<arg line="-flavor ${p2.flavor}" />
<arg line="-uninstallIU ${p2.director.uninstallIU}" />
<arg line="-profile ${p2.director.profile}" />
<arg line="-destination ${p2.director.install.path}" />
<arg line="-p2.os ${p2.os}" />
<arg line="-p2.ws ${p2.ws}" />
<arg line="-p2.arch ${p2.arch}" />
<arg line="${p2.director.extraArgs}" />
<arg line="-metadatarepository file:${p2.repo}" />
<arg line="-artifactrepository file:${p2.repo}" />
</exec>
</target>
<target name="install" depends="provision.sdk">
<antcall target="installIntoDestDir">
<param name="profile" value="SDKProfile" />
</antcall>
</target>
<target name="installSDKinDropins" depends="provisionSDKinDropins">
<antcall target="installIntoDestDir">
<param name="profile" value="PlatformProfile" />
</antcall>
</target>
<target name="extractSos" unless="dontExtractSos">
<java classname="org.eclipse.core.launcher.Main" fork="true" failonerror="true" dir="${destDir}">
<classpath>
<fileset dir="${installationDir}/plugins">
<include name="org.eclipse.equinox.launcher_*.jar" />
</fileset>
</classpath>
<arg value="-application" />
<arg value="org.eclipse.equinox.initializer.configInitializer" />
<arg value="-debug" />
<arg value="-consolelog" />
<arg value="-metadataRepository" />
<arg value="file:${installationDir}/metadata/" />
<arg value="-artifactRepository" />
<arg value="file:${installationDir}/metadata/" />
<arg value="-data" />
<arg value="${buildworkspace}" />
<arg value="-fileInitializer" />
<arg value="${basedir}/extract_patterns.txt" />
<jvmarg value="-Dosgi.sharedConfiguration.area=${installationDir}/configuration" />
</java>
</target>
<target name="installIntoDestDir">
<mkdir dir="${installationDir}" />
<exec executable="rsync" failonerror="true">
<arg value="-vrpl" />
<arg value="--exclude=dropins" />
<arg value="${provisionDir}/" />
<arg value="${installationDir}/" />
</exec>
<!-- install desktop file -->
<copy file="eclipse.desktop" todir="${destDir}${prefix}/share/applications" />
<!-- install Eclipse Java code formatter launcher -->
<property name="efj" value="${destDir}${prefix}/bin/efj"/>
<copy file="efj.sh" tofile="${efj}" />
<fileset id="equinoxLauncher" dir="${installationDir}/plugins">
<include name="org.eclipse.equinox.launcher_*.jar" />
</fileset>
<property name="launcherJar" refid="equinoxLauncher"/>
<replace file="${efj}" token="@LAUNCHER@" value="${prefix}/${libDir}/eclipse/plugins/${launcherJar}"/>
<!-- install icons -->
<copy file="${buildDirectory}/plugins/org.eclipse.platform/eclipse.png" tofile="${destDir}${prefix}/share/icons/hicolor/16x16/apps/eclipse.png" />
<copy file="${buildDirectory}/plugins/org.eclipse.platform/eclipse32.png" tofile="${destDir}${prefix}/share/icons/hicolor/32x32/apps/eclipse.png" />
<copy file="${buildDirectory}/plugins/org.eclipse.platform/eclipse48.png" tofile="${destDir}${prefix}/share/icons/hicolor/48x48/apps/eclipse.png" />
<mkdir dir="${destDir}${prefix}/share/pixmaps" />
<symlink link="${destDir}${prefix}/share/pixmaps/eclipse.png" resource="../icons/hicolor/48x48/apps/eclipse.png" overwrite="true"/>
<!--shared dropins folder for architecture-independent plugins-->
<mkdir dir="${destDir}${prefix}/share/eclipse/dropins" />
<!-- eclipse binary -->
<mkdir dir="${destDir}${prefix}/bin" />
<symlink link="${destDir}${prefix}/bin/eclipse" resource="../${libDir}/eclipse/eclipse" overwrite="true"/>
<!-- Create the "swt.jar" and friends symlinks -->
<fileset dir="${installationDir}/plugins" includes="org.eclipse.swt.gtk.linux.${buildArch}_*" id="swtjar" />
<property name="swtjarpath" refid="swtjar" />
<symlink link="${installationDir}/swt-gtk-${label}.jar" resource="plugins/${swtjarpath}" overwrite="true"/>
<symlink link="${installationDir}/swt-gtk.jar" resource="plugins/${swtjarpath}" overwrite="true"/>
<symlink link="${installationDir}/swt.jar" resource="plugins/${swtjarpath}" overwrite="true"/>
<echo append="true" file="${installationDir}/eclipse.ini" message="-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=${prefix}/share/eclipse/dropins" />
<!-- Extract SWT JNI .so files -->
<antcall target="extractSos">
</antcall>
<!-- remove the initializer -->
<property name="directorToRun" value="${installationDir}/eclipse" />
<antcall target="run.installed.director.uninstall">
<param name="p2.director.uninstallIU" value="org.eclipse.equinox.initializer" />
<param name="p2.director.profile" value="PlatformProfile" />
<param name="p2.director.install.path" value="${installationDir}" />
<param name="p2.director.extraArgs" value="-purgeHistory" />
<param name="p2.os" value="linux" />
<param name="p2.ws" value="gtk" />
<param name="p2.arch" value="${buildArch}" />
<param name="p2.repo" value="${installationDir}" />
</antcall>
<!-- copy PDE and JDT to dropins -->
<exec executable="rsync" failonerror="true">
<arg value="-vrpl" />
<arg value="${provisionDir}/dropins/" />
<arg value="${installationDir}/dropins/" />
</exec>
<!-- Remove unnecessary configuration data -->
<delete dir="${installationDir}/configuration/org.eclipse.core.runtime" />
<delete dir="${installationDir}/configuration/org.eclipse.equinox.app" />
<delete includeemptydirs="true" verbose="true">
<fileset dir="${installationDir}/configuration" includes="*.log" />
<fileset dir="${installationDir}/configuration" includes="**/data/**" />
<fileset dir="${installationDir}/configuration" includes="org.eclipse.update/**" />
</delete>
<!-- Fix paths in p2 data -->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${installationDir}/p2/org.eclipse.equinox.p2.core" includes="cache/**" />
</delete>
<property name="profileDir" value="p2/org.eclipse.equinox.p2.engine/profileRegistry/${profile}.profile" />
<!-- Strip some build artifacts from installation -->
<exec executable="sed" inputstring="${destDir}" outputproperty="destDirWithUnderscores" failonerror="true">
<arg value="s@/@_@g" />
</exec>
<exec executable="sed" inputstring="${reposource}" outputproperty="reposourceWithUnderscores" failonerror="true">
<arg value="s@/@_@g" />
</exec>
<exec executable="sed" inputstring="${provisionDir}" outputproperty="provisionDirWithUnderscores" failonerror="true">
<arg value="s@/@_@g" />
</exec>
<apply executable="sed" failonerror="true" verbose="true">
<arg value="-i" />
<arg value="\@${destDir}@d;\@${destDirWithUnderscores}@d;\@${reposourceWithUnderscores}@d;\@${provisionDirWithUnderscores}@d" />
<srcfile />
<fileset dir="${installationDir}">
<include name="metadata/content.xml" />
<include name="p2/org.eclipse.equinox.p2.engine/.settings/org.eclipse.equinox.p2.metadata.repository.prefs" />
<include name="p2/org.eclipse.equinox.p2.engine/.settings/org.eclipse.equinox.p2.artifact.repository.prefs" />
<include name="${profileDir}/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs" />
<include name="${profileDir}/.data/.settings/org.eclipse.equinox.p2.artifact.repository.prefs" />
<include name="eclipse.ini" />
</fileset>
</apply>
<!-- Clean up profile files -->
<echo message="${provisionDir}"/>
<apply executable="gunzip" failonerror="true" verbose="true">
<srcfile />
<fileset dir="${installationDir}/${profileDir}">
<include name="*.gz" />
</fileset>
</apply>
<apply executable="sed" failonerror="true" verbose="true">
<arg value="-i" />
<arg value="s@${provisionDir}@${installationDir}@g;s@${installationDir}@${prefix}/${libDir}/eclipse@g" />
<srcfile />
<fileset dir="${installationDir}/${profileDir}">
<include name="*.profile" />
</fileset>
</apply>
<apply executable="gzip" failonerror="true" verbose="true">
<srcfile />
<fileset dir="${installationDir}/${profileDir}">
<include name="*.profile" />
</fileset>
</apply>
<!-- Move config file to /etc -->
<mkdir dir="${destDir}/etc" />
<move file="${installationDir}/eclipse.ini" tofile="${destDir}/etc/eclipse.ini" />
<symlink link="${installationDir}/eclipse.ini" resource="/etc/eclipse.ini" overwrite="true"/>
</target>
<target name="installPlatform" depends="provision.platform,install">
<echo message="Installing Eclipse Platform" />
</target>
<target name="installPlatformAndCVS" depends="provision.cvs,install">
<echo message="Installing Eclipse Platform and CVS feature" />
</target>
<target name="provisionSDKinDropins" depends="provision.cvs" unless="provisionSDKinDropins.complete">
<property name="platformAndCVSInstallation" value="${provisionDir}.cvs"/>
<property name="jdtDropinsName" value="jdt"/>
<property name="sdkDropinsName" value="sdk"/>
<property name="jdtDropinsDir" value="${provisionDir}/dropins/${jdtDropinsName}"/>
<property name="sdkDropinsDir" value="${provisionDir}/dropins/${sdkDropinsName}"/>
<!-- make a copy of the clean platform+CVS installation -->
<exec executable="cp" failonerror="true">
<arg value="-rd" />
<arg value="--no-target-directory" />
<arg value="${provisionDir}" />
<arg value="${platformAndCVSInstallation}" />
</exec>
<!-- Install JDT -->
<property name="jdtInstallation" value="${provisionDir}.jdt"/>
<antcall target="provision.installed">
<param name="p2.director.installIU" value="org.eclipse.jdt.feature.group" />
<param name="profileName" value="PlatformProfile" />
</antcall>
<!-- rename the JDT installation -->
<move file="${provisionDir}"
tofile="${jdtInstallation}"/>
<!-- make a second copy of the clean JDT installation -->
<exec executable="cp" failonerror="true">
<arg value="-rd" />
<arg value="--no-target-directory" />
<arg value="${jdtInstallation}" />
<arg value="${jdtInstallation}.orig" />
</exec>
<!-- restore clean platform+CVS installation -->
<exec executable="cp" failonerror="true">
<arg value="-rd" />
<arg value="--no-target-directory" />
<arg value="${platformAndCVSInstallation}" />
<arg value="${provisionDir}" />
</exec>
<!-- Install SDK -->
<property name="sdkInstallation" value="${provisionDir}.sdk"/>
<antcall target="provision.installed">
<param name="p2.director.installIU" value="org.eclipse.sdk.feature.group,org.eclipse.license.feature.group" />
<param name="profileName" value="PlatformProfile" />
</antcall>
<!-- rename the entire SDK installation -->
<move file="${provisionDir}"
tofile="${sdkInstallation}"/>
<!-- restore clean platform+CVS installation -->
<exec executable="cp" failonerror="true">
<arg value="-rd" />
<arg value="--no-target-directory" />
<arg value="${platformAndCVSInstallation}" />
<arg value="${provisionDir}" />
</exec>
<!-- diff of platform+CVS and JDT goes into platform+CVS/dropins/jdt -->
<antcall target="moveNewStuffToDropins">
<param name="orig" value="${provisionDir}" />
<param name="new" value="${jdtInstallation}" />
<param name="dropinsDir" value="${jdtDropinsName}" />
</antcall>
<!-- restore clean JDT installation for comparison -->
<delete dir="${jdtInstallation}" />
<move file="${jdtInstallation}.orig"
tofile="${jdtInstallation}"/>
<!-- diff of JDT and SDK ... -->
<antcall target="moveNewStuffToDropins">
<param name="orig" value="${jdtInstallation}" />
<param name="new" value="${sdkInstallation}" />
<param name="dropinsDir" value="${sdkDropinsName}" />
</antcall>
<!-- ... goes into platform+CVS/dropins/pde -->
<move file="${jdtInstallation}/dropins/${sdkDropinsName}"
todir="${provisionDir}/dropins"/>
<!-- Re-symlink system JARs -->
<fileset id="junit4.jar" dir="${jdtDropinsDir}/plugins">
<include name="**/org.junit4_**/junit.jar" />
</fileset>
<property name="junit4jar.path" refid="junit4.jar" />
<delete file="${jdtDropinsDir}/plugins/${junit4jar.path}" />
<symlink link="${jdtDropinsDir}/plugins/${junit4jar.path}" resource="${junit4JarLocation}" />
<symlinkInstalledOSGiJars dependencies="${basedir}/dependencies.properties" topLevelDir="${provisionDir}/plugins" />
<symlinkNonOSGiJars dependencies="${basedir}/nonosgidependencies.properties" topLevelDir="${provisionDir}/plugins" />
<symlinkInstalledOSGiJars dependencies="${basedir}/jdtdependencies.properties" topLevelDir="${jdtDropinsDir}/plugins" />
<symlinkNonOSGiJars dependencies="${basedir}/jdtnonosgidependencies.properties" topLevelDir="${jdtDropinsDir}/plugins" />
<symlinkInstalledOSGiJars dependencies="${basedir}/sdkdependencies.properties" topLevelDir="${sdkDropinsDir}/plugins" />
<delete dir="${platformAndCVSInstallation}" />
<delete dir="${jdtInstallation}" />
<delete dir="${sdkInstallation}" />
<echo file="provisionSDKinDropins-stamp" />
</target>
<target name="moveNewStuffToDropins">
<property name="dropinsDirectory" value="${orig}/dropins/${dropinsDir}" />
<move todir="${dropinsDirectory}/features" includeemptydirs="true">
<fileset dir="${new}/features" id="newFeatures.fileset">
<present present="srconly" targetdir="${orig}/features"/>
</fileset>
</move>
<move todir="${dropinsDirectory}/plugins" includeemptydirs="true">
<fileset dir="${new}/plugins" id="newPlugins.fileset">
<present present="srconly" targetdir="${orig}/plugins"/>
</fileset>
</move>
</target>
<target name="package.extract.swt">
<exec executable="./swt_bundle.sh" failOnError="true">
<arg value="${eclipse.rcp.package.root}" />
<arg value="${eclipse.swt.package.root}" />
<arg value="${prefix}" />
<arg value="${libdir}" />
</exec>
</target>
</project>