Build SWT libraries

If you need to build SWT binaries, e.g. for Solaris, which are not shipped with SmartGit, please follow these steps.

  • clone http://git.eclipse.org/gitroot/platform/eclipse.platform.swt.binaries.git into /<path>/eclipse.platform.swt.binaries (replace /<path> with your directory name)
  • clone http://git.eclipse.org/gitroot/platform/eclipse.platform.swt.git into /<path>/eclipse.platform.swt
  • create a file /<path>/build.properties with the following content:
    eclipse.platform.swt.binaries=eclipse.platform.swt.binaries
  • create a file /<path>/build.xml with the following content:
    <project name="SWT" default="buildSWTFromSources" basedir=".">
    
      <property file="build.properties"/>
    
      <macrodef name="build">
        <attribute name="bundleName"/>
    
        <sequential>
          <delete dir="${eclipse.platform.swt.binaries}/bundles/@{bundleName}/@dot"/>
          <delete dir="${eclipse.platform.swt.binaries}/bundles/@{bundleName}/temp.folder"/>
          <delete file="${eclipse.platform.swt.binaries}/bundles/@{bundleName}/swt.jar"/>
    
          <ant dir="${eclipse.platform.swt.binaries}/bundles/@{bundleName}"/>
          <property file="${eclipse.platform.swt.binaries}/bundles/@{bundleName}/build.properties" prefix="@{bundleName}."/>
          <echo message="bundling ${@{bundleName}.bin.includes}"/>
          <jar jarfile="@{bundleName}.jar" compress="false">
            <zipfileset src="${eclipse.platform.swt.binaries}/bundles/@{bundleName}/swt.jar"/>
            <fileset dir="${eclipse.platform.swt.binaries}/bundles/@{bundleName}" includes="${@{bundleName}.bin.includes}"/>
          </jar>
    
          <delete dir="${eclipse.platform.swt.binaries}/bundles/@{bundleName}/@dot"/>
          <delete dir="${eclipse.platform.swt.binaries}/bundles/@{bundleName}/temp.folder"/>
          <delete file="${eclipse.platform.swt.binaries}/bundles/@{bundleName}/swt.jar"/>
        </sequential>
      </macrodef>
    
      <target name="buildSWTFromSources">
        <build bundleName="org.eclipse.swt.gtk.solaris.x86_64"/>
      </target>
    </project>
  • invoke ANT in /<path>