| <?xml version="1.0" encoding="UTF-8"?> |
| <project default="no-build-macros-default"> |
| <!-- $id$ --> |
| <target name="no-build-macros-default"> |
| <fail>This file does not contain a default target</fail> |
| </target> |
| |
| <!-- - - - - - - - - - - - - - - - - - |
| target: noop_target |
| target that does nothing |
| - - - - - - - - - - - - - - - - - --> |
| <target name="noop_target"> |
| </target> |
| |
| <!-- = = = = = = = = = = = = = = = = = |
| macro: pdeInit |
| initialize the pde build |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="pdeInit"> |
| <attribute name="eclipseHome" default="${eclipse.home}" /> |
| <sequential> |
| <fileset dir="@{eclipseHome}" id="eclipse.pde.build.fs"> |
| <include name="plugins/org.eclipse.pde.build_*/scripts/build.xml" /> |
| </fileset> |
| <pathconvert refid="eclipse.pde.build.fs" pathsep="" property="pde.build.script" /> |
| <dirname file="${pde.build.script}" property="pde.build.dir"/> |
| |
| <fileset dir="@{eclipseHome}" id="eclipse.pde.product.build.fs"> |
| <include name="plugins/org.eclipse.pde.build_*/scripts/**/productBuild.xml" /> |
| </fileset> |
| <pathconvert refid="eclipse.pde.product.build.fs" pathsep="" property="pde.build.product.script" /> |
| <dirname file="${pde.build.product.script}" property="pde.build.product.dir"/> |
| <property name="pde.build.macro.called" value="true" /> |
| </sequential> |
| </macrodef> |
| |
| <!-- = = = = = = = = = = = = = = = = = |
| macro: isPdeInitialized |
| test to see ifthe pde init macro has been called |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="pdeIsInitialized"> |
| <sequential> |
| <fail message="The pdeInit macro has not been called"> |
| <condition> |
| <not> |
| <isset property="pde.build.macro.called"/> |
| </not> |
| </condition> |
| </fail> |
| </sequential> |
| </macrodef> |
| |
| <!-- = = = = = = = = = = = = = = = = = |
| macro: cleanup |
| cleanup the given directory |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="pdeCleanup"> |
| <attribute name="base" /> |
| <sequential> |
| <echo message="PdeCleanup base = @{base}" /> |
| <pdeIsInitialized/> |
| |
| <mkdir dir="@{base}"/> |
| <delete includeemptydirs="true"> |
| <fileset dir="@{base}"/> |
| </delete> |
| </sequential> |
| </macrodef> |
| |
| <!-- = = = = = = = = = = = = = = = = = |
| macro: setup |
| setup the code to be build by the PED build |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="pdeSetup"> |
| <attribute name="base" /> |
| <attribute name="baseLocation" /> |
| <attribute name="eclipseSdkZip" /> |
| <attribute name="eclipseDeltapackZip" /> |
| <sequential> |
| <echo>PdeSetup</echo> |
| <echo>base = @{base}</echo> |
| <echo>baseLocation = @{baseLocation}</echo> |
| <echo>eclipseSdkZip = @{eclipseSdkZip}</echo> |
| <echo>eclipseDeltapackZip = @{eclipseDeltapackZip}</echo> |
| |
| <pdeIsInitialized/> |
| <mkdir dir="@{base}"/> |
| <unzip dest="@{base}" |
| src="@{eclipseSdkZip}" /> |
| <unzip dest="@{base}" |
| src="@{eclipseDeltapackZip}" |
| overwrite="yes"/> |
| <echo>renaming @{base}/eclipse to @{baseLocation}</echo> |
| <move todir="@{baseLocation}"> |
| <fileset dir="@{base}/eclipse" /> |
| </move> |
| </sequential> |
| </macrodef> |
| |
| <!-- = = = = = = = = = = = = = = = = = |
| macro: pdeCopy |
| copy the doce to be build into the pde format |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="pdeCopy"> |
| <attribute name="buildDirectory" /> |
| <attribute name="pluginsDir" /> |
| <attribute name="featuresDir" /> |
| <attribute name="buildPlugins" default="@{buildDirectory}/plugins" /> |
| <attribute name="buildFeatures" default="@{buildDirectory}/features" /> |
| <attribute name="preProcessingTarget" default="noop_target" /> |
| <attribute name="postProcessingTarget" default="noop_target" /> |
| <element name="pluginsFileset" implicit="false" optional="false" /> |
| <element name="featuresFileset" implicit="false" optional="false" /> |
| <sequential> |
| <echo>PdeCopy</echo> |
| <echo>buildDirectory = @{buildDirectory}</echo> |
| <echo>buildPlugins = @{buildPlugins}</echo> |
| <echo>buildFeatures = @{buildFeatures}</echo> |
| <echo>pluginsDir = @{pluginsDir}</echo> |
| <echo>featuresDir = @{featuresDir}</echo> |
| |
| <pdeIsInitialized/> |
| <antcall target="@{preProcessingTarget}" inheritall="false"> |
| <param name="buildPluginsDir" value="@{buildPlugins}" /> |
| <param name="buildFeaturesDir" value="@{buildFeatures}" /> |
| <param name="pluginsDir" value="@{pluginsDir}" /> |
| <param name="featuresDir" value="@{featuresDir}" /> |
| </antcall> |
| <mkdir dir="@{buildFeatures}" /> |
| <mkdir dir="@{buildPlugins}"/> |
| <echo message="copying the code from @{pluginsDir} to @{buildPlugins}" /> |
| <copy todir="@{buildPlugins}"> |
| <pluginsFileset /> |
| </copy> |
| <echo message="copying the code from @{featuresDir} to @{buildFeatures}" /> |
| <copy todir="@{buildFeatures}"> |
| <featuresFileset /> |
| </copy> |
| <antcall target="@{postProcessingTarget}" inheritall="false"> |
| <param name="buildPluginsDir" value="@{buildPlugins}" /> |
| <param name="buildFeaturesDir" value="@{buildFeatures}" /> |
| <param name="pluginsDir" value="@{pluginsDir}" /> |
| <param name="featuresDir" value="@{featuresDir}" /> |
| </antcall> |
| </sequential> |
| </macrodef> |
| |
| <!-- = = = = = = = = = = = = = |
| macro: pdeRunBuild |
| run the PDE build |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="pdeRunBuild"> |
| <attribute name="pdeBuilder" /> |
| <attribute name="pdeBuildScript" default="${pde.build.script}" /> |
| <attribute name="pdeBuildDir" default="${pde.build.dir}" /> |
| <sequential> |
| <pdeIsInitialized/> |
| <echo message="Running build file @{pdeBuildScript} dir @{pdeBuildDir} builder @{pdeBuilder}"/> |
| |
| <ant antfile="@{pdeBuildScript}" dir="@{pdeBuildDir}"> |
| <property name="builder" value="@{pdeBuilder}" /> |
| </ant> |
| </sequential> |
| </macrodef> |
| |
| <!-- = = = = = = = = = = = = = |
| macro: pdeLoadBuildProperties |
| load the build properties for the pde build |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="pdeLoadBuildProperties"> |
| <attribute name="file" /> |
| <attribute name="prefix" /> |
| <sequential> |
| <pdeIsInitialized/> |
| <property prefix="@{prefix}" file="@{file}" /> |
| <echo>base = ${@{prefix}.base}</echo> |
| <echo>baseLocation = ${@{prefix}.baseLocation}</echo> |
| <fail> |
| Could not find the eclipse SDK zip file. Please set eclipse.sdk.zip to a valid directory |
| current value ${eclipse.sdk.zip} |
| e.g. if eclipse zip is in c:\downloads then set eclipse.zip to c:\downloads\eclipse-SDK-3.3-win32.zip |
| e.g. eclipse.sdk.zip=c:\downloads\eclipse-SDK-3.3-win32.zip |
| <condition> |
| <not> |
| <available file="${eclipse.sdk.zip}" type="file" /> |
| </not> |
| </condition> |
| </fail> |
| <fail> |
| Could not find the eclipse delta pack zip file please set eclipse.deltapack.zip to a valid directory |
| current value ${eclipse.deltapack.zip} |
| e.g. if eclipse zip is in c:\downloads then set eclipse.deltapack.zip to c:\downloads\eclipse-RCP-3.3-delta-pack.zip |
| e.g. eclipse.zip=c:\downloads\eclipse-RCP-3.3-delta-pack.zip |
| <condition> |
| <not> |
| <available file="${eclipse.deltapack.zip}" type="file" /> |
| </not> |
| </condition> |
| </fail> |
| </sequential> |
| </macrodef> |
| |
| </project> |