diff options
author | Lakshmi Shanmugam | 2017-11-21 08:12:59 +0000 |
---|---|---|
committer | Lakshmi Shanmugam | 2017-11-21 08:12:59 +0000 |
commit | d84704e156af01947bc850ebb685d8bd9c9ecae1 (patch) | |
tree | 2613a3065a46d652a5a8d2250fb8462973696a95 | |
parent | 2c1e42de2410e9ec0a8d4d5f1e4b0a39359d48cf (diff) | |
download | eclipse.platform.swt-d84704e156af01947bc850ebb685d8bd9c9ecae1.tar.gz eclipse.platform.swt-d84704e156af01947bc850ebb685d8bd9c9ecae1.tar.xz eclipse.platform.swt-d84704e156af01947bc850ebb685d8bd9c9ecae1.zip |
Bug 527537: Build file changes for building natives on Eclipse
Foundation infrastructure
Created new targets to copy the lib source and build natives.
Change-Id: I80d1b32c8c27ced01a48395eed0c674fa065cef7
-rw-r--r-- | bundles/org.eclipse.swt/buildSWT.xml | 91 |
1 files changed, 87 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/buildSWT.xml b/bundles/org.eclipse.swt/buildSWT.xml index 83df07afea..e7e6cb153c 100644 --- a/bundles/org.eclipse.swt/buildSWT.xml +++ b/bundles/org.eclipse.swt/buildSWT.xml @@ -549,6 +549,14 @@ ]]> </script> </target> + + <target name="update_sha1_file_in_fragment"> + <!-- Update build.sha1 file --> + <exec dir="${repo.src}" executable="git" failonerror="true" outputproperty="HEAD_TAG"> + <arg line="rev-list ${TAG} -1"/> + </exec> + <echo file="${fragment_dir}/build.sha1" append="false">SHA1=${HEAD_TAG}</echo> + </target> <!-- Params: swt.ws, swt.os, swt.arch Note that the build.sha1 file is updated even if the libraries are not built to ensure there is a change @@ -559,10 +567,7 @@ <antcall target="build_fragment_libraries"/> <!-- Update build.sha1 file --> - <exec dir="${repo.src}" executable="git" failonerror="true" outputproperty="HEAD_TAG"> - <arg line="rev-list ${TAG} -1"/> - </exec> - <echo file="${fragment_dir}/build.sha1" append="false">SHA1=${HEAD_TAG}</echo> + <antcall target="update_sha1_file_in_fragment"/> </target> <target name="build_fragment_libraries" if="natives_changed"> <antcall target="build_libraries"/> @@ -958,4 +963,82 @@ <replace dir="${replace_dir}" includes="**/*.java" token="double[] /*float[]*/" value="float[] /*double[]*/"/> <antcall target="init_build"/> </target> + + <!-- ******************************************************************************** --> + <!-- targets to run the builds on the Eclipse Foundation Hudson in master-slave setup --> + <!-- ******************************************************************************** --> + + <target name="copy_library_src_and_create_zip" depends="init_fragment,check_sha1_changed"> + <property name="swt.arch" value=""/> + <property name="project_dir" value="${basedir}/${repo.src}"/> + <property name="output_dir" value="${basedir}/${fragment_dir}"/> + <property name="build_dir" value="${basedir}/${fragment_dir}/tmpdir"/> + <property name="zip_file" value="${fragment}.${TAG}.zip"/> + <delete dir="${build_dir}" quiet="true"/> + + <!-- copy the library source files --> + <antcall target="copy.library.src"/> + + <!-- create a zip of the native source files to be sent to the build machine --> + <zip destfile="${build_dir}/${zip_file}" basedir="${build_dir}" excludes="${zip_file}"/> + </target> + + <target name="build_libraries_slave" depends="init_fragment"> + <property name="swt.arch" value=""/> + <property name="clean" value="clean"/> + <property name="targets" value="install"/> + <property name="libs" value="*"/> + <property name="src_zip_file" value="${fragment}.${TAG}.zip"/> + <property name="lib_zip_file" value="${fragment}.${TAG}.zip"/> + + <condition property="remotebuilddir" value="c:/build" else="build/"> + <equals arg1="${swt.os}" arg2="win32"/> + </condition> + <property name="remotetmpdir" value="${remotebuilddir}/${fragment}.${TAG}"/> + <property name="lib_output" value="${remotetmpdir}/libs"/> + <condition property="build_task" value="build_win_slave" else="build_remote_slave"> + <equals arg1="${swt.ws}" arg2="win32"/> + </condition> + + <!-- This target doesn't copy the src zip, it expects that the zip file is already be copied to remotebuilddir --> + + <echo>${remotebuilddir}</echo> + <delete dir="${remotetmpdir}" quiet="false"/> + <mkdir dir="${remotetmpdir}"/> + <mkdir dir="${lib_output}"/> + <unzip src="${remotebuilddir}/${src_zip_file}" dest="${remotetmpdir}"/> + <delete file="${remotebuilddir}/${zip_file}"/> + + <antcall target="${build_task}"> + <param name="build_targets" value="${targets}"/> + </antcall> + + <antcall target="build_gtk3"/> + + <zip destfile="${remotetmpdir}/${lib_zip_file}" basedir="${lib_output}" excludes="${zip_file}" compress="false"/> + </target> + + <target name="build_win_slave"> + <echo>${remotetmpdir}</echo> + <pathconvert property="win_output_dir"> + <path location="${lib_output}"></path> + </pathconvert> + <exec dir="${remotetmpdir}" executable="${remotetempdir}/build.bat" failonerror="true"> + <env key="OUTPUT_DIR" value="${win_output_dir}"/> + <arg line="${build_targets}"/> + <arg line="${clean}"/> + </exec> + </target> + + <target name="build_remote_slave"> + <echo>${remotetmpdir}</echo> + <exec dir="${remotetmpdir}" executable="sh" failonerror="true"> + <arg line="build.sh"/> + <env key="GTK_VERSION" value="${gtk_version}"/> + <env key="MODEL" value="${swt.arch}"/> + <env key="OUTPUT_DIR" value="${lib_output}"/> + <arg line="${build_targets}"/> + <arg line="${clean}"/> + </exec> + </target> </project> |