Bug 272820 - Tweak build scripts, clarify separation of distribution and build
Summary: Tweak build scripts, clarify separation of distribution and build
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: LinuxTools (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Packaging Tools Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2009-04-19 08:34 EDT by Marvin Schmidt CLA
Modified: 2022-01-13 14:51 EST (History)
2 users (show)

See Also:


Attachments
Turn fetch.xml into distribution.xml (11.54 KB, patch)
2009-04-19 08:34 EDT, Marvin Schmidt CLA
no flags Details | Diff
Updated patch, added devBuild target (11.66 KB, patch)
2009-04-21 10:23 EDT, Marvin Schmidt CLA
overholt: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marvin Schmidt CLA 2009-04-19 08:34:16 EDT
Created attachment 132344 [details]
Turn fetch.xml into distribution.xml

Right now we have a target to package a all-in-one zip in the build, which creates a zip with the SDK source archive, build scripts and patches.
This patch separates distribution and build scripts clear by moving all distribution-related tasks to fetch.xml making it distribution/package.xml and removing all tasks we don't need to care about when shipping a all-in-one archive from the build scripts.

Here's what i've done:

build.properties:
- externalize sdkSource

fetch.xml:
- move distSrc to from build{,-p2}.xml here
- get rid of skipFetch as we can't skip it in the distribution process
- distSrc:
    * include extracted and patched SDK => no need to ship patches/, com.ibm.icu.*.jar
    * create .tar.bz2 instead of zip
      my test gave me:
         gz  => 81M 
         bz2 => 71M

build{,-p2}.xml:
- remove properties which are already provided by build.properties
- remove distSrc

build{,-p2}.xml / pdebuild.xml:
- remove fetch target as we're shipping these scripts with source

Best regards,
Marvin Schmidt
Comment 1 Marvin Schmidt CLA 2009-04-21 10:13:50 EDT
Comment on attachment 132344 [details]
Turn fetch.xml into distribution.xml

Index: pdebuild.xml
===================================================================
--- pdebuild.xml	(revision 21966)
+++ pdebuild.xml	(working copy)
@@ -1,7 +1,6 @@
 <project name="Pdebuild bootstrap" default="cleanBuild" basedir=".">
 	<target name="cleanBuild" depends="clean,collectBootstrapPlugins" />
 	<property file="build.properties" />
-	<available file="${sdkSource}" property="fetched" value="true" />
 	<!-- Order in this filelist is critical for building !!! -->
 	<filelist id="depsDirs" dir="${sdkSource}/plugins">
 		<file name="org.eclipse.osgi" />
@@ -65,9 +64,6 @@
 	</path>
 	<fileset id="depsZips" dir="${sdkSource}/plugins" includes="**/*_*.zip">
 	</fileset>
-	<target name="fetch" unless="fetched">
-		<ant antfile="fetch.xml" />
-	</target>
 	<target name="bootstrap">
 		<subant>
 			<filelist refid="depsDirs" />
Index: fetch.xml
===================================================================
--- fetch.xml	(revision 21966)
+++ fetch.xml	(working copy)
@@ -1,9 +1,13 @@
-<project name="Fetch srcIncluded zip" default="applyPatches" basedir=".">
+<project name="Create all-in-one tarball" default="distSrc" basedir=".">
 	<property file="build.properties" />
 	<property name="downloadFileName"
 	          value="eclipse-sourceBuild-srcIncluded-${buildID}.zip" />
-	<available file="${sdkSource}" property="skipFetch" value="true" />
-	<target name="download" unless="skipFetch">
+
+	<target name="clean">
+		<delete dir="${sdkSource}" />
+	</target>
+
+	<target name="download">
 		<get src="http://download.eclipse.org/eclipse/downloads/drops/${buildID}/${downloadFileName}"
 		     dest="${downloadFileName}"
 		     usetimestamp="true" />
@@ -11,6 +15,7 @@
 		     dest="com.ibm.icu.source_4.0.1.v20090109.jar"
 		     usetimestamp="true" />
 	</target>
+
 	<target name="newSources"
 	        depends="download"
 	        description="Replace old unzipped sources with unmodified from the downloaded zip">
@@ -23,26 +28,50 @@
 			</fileset>
 		</delete>
 	</target>
+
 	<target name="insertBuildId" depends="newSources">
-			<replace dir="${sdkSource}/plugins" value="${buildID}" token="@build@">
-				<include name="**/about.mappings" />
-			</replace>
-			<replace dir="${sdkSource}" value="${buildID}" token="@build@">
-				<include name="**/configuration/config.ini" />
-			</replace>
-		</target>
+		<replace dir="${sdkSource}/plugins" value="${buildID}" token="@build@">
+			<include name="**/about.mappings" />
+		</replace>
+		<replace dir="${sdkSource}" value="${buildID}" token="@build@">
+			<include name="**/configuration/config.ini" />
+		</replace>
+	</target>
+
 	<target name="applyPatches" depends="insertBuildId">
 		<patch patchfile="./patches/eclipse-buildswtnatives.patch"
-		       dir="./${sdkSource}"
+		       dir="${sdkSource}"
 		       strip="0" />
 		<patch patchfile="./patches/eclipse-swt-buildagainstxulrunner.patch"
-				       dir="./${sdkSource}/plugins/org.eclipse.swt/Eclipse SWT PI/gtk/library"
-				       strip="3" />
+		       dir="${sdkSource}/plugins/org.eclipse.swt/Eclipse SWT PI/gtk/library"
+		       strip="3" />
+
 		<!-- Fetch due to bug in srcIncluded generation.-->
 		<copy tofile="${sdkSource}/plugins/com.ibm.icu.source_4.0.1.v20090109.jar"
 		      file="com.ibm.icu.source_4.0.1.v20090109.jar" />
 	</target>
-	<target name="clean">
-		<delete dir="${sdkSource}" />
+
+	<target name="distSrc"
+	        depends="applyPatches"
+	        description="Package the patched SDK, all scripts and documentation">
+		<basename property="ant.file.name" file="${ant.file}"/>
+
+		<tar destfile="eclipse-linuxBuild-${buildID}.tar.bz2" longfile="gnu" compression="bzip2">
+			<tarfileset dir=".">
+				<!-- SDK sources -->
+				<include name="${sdkSource}/**" />
+
+				<!-- bootstrap config -->
+				<include name="bootstrap/configuration/config.ini" />
+
+				<!-- all build scripts except this one -->
+				<include name="*.xml" />
+				<include name="*.properties" />
+				<exclude name="${ant.file.name}" />
+
+				<!-- documentation -->
+				<include name="*.mediawiki" />
+			</tarfileset>
+		</tar>
 	</target>
 </project>
Index: build.properties
===================================================================
--- build.properties	(revision 21966)
+++ build.properties	(working copy)
@@ -10,4 +10,5 @@
 buildArch=x86
 ws=gtk
 os=linux
-buildID=I20090416-1053
\ No newline at end of file
+buildID=I20090416-1053
+sdkSource=SDK
Index: build.xml
===================================================================
--- build.xml	(revision 21966)
+++ build.xml	(working copy)
@@ -1,39 +1,40 @@
 <project name="Eclipse SDK build" default="cleanBuild" basedir=".">
-	<property name="javacFailOnError" value="true" />
-	<target name="cleanBuild" depends="clean,insert-ecf" />
-	<property name="sdkSource" value="SDK" />
 	<property file="build.properties" />
-	<property name="buildArch" value="x86" />
-	<available file="${sdkSource}" property="fetched" value="true" />
 	<available file="bootstrap/plugins" property="bootstrapped" value="true" />
-	<target name="fetch" unless="fetched">
-		<ant antfile="fetch.xml" />
-	</target>
-	<target name="bootstrap" unless="bootstrapped">
-		<ant antfile="pdebuild.xml" />
-	</target>
-	<target name="clean" depends="fetch">
+
+	<target name="cleanBuild" depends="clean,insert-ecf" />
+
+	<target name="clean">
 		<delete dir="build" />
 	</target>
-	<target name="cleanAll">
+
+	<target name="cleanAll" depends="clean">
 		<ant antfile="pdebuild.xml" target="clean" />
-		<ant antfile="fetch.xml" target="clean" />
-		<delete dir="build" />
 	</target>
+
+	<target name="devBuild">
+		<ant antfile="fetch.xml" target="applyPatches" />
+		<antcall target="cleanBuild" />
+	</target>
+
+	<target name="bootstrap" unless="bootstrapped">
+		<ant antfile="pdebuild.xml" />
+	</target>
+
 	<target name="prepareBuildScriptGeneration" depends="bootstrap">
 		<delete dir="build" />
 		<mkdir dir="build/features" />
+		<copy todir="build/features/">
+			<fileset dir="${sdkSource}/features/">
+				<exclude name="**/*.source/" />
+			</fileset>
+		</copy>
 		<mkdir dir="build/plugins" />
 		<copy todir="build/plugins/">
 			<fileset dir="${sdkSource}/plugins/">
 				<exclude name="**/*.source_*/" />
 			</fileset>
 		</copy>
-		<copy todir="build/features/">
-			<fileset dir="${sdkSource}/features/">
-				<exclude name="**/*.source/" />
-			</fileset>
-		</copy>
 		<copy todir="build/plugins/">
 			<fileset dir="${sdkSource}/plugins/">
 				<include name="org.apache.ant.source_*" />
@@ -55,6 +56,7 @@
 		<move tofile="build/plugins/org.junit"
 		      file="build/plugins/org.junit_3.8.2.v20090203-1005" />
 	</target>
+
 	<target name="generateBuildScripts" depends="prepareBuildScriptGeneration">
 		<java classname="org.eclipse.equinox.launcher.Main"
 		      fork="true"
@@ -70,6 +72,7 @@
 			<arg line="-DbuildArch=${buildArch} " />
 		</java>
 	</target>
+
 	<target name="buildAll" depends="generateBuildScripts">
 		<!--FIXME Ugly hack because?  flattenDependencies doesn't work . -->
 		<ant antfile="build.xml"
@@ -104,6 +107,7 @@
 			<property name="arch" value="${buildArch}" />
 		</ant>
 	</target>
+
 	<path id="pdebuildClasspath">
 		<pathelement location="build/plugins/org.eclipse.pde.build/lib/pdebuild-ant.jar" />
 		<pathelement location="build/plugins/org.eclipse.pde.build/pdebuild.jar" />
@@ -153,6 +157,7 @@
 		     antfile="build.xml" />
 
 	</target>
+
 	<target name="assemble" depends="buildAll, compilelibs">
 		<taskdef name="eclipse.versionReplacer"
 		         classname="org.eclipse.pde.internal.build.tasks.GenericVersionReplacer"
@@ -180,6 +185,7 @@
 			<property name="generateFeatureVersionSuffix" value="true" />
 		</ant>
 	</target>
+
 	<target name="insert-ecf" depends="assemble">
 		<zip destfile="build/3.5/org.eclipse.sdk-3.5M6-linux.gtk.${buildArch}.zip"
 		     update="true">
@@ -188,18 +194,4 @@
 			            prefix="eclipse/plugins" />
 		</zip>
 	</target>
-	<target name="distSrc" description="Creates an all-in-one zip.">
-		<ant antfile="fetch.xml" target="download" />
-		<zip destfile="eclipse-SDK-all.zip">
-			<fileset dir="."
-			         includes="eclipse-sourceBuild-srcIncluded-${buildID}.zip" />
-			<fileset dir="."
-			         includes="com.ibm.icu.source_4.0.1.v20090109.jar" />
-			<fileset dir="." includes="*.xml" />
-			<fileset dir="." includes="*.properties" />
-			<fileset dir="." includes="*.mediawiki" />
-			<fileset dir="." includes="bootstrap/**" />
-			<fileset dir="." includes="patches/**" />
-		</zip>
-	</target>
 </project>
Index: build-p2.xml
===================================================================
--- build-p2.xml	(revision 21966)
+++ build-p2.xml	(working copy)
@@ -1,26 +1,22 @@
 <project name="Eclipse SDK build" default="cleanBuild" basedir=".">
-	<property name="javacFailOnError" value="true" />
-	<target name="cleanBuild" depends="clean,insert-ecf" />
-	<property name="sdkSource" value="SDK" />
 	<property file="build.properties" />
 	<property file="p2.properties" />
-	<property name="buildArch" value="x86" />
-	<available file="${sdkSource}" property="fetched" value="true" />
 	<available file="bootstrap/plugins" property="bootstrapped" value="true" />
-	<target name="fetch" unless="fetched">
-		<ant antfile="fetch.xml" />
-	</target>
-	<target name="bootstrap" unless="bootstrapped">
-		<ant antfile="pdebuild.xml" />
-	</target>
-	<target name="clean" depends="fetch">
+
+	<target name="cleanBuild" depends="clean,insert-ecf" />
+
+	<target name="clean">
 		<delete dir="build" />
 	</target>
-	<target name="cleanAll">
+
+	<target name="cleanAll" depends="clean">
 		<ant antfile="pdebuild.xml" target="clean" />
-		<ant antfile="fetch.xml" target="clean" />
-		<delete dir="build" />
 	</target>
+
+	<target name="bootstrap" unless="bootstrapped">
+		<ant antfile="pdebuild.xml" />
+	</target>
+
 	<target name="prepareBuildScriptGeneration" depends="bootstrap">
 		<delete dir="build" />
 		<mkdir dir="build/features" />
@@ -56,6 +52,7 @@
 		<move tofile="build/plugins/org.junit"
 		      file="build/plugins/org.junit_3.8.2.v20090203-1005" />
 	</target>
+
 	<target name="generateBuildScripts" depends="prepareBuildScriptGeneration">
 		<java classname="org.eclipse.equinox.launcher.Main"
 		      fork="true"
@@ -71,6 +68,7 @@
 			<arg line="-DbuildArch=${buildArch} " />
 		</java>
 	</target>
+
 	<target name="buildAll" depends="generateBuildScripts">
 		<!--FIXME Ugly hack because?  flattenDependencies doesn't work . -->
 		<ant antfile="build.xml"
@@ -113,6 +111,7 @@
 			<property name="arch" value="${buildArch}" />
 		</ant>
 	</target>
+
 	<path id="pdebuildClasspath">
 		<pathelement location="build/plugins/org.eclipse.pde.build/lib/pdebuild-ant.jar" />
 		<pathelement location="build/plugins/org.eclipse.pde.build/pdebuild.jar" />
@@ -171,6 +170,7 @@
 		     antfile="build.xml" />
 
 	</target>
+
 	<target name="assemble" depends="buildAll, compilelibs">
 		<java classname="org.eclipse.equinox.launcher.Main"
 		      fork="true"
@@ -186,6 +186,7 @@
 			<arg line="-DbuildArch=${buildArch} " />
 		</java>
 	</target>
+
 	<target name="insert-ecf" depends="assemble">
 		<zip destfile="build/3.5/org.eclipse.sdk-3.5M6-linux.gtk.x86.zip"
 		     update="true">
@@ -194,18 +195,4 @@
 			            prefix="eclipse/plugins" />
 		</zip>
 	</target>
-	<target name="distSrc" description="Creates an all-in-one zip.">
-		<ant antfile="fetch.xml" target="download" />
-		<zip destfile="eclipse-SDK-all.zip">
-			<fileset dir="."
-			         includes="eclipse-sourceBuild-srcIncluded-${buildID}.zip" />
-			<fileset dir="."
-			         includes="com.ibm.icu.source_4.0.1.v20090109.jar" />
-			<fileset dir="." includes="*.xml" />
-			<fileset dir="." includes="*.properties" />
-			<fileset dir="." includes="*.mediawiki" />
-			<fileset dir="." includes="bootstrap/**" />
-			<fileset dir="." includes="patches/**" />
-		</zip>
-	</target>
 </project>
Comment 2 Marvin Schmidt CLA 2009-04-21 10:23:37 EDT
Created attachment 132609 [details]
Updated patch, added devBuild target
Comment 3 Alexander Kurtakov CLA 2009-04-22 11:05:01 EDT
Applied in r21995.
Thanks Marvin.
Comment 4 Andrew Overholt CLA 2009-04-22 11:27:07 EDT
Setting iplog+