Jump to: navigation, search

Difference between revisions of "Platform-releng-sourcebuild"

(added warning and link to newer information)
 
Line 1: Line 1:
 +
{{warn|This page is no longer valid. Instead, see [[Platform-releng/Platform_Build]]}}
 +
 
<h3>How do the platform team create it's source build?</h3>
 
<h3>How do the platform team create it's source build?</h3>
  

Latest revision as of 11:32, 28 March 2013

Warning

This page is no longer valid. Instead, see Platform-releng/Platform_Build


How do the platform team create it's source build?

The source build can be used by teams interested in building eclipse from source on their own local hardware. The source build just provides the facility to build the eclipse SDK. The eclipse-sourceBuild-srcIncluded-${buildId}.zip includes all the source and the build scripts used to generate the build. The eclipse-sourceBuild-srcFetch-${buildId}.zip includes the source for the doc plugins (because the indexes are pre-generated) and the build scripts used to generate the build.

The basic steps involved in generating our source build are

Notes about the platform source build

  • We bootstrap the jdt core compiler to satisfy requirements of linux distributions building eclipse.
  • We don't compile against other components so teams with this requirement would have to add this to their source build
  • The scripts are a lot more complicated than they could be simply because we have added functionality over time as people have requested changes to support their consumption of this drop. A project with a simpler build process than us would have more concise source build scripts :-) .

Building the source build is the first step of our build process. See the buildEclipseSourceDrops target in org.eclipse.releng.eclipsebuilder/buildAll.xml. http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng.eclipsebuilder/buildAll.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup This target fetches and generates the build scripts for the sdk examples and sdk.

<target name="buildEclipseSourceDrops">
		<property name="buildSourceDrops" value="true"/>
		<!--examples are required to pull sample doc into SDK doc plug-ins-->
	        <ant antfile="build.xml" dir="${eclipse.pdebuild.scripts}" target="preBuild">
			<property name="builder" value="${eclipse.build.configs}/sdk.examples" />
		</ant>
		<ant antfile="build.xml" dir="${eclipse.pdebuild.scripts}" target="fetch">
			<property name="builder" value="${eclipse.build.configs}/sdk.examples" />
		</ant>
		<!--fetch source and generate scripts for eclipse SDK-->
		<ant antfile="build.xml" dir="${eclipse.pdebuild.scripts}" target="preBuild">
			<property name="builder" value="${eclipse.build.configs}/sdk" />
		</ant>
		<ant antfile="build.xml" dir="${eclipse.pdebuild.scripts}" target="fetch">
			<property name="builder" value="${eclipse.build.configs}/sdk" />
                </ant>
		<ant antfile="build.xml" dir="${eclipse.pdebuild.scripts}" target="generate">
			<property name="builder" value="${eclipse.build.configs}/sdk" />
		</ant>
	</target>

Calling the generate target in the ${eclipse.build.configs}/sdk will call the postgenerate target in org.eclipse.releng.eclipsebuilder/eclipse/buildConfigs/sdk/customTargets.xml

        <!-- ===================================================================== -->
	<!-- Steps to do after generating the build scripts -->
	<!-- ===================================================================== -->
	<target name="postGenerate">
		<antcall target="clean" />
		<antcall target="buildSourceDrops" />
	</target>

which calls the buildSourceDrops target in org.eclipse.releng.eclipsebuilder/eclipse/buildConfigs/sdk/customTargets.xml. This target copies the appropriate files to be zipped up in the source fetch and source zipped directory.


http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng.eclipsebuilder/eclipse/buildConfigs/sdk/customTargets.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup

        <!-- ===================================================================== -->
	<!-- Targets called before extracting binary distributables.               -->
	<!-- ===================================================================== -->
	<target name="buildSourceDrops" if="buildSourceDrops">
		<mkdir dir="${postingDirectory}/${buildLabel}" />
		<mkdir dir="${postingDirectory}/${buildLabel}/checksum" />
		<property name="tempDir" value="${basedir}/temp" />
		<mkdir dir="${tempDir}/buildScripts" />
		<mkdir dir="${tempDir}/buildScripts/baseLocation" />


		<copy file="${buildDirectory}/label.properties" todir="${tempDir}/buildScripts" />

		<copy todir="${tempDir}/buildScripts" flatten="true" overwrite="true">
			<fileset dir="${eclipse.build.configs}/sdk/srcBuild" excludes="incl,fetch/**,jdtcoresrc/**" />
		</copy>

		<copy todir="${tempDir}/buildScripts/baseLocation">
			<fileset dir="${baseLocation}" />
		</copy>
		
		<mkdir dir="${tempDir}/buildScripts/jdtcoresrc"/>
		<copy todir="${tempDir}/buildScripts/jdtcoresrc">
			<fileset dir="${eclipse.build.configs}/sdk/srcBuild/jdtcoresrc"/>
		</copy>

		<!--  set correct permissions on linux script -->
		<chmod file="${tempDir}/buildScripts/build" perm="755" />

		<!--copy example doc -->
		<ant antfile="buildDoc.xml" target="examplesDocCopy" dir="${buildDirectory}/plugins/org.eclipse.platform.doc.isv"/>
		<ant antfile="buildDoc.xml" target="examplesDocCopy" dir="${buildDirectory}/plugins/org.eclipse.jdt.doc.isv"/>

		<copy todir="${tempDir}/buildScripts">
			<fileset dir="${buildDirectory}" excludes="features/*example*/**,plugins/*example*/**" includes="features/*/build.xml,features/*.source*/**,plugins/*/build.xml,plugins/*/javaCompiler.*.args,plugins/*.source*/**,fetch_*.xml,assemble*.xml,package*.xml,plugins/org.eclipse.swt.tools/**,plugins/*doc*/**" />
		</copy>
		<!--ensure linux drops are created as .tar.gz files -->
		<replace dir="${tempDir}/buildScripts" includes="assemble*" excludes="*win32*,*hpux*,*solaris*,*aix*" token=".zip" value=".tar.gz"/>

		<!-- create drop containing the fetch scripts, no source -->
		<exec dir="${tempDir}" executable="zip">
			<arg line="-q ${postingDirectory}/${buildLabel}/eclipse-sourceBuild-srcFetch-${buildId}.zip -r ." />
		</exec>

		<!--generate md5-->
		<checksum file="${postingDirectory}/${buildLabel}/eclipse-sourceBuild-srcFetch-${buildId}.zip" property="md5"/>
		<echo message="${md5} *eclipse-sourceBuild-srcFetch-${buildId}.zip" file="${postingDirectory}/${buildLabel}/checksum/eclipse-sourceBuild-srcFetch-${buildId}.zip.md5"/>

		<!--  create zip with all source for an Eclipse SDK  -->
		<copy todir="${tempDir}/buildScripts">
			<fileset dir="${buildDirectory}" includes="features/,plugins/" excludes="features/*example*/**,plugins/*example*/**" />
		</copy>
		<copy todir="${tempDir}/buildScripts" flatten="true" overwrite="true">
			<fileset dir="${eclipse.build.configs}/sdk/srcBuild" excludes="fetch/**,incl,jdtcoresrc/**" />
		</copy>

		<!-- fetch scripts are not required when source already included in zip file -->
		<delete>
			<fileset dir="${tempDir}/buildScripts" includes="fetch*.xml" />
			<!-- delete some jars that are not needed to build Eclipse -->
			<fileset file="${tempDir}/buildScripts/plugins/org.eclipse.osgi/osgi/collx.jar" />
			<fileset file="${tempDir}/buildScripts/plugins/org.eclipse.osgi/osgi/ee.foundation.jar" />
			<fileset file="${tempDir}/buildScripts/plugins/org.eclipse.osgi/osgi/ee.minimum.jar" />
			<fileset file="${tempDir}/buildScripts/plugins/org.eclipse.osgi/osgi/exceptions.jar" />
			<fileset file="${tempDir}/buildScripts/plugins/org.eclipse.osgi/osgi/xmlParserAPIs.jar" />
			<fileset file="${tempDir}/buildScripts/plugins/org.eclipse.osgi/osgi/osgi-r3-jdk131-notsigned.jar" />
		</delete>

		<!--  set correct permissions on linux script -->
		<chmod file="${tempDir}/buildScripts/build" perm="755" />
		<exec dir="${tempDir}/buildScripts" executable="zip">
			<arg line="-q ${postingDirectory}/${buildLabel}/eclipse-sourceBuild-srcIncluded-${buildId}.zip -r ." />
		</exec>
		<checksum file="${postingDirectory}/${buildLabel}/eclipse-sourceBuild-srcIncluded-${buildId}.zip" property="md5.2"/>
		<echo message="${md5.2} *eclipse-sourceBuild-srcIncluded-${buildId}.zip" file="${postingDirectory}/${buildLabel}/checksum/eclipse-sourceBuild-srcIncluded-${buildId}.zip.md5"/>

		<copy file="${eclipse.build.configs}/sdk/srcBuild/incl/instructions.html" tofile="${postingDirectory}/${buildLabel}/srcIncludedBuildInstructions.html" />
		<copy file="${eclipse.build.configs}/sdk/srcBuild/fetch/instructions.html" tofile="${postingDirectory}/${buildLabel}/srcFetchBuildInstructions.html" />

		<delete dir="${tempDir}/" />
	</target>