| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- ====================================================================== |
| Aug 30, 2007 11:28:45 PM |
| |
| epp |
| Build the the install files for the 5 standard eclipse packages |
| |
| Mark Russell |
| ====================================================================== --> |
| <project name="epp" default="package"> |
| <description> |
| Build the the install files for the 5 standard eclipse packages |
| </description> |
| |
| <import file="build-macros.xml"/> |
| <!-- ================================================= --> |
| <target name="set_recorder" if="recorder.file" |
| depends="read_build_properties"> |
| <echo>recorder file ${build.root}/${recorder.file}</echo> |
| <mkdir dir="${build.root}"/> |
| <touch file="${build.root}/${recorder.file}"></touch> |
| <record name="${build.root}/${recorder.file}" loglevel="${recorder.level}"/> |
| <echoproperties format="text" destfile="${build.root}/properties.txt" /> |
| </target> |
| |
| <!-- ================================================= |
| Read build properties |
| --> |
| <target name="read_build_properties"> |
| <read_product_properties /> |
| <property name="epp.package.dir" location="/opt/eclipses" /> |
| <property name="epp.package.loc" location="${epp.package.dir}" /> |
| </target> |
| |
| <!-- ================================================= |
| setup for local builds |
| --> |
| <target name="setup_local" |
| if="setup.local"> |
| <!-- but this in the temp directory so the eclipsetools.removeNontaggedDirectories |
| does not try to cleanup the temp directory |
| --> |
| <mkdir dir="${build.temp}"/> |
| <touch file="${build.temp}/.clean_build"></touch> |
| </target> |
| |
| <!-- ================================================= |
| If this is Cruise Control, |
| then import the projects and set classpath variables |
| --> |
| <target name="setup_workspace" |
| if="setup.workspace" |
| depends="read_build_properties"> |
| </target> |
| |
| <!-- ================================================= |
| cleanup the temparary directories |
| --> |
| <target name="clean_tmp_directories" |
| if="clean.temp.directories.flag"> |
| <delete_temp_directories/> |
| </target> |
| |
| <!-- ================================================= --> |
| <target name="product_init" |
| depends="read_build_properties, set_recorder, setup_workspace"> |
| <checkEclipseRunning /> |
| |
| <condition property="clean.temp.directories.flag"> |
| <or> |
| <istrue value="${clean.temp.directories}"/> |
| <not> |
| <isset property="clean.temp.directories" /> |
| </not> |
| </or> |
| </condition> |
| <property name="epp.templates.dir" value="../../plugins/org.eclipse.epp.sfx.tools/templates" /> |
| <property name="epp.templates.loc" location="${epp.templates.dir}" /> |
| <echo>epp.templates.loc = ${epp.templates.loc} </echo> |
| <echo>epp.plugins.dir = ${epp.plugins.dir}</echo> |
| <echo>epp.features.dir = ${epp.features.dir}</echo> |
| <fail>could not find the EPP plugins directory it is currently set to ${epp.plugins.dir} |
| This value should be in a file build-settings/${user.name}.properties |
| the value should look like this |
| epp.plugins.dir= either an absolute or relative path to the epp plugins directory |
| <condition> |
| <not> |
| <available file="${epp.plugins.dir}" type="dir" /> |
| </not> |
| </condition> |
| </fail> |
| <fail>could not find the EPP plugins directory it is currently set to ${epp.features.dir} |
| This value should be in a file build-settings/${user.name}.properties |
| the value should look like this |
| epp.features.dir= either an absolute or relative path to the epp features directory |
| <condition> |
| <not> |
| <available file="${epp.features.dir}" type="dir" /> |
| </not> |
| </condition> |
| </fail> |
| </target> |
| |
| <target name="package" depends="init, product_init, clean_tmp_directories, setup_local, package_java" |
| description="--> Build the the install files for the 5 standard eclipse packages"> |
| <echo message="package(s) built" /> |
| </target> |
| |
| <target name="init"> |
| <tstamp /> |
| </target> |
| |
| <target name="package_java"> |
| <property name="epp.java.package.base" value="eclipse-java-europa-" /> |
| <property name="epp.java.package.base.full" value="${epp.package.loc}/eclipse-java-europa-" /> |
| <cleanup_target package="Java" /> |
| <unzip_target package="Java" file="${epp.java.package.base.full}win32.zip" /> |
| <unzip_target package="Java" file="${build.out}/${build.num}-win32.win32.x86.zip" |
| sub="eclipse"/> |
| <package_target package="Java" product="org.eclipse.epp.installer.europa.javapackage" |
| installerName="${epp.java.package.base}win32-installer" |
| pack200="false"/> |
| </target> |
| |
| <!-- = = = = = = = = = = = = = = = = = |
| macrodef: unzip_targer |
| unzip an ecipse package to a given directory |
| === required Parameters: |
| |
| package - the package this unzip is for |
| file - the zip fiole to unzip |
| |
| === optional Parameters: |
| |
| dest - the directory the zip file is unzipped to |
| (default ${build.temp}/@{package}}) |
| |
| === Properties defined: |
| |
| none |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="unzip_target"> |
| <attribute name="package" /> |
| <attribute name="file" /> |
| <attribute name="sub" default="." /> |
| <attribute name="dest" default="${build.temp}/@{package}/@{sub}"/> |
| <sequential> |
| <echo>Unziping @{file} into @{dest}</echo> |
| <mkdir dir="@{dest}"/> |
| <unzip dest="@{dest}" src="@{file}" overwrite="false" /> |
| </sequential> |
| </macrodef> |
| |
| <!-- = = = = = = = = = = = = = = = = = |
| macrodef: package_target |
| packages a target |
| === required Parameters: |
| |
| package - the package this unzip is for |
| installerName - name of the Installer |
| |
| === optional Parameters: |
| |
| dest - the directory the zip file is unzipped to |
| (default ${build.out}}) |
| |
| === Properties defined: |
| |
| none |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="package_target"> |
| <attribute name="package" /> |
| <attribute name="product"/> |
| <attribute name="installerName" /> |
| <attribute name="eclipseSub" default="eclipse" /> |
| <attribute name="installerSub" default="installer" /> |
| <attribute name="src" default="${build.temp}/@{package}/@{eclipseSub}" /> |
| <attribute name="dest" default="${build.out}"/> |
| <attribute name="templates" default="${epp.templates.loc}" /> |
| <attribute name="fullArchiveFile" default="${build.out}/@{installerName}" /> |
| <attribute name="pack200" default="true" /> |
| <attribute name="packagetype" default="exe" /> |
| <attribute name="installerCommandExtenstion" default="exe" /> |
| <attribute name="installerCommand" |
| default="@{installerSub}/InstallEuropa@{package}.@{installerCommandExtenstion}" /> |
| <sequential> |
| <echo> package_target </echo> |
| <echo> package: @{package}</echo> |
| <echo> product: @{product}</echo> |
| <echo> installerName: @{installerName}</echo> |
| <echo> installerSub: @{installerSub}</echo> |
| <echo> eclipseSub: @{eclipseSub}</echo> |
| <echo> installerCommand: @{installerCommand}</echo> |
| <echo> src: @{src}</echo> |
| <echo> dest: @{dest}</echo> |
| <echo> templates: @{templates}</echo> |
| <echo> fullArchiveFile: @{fullArchiveFile}</echo> |
| <echo> packagetype: @{packagetype}</echo> |
| <echo> pack200: @{pack200}</echo> |
| |
| <echo>PackFileset: fileset dir="@{src}/@{package}" includes="@{eclipseSub}/**"</echo> |
| <echo>UnPackFileset: fileset dir="@{src}/@{package}" includes="@{installerSub}/**"</echo> |
| <fileset dir="@{src}/@{package}" includes="@{eclipseSub}/**" id="@{package}.pack.fs"/> |
| <fileset dir="@{src}/@{package}" includes="@{installerSub}/**" id="@{package}.unpack.fs"/> |
| |
| <archivetask packagetype="@{packagetype}" |
| command="@{installerCommand} -vmargs -Dinstaller.jar.path=$#launcher#" |
| archivefile="@{fullArchiveFile}" |
| rootdir="@{src}" |
| templates="@{templates}" |
| pack200="@{pack200}"> |
| <fileset dir="@{src}" includes="**" excludes="**/@{installerCommand}"/> |
| <unpack> |
| <fileset dir="@{src}" includes="@{installerSub}/**" /> |
| </unpack> |
| </archivetask> |
| <!-- |
| <create_archive product="org.eclipse.epp.installer.europa.javapackage" |
| package="java"> |
| <content> |
| <fileset dir="@{dest}" /> |
| </content> |
| <unpackContent> |
| <fileset dir="@{dest}" /> |
| </unpackContent> |
| </create_archive> |
| --> |
| </sequential> |
| </macrodef> |
| |
| <!-- = = = = = = = = = = = = = = = = = |
| macrodef: cleanup_target |
| cleanup the data from a given target |
| === required Parameters: |
| |
| package - the package this unzip is for |
| |
| === optional Parameters: |
| |
| dest - the directory the zip file is unzipped to |
| (default ${build.temp/@{package}}) |
| |
| === Properties defined: |
| |
| none |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="cleanup_target"> |
| <attribute name="package" /> |
| <attribute name="dest" default="${build.temp}/@{package}"/> |
| <sequential> |
| <echo> cleaning up @{dest} </echo> |
| <mkdir dir="@{dest}"/> |
| <delete includeemptydirs="yes"> |
| <fileset dir="@{dest}" /> |
| </delete> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="create_archive"> |
| <attribute name="product" /> |
| <attribute name="package" /> |
| <attribute name="archiveFile" default="install" /> |
| <attribute name="dest" default="${build.temp}/@{package}"/> |
| <attribute name="fullArchiveFile" default="${build.out}/@{archiveFile}" /> |
| <attribute name="packagetype" default="exe" /> |
| <attribute name="templates" default="${epp.templates.loc}" /> |
| <attribute name="pack200" default="true" /> |
| <element name="content" implicit="false" optional="false"/> |
| <element name="unpackContent" implicit="false" optional="false"/> |
| |
| <sequential> |
| <echo> create_archive</echo> |
| <echo> product: @{product}</echo> |
| <echo> package: @{package}</echo> |
| <echo> archiveFile: @{archiveFile}</echo> |
| <echo> dest: @{dest}</echo> |
| <echo> fullArchiveFile: @{fullArchiveFile}</echo> |
| <echo> packagetype: @{packagetype}</echo> |
| <echo> templates: @{templates}</echo> |
| <echo> pack200: @{pack200}</echo> |
| <echo> content: @{content}</echo> |
| <echo> unpackContent: @{unpackContent}</echo> |
| |
| <!-- |
| <property file="${dltk.builder.home}/build.properties" /> |
| <property name="pde.builder.path" value="${env.BUILD_HOME}/builders/${eclipse.builder.version}/${eclipse.builder}" /> |
| <echo message="pde.builder.path: ${pde.builder.path}" /> |
| <echo message="eclipse.builder.version: ${eclipse.builder.version}" /> |
| <echo message="eclipse.builder: ${eclipse.builder}" /> |
| --> |
| <archivetask packagetype="@{packagetype}" |
| command="eclipse/eclipse.exe -product @{product} -vmargs -Dinstaller.jar.path=$#launcher#" |
| archivefile="@{fullArchiveFile}" |
| rootdir="@{dest}" |
| templates="@{templates}" |
| pack200="@{pack200}"> |
| <content/> |
| <unpack> |
| <unpackContent /> |
| </unpack> |
| </archivetask> |
| |
| </sequential> |
| </macrodef> |
| </project> |