| <?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> |
| <!-- ================================================= |
| Read the product level build properties from |
| --> |
| <macrodef name="read_product_properties"> |
| <attribute name="user.name" default="${user.name}" /> |
| <attribute name="user.property.file" |
| default="build-settings/@{user.name}.properties" /> |
| <sequential> |
| <!-- Read properties from user specific and product specific files --> |
| <fail> |
| <condition> |
| <not> |
| <available file="@{user.property.file}" /> |
| </not> |
| </condition>* |
| *********************************************************************** |
| Cannot find file: @{user.property.file} |
| |
| Copy an existing user properties file such as |
| build-settings/example-user.properties |
| to |
| @{user.property.file} |
| and modify it to contain settings for your particular situation. |
| *********************************************************************** |
| </fail> |
| <property file="build-settings/product.properties" /> |
| <property file="@{user.property.file}" /> |
| |
| <!-- Verify required properties are defined --> |
| <fail unless="build.root" /> |
| <fail unless="product.name" /> |
| <fail unless="product.version" /> |
| |
| <init_root_properties /> |
| |
| <mkdir dir="${build.out}"/> |
| |
| <echo>build.root = ${build.root}</echo> |
| <echo>build.temp = ${build.temp}</echo> |
| <echo>build.out = ${build.out}</echo> |
| <echo>log.dir = ${log.dir}</echo> |
| <echo>product.name = ${product.name}</echo> |
| <echo>product.version = ${product.version}</echo> |
| <echo>product.id = ${product.id}</echo> |
| </sequential> |
| </macrodef> |
| |
| <!-- = = = = = = = = = = = = = = = = = |
| macrodef: init_root_properties |
| = = = = = = = = = = = = = = = = = --> |
| <macrodef name="init_root_properties"> |
| <attribute name="build.root" default="${build.root}" /> |
| <sequential> |
| <!-- Properties derived from ${build.root} --> |
| <property name="build.out" location="@{build.root}/product" /> |
| <property name="build.out.root" location="@{build.root}/.." /> |
| <property name="build.temp.name" value="temp" /> |
| <property name="build.temp" |
| location="${build.root}/${build.temp.name}" /> |
| <property name="log.dir" location="@{build.root}/logs" /> |
| |
| </sequential> |
| </macrodef> |
| <!-- ================================================= |
| Check that the build script is executing in an Eclpse environment |
| --> |
| <macrodef name="checkEclipseRunning"> |
| <sequential> |
| <fail unless="eclipse.running">* |
| *********************************************************************** |
| This build script must be executed inside an Eclipse environment. |
| |
| If you are executing from the Eclipse UI, |
| be sure to switch to the "JRE" tab of the Ant Script Launch Configuration |
| and select the "Run in the same JRE as the workspace" radio button |
| |
| If you are executing Ant headless, |
| then execute inside headless Eclipse using a command line something like this: |
| |
| java -cp /opt/eclipses/eclipse_311/startup.jar org.eclipse.core.launcher.Main |
| -clean -noupdate -configuration ../configuration |
| -application org.eclipse.ant.core.antRunner -data .. |
| -verbose -file build-product.xml |
| |
| *********************************************************************** |
| </fail> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="delete_temp_directories"> |
| <sequential> |
| <!-- Delete the temporary directory --> |
| <delete dir="${build.temp}" verbose="false" /> |
| <delete dir="${build.out}/install-image" verbose="false" /> |
| |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="copyToInstallImage"> |
| <attribute name="product" /> |
| <attribute name="baseDir" default="${build.out}/../../@{product}" /> |
| <attribute name="productDir" default="@{baseDir}/product" /> |
| <attribute name="installImageDir" default="${build.out}/install-image" /> |
| <sequential> |
| <copy todir="@{installImageDir}"> |
| <fileset dir="@{productDir}/install-image" /> |
| </copy> |
| </sequential> |
| </macrodef> |
| |
| <!-- ================================================= |
| Setup the java variables |
| --> |
| <macrodef name="set_java"> |
| <sequential> |
| <property name="java.prefix.path" location="/usr/java" /> |
| <property name="java.6.path" value="${java.prefix.path}/jdk1.6.0_01"/> |
| <property name="java.5.path" value="${java.prefix.path}/jdk1.5.0_08"/> |
| <property name="java.4.path" value="${java.prefix.path}/j2sdk1.4.2_12"/> |
| <property name="java.3.path" value="${java.prefix.path}/jdk1.3.1_19"/> |
| <property name="java.6.path.javac" value="${java.6.path}/bin/javac"/> |
| <property name="java.5.path.javac" value="${java.5.path}/bin/javac"/> |
| <property name="java.4.path.javac" value="${java.4.path}/bin/javac"/> |
| <property name="java.3.path.javac" value="${java.3.path}/bin/javac"/> |
| <property name="java.6.path.rt" value="${java.6.path}/jre/lib/rt.jar"/> |
| <property name="java.5.path.rt" value="${java.5.path}/jre/lib/rt.jar"/> |
| <property name="java.4.path.rt" value="${java.4.path}/jre/lib/rt.jar"/> |
| <property name="java.3.path.rt" value="${java.3.path}/jre/lib/rt.jar"/> |
| |
| |
| <echo message="java.6.path.rt = ${java.6.path.rt}" /> |
| <echo message="java.5.path.rt = ${java.5.path.rt}" /> |
| <echo message="java.4.path.rt = ${java.4.path.rt}" /> |
| <echo message="java.3.path.rt = ${java.3.path.rt}" /> |
| <echo message="java.6.path.javac = ${java.6.path.javac}" /> |
| <echo message="java.5.path.javac = ${java.5.path.javac}" /> |
| <echo message="java.4.path.javac = ${java.4.path.javac}" /> |
| <echo message="java.3.path.javac = ${java.3.path.javac}" /> |
| |
| <propertyset id="java.propertyset"> |
| <propertyref prefix="java.3" /> |
| <propertyref prefix="java.4" /> |
| <propertyref prefix="java.5" /> |
| <propertyref prefix="java.6" /> |
| </propertyset> |
| |
| </sequential> |
| </macrodef> |
| |
| </project> |