Krzysztof Daniel c0f90a9
### Eclipse Workspace Patch 1.0
Krzysztof Daniel c0f90a9
#P org.eclipse.pde.build
Krzysztof Daniel c0f90a9
--- /dev/null
Krzysztof Daniel c0f90a9
+++ eclipse.pde.build/org.eclipse.pde.build/templates/package-build/prepare-build-dir.sh
Krzysztof Daniel c0f90a9
@@ -0,0 +1,105 @@
Krzysztof Daniel c0f90a9
+#!/bin/sh
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+if [ $# -lt 2 ]; then
Krzysztof Daniel c0f90a9
+  echo "usage: $0 <path to source dir> <path to build dir>"
Krzysztof Daniel c0f90a9
+  exit 1
Krzysztof Daniel c0f90a9
+fi
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+if [ ! -d $1 ]; then
Krzysztof Daniel c0f90a9
+  echo "usage: $0 <path to source dir> <path to build dir>"
Krzysztof Daniel c0f90a9
+  exit 1
Krzysztof Daniel c0f90a9
+fi
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+SOURCEDIR=$1
Krzysztof Daniel c0f90a9
+BUILDDIR=$2
Krzysztof Daniel c0f90a9
+TESTING=$3
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+echo "preparing files in $1 for buildfile generation ..."
Krzysztof Daniel c0f90a9
+mkdir -p $BUILDDIR
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+# make some ant build files to extract the id from the feature.xml, plugin.xml or the fragment.xml
Krzysztof Daniel c0f90a9
+mkdir -p $BUILDDIR/tmp
Krzysztof Daniel c0f90a9
+BUILDFILE=$BUILDDIR/tmp/build.xml
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+echo "<project default=\"main\">
Krzysztof Daniel c0f90a9
+   <target name=\"main\">
Krzysztof Daniel c0f90a9
+                   <xmlproperty file=\"@type@.xml\" collapseAttributes=\"true\"/>
Krzysztof Daniel c0f90a9
+       <fail unless=\"@type@.id\" message=\"feature.id not set\"/>
Krzysztof Daniel c0f90a9
+                   <echo message=\"\${@type@.id}\" />
Krzysztof Daniel c0f90a9
+        </target>
Krzysztof Daniel c0f90a9
+</project>" > $BUILDFILE
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+for type in feature plugin fragment; do
Krzysztof Daniel c0f90a9
+  CURBUILDFILE=$BUILDDIR/tmp/$type-build.xml
Krzysztof Daniel c0f90a9
+  cat $BUILDFILE | sed "s|@type@|$type|" > $CURBUILDFILE
Krzysztof Daniel c0f90a9
+done
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+# make the directories eclipse is expecting
Krzysztof Daniel c0f90a9
+echo "  making the 'features' and 'plugins' directories"
Krzysztof Daniel c0f90a9
+mkdir -p $BUILDDIR/features $BUILDDIR/plugins
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+# make symlinks for the features
Krzysztof Daniel c0f90a9
+FEATURES=$(find $SOURCEDIR -name feature.xml)
Krzysztof Daniel c0f90a9
+find $SOURCEDIR -name feature.xml | while read f; do
Krzysztof Daniel c0f90a9
+  PROJECTDIR=$(dirname "$f")
Krzysztof Daniel c0f90a9
+  inSDK=1
Krzysztof Daniel c0f90a9
+  inSDK=$(echo $PROJECTDIR | grep -c $BUILDDIR)
Krzysztof Daniel c0f90a9
+  if [ $inSDK = 0 ]; then
Krzysztof Daniel c0f90a9
+    PROJECTNAME=$(ant -Dbasedir="$PROJECTDIR" -f $BUILDDIR/tmp/feature-build.xml 2>&1 | grep echo | cut --delimiter=' ' -f 7)
Krzysztof Daniel c0f90a9
+    ERROR=""
Krzysztof Daniel c0f90a9
+    if [ -z "$PROJECTNAME" ]; then
Krzysztof Daniel c0f90a9
+      echo "ERROR: could not determine the feature id for $PROJECTDIR"
Krzysztof Daniel c0f90a9
+      if [ $TESTING != true ]; then
Krzysztof Daniel c0f90a9
+        exit 1
Krzysztof Daniel c0f90a9
+      else
Krzysztof Daniel c0f90a9
+        ERROR="yes"
Krzysztof Daniel c0f90a9
+      fi
Krzysztof Daniel c0f90a9
+    fi
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+    if [ "x$ERROR" != "xyes" ]; then
Krzysztof Daniel c0f90a9
+      if [ $TESTING != true ] || `echo "$PROJECTNAME" | grep "org.eclipse"`; then
Krzysztof Daniel c0f90a9
+        echo "  making symlink: $BUILDDIR/features/$PROJECTNAME -> $PROJECTDIR"
Krzysztof Daniel c0f90a9
+        ln -sfT "$PROJECTDIR" $BUILDDIR/features/"$PROJECTNAME"
Krzysztof Daniel c0f90a9
+      fi
Krzysztof Daniel c0f90a9
+    fi
Krzysztof Daniel c0f90a9
+  fi
Krzysztof Daniel c0f90a9
+done
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+# make symlinks for plugins and fragments
Krzysztof Daniel c0f90a9
+PLUGINDIRS=$(find $SOURCEDIR -name plugin.xml -o -name fragment.xml -o -name MANIFEST.MF | sed "s/plugin.xml//g" | sed "s/fragment.xml//g" | sed "s/META-INF\/MANIFEST.MF//" | sort | uniq)
Krzysztof Daniel c0f90a9
+find $SOURCEDIR -name plugin.xml -o -name fragment.xml -o -name MANIFEST.MF | sed "s/plugin.xml//g" | sed "s/fragment.xml//g" | sed "s/META-INF\/MANIFEST.MF//" | sort | uniq | while read dir; do
Krzysztof Daniel c0f90a9
+  PROJECTNAME=""
Krzysztof Daniel c0f90a9
+  ERROR=""
Krzysztof Daniel c0f90a9
+  inSDK=1
Krzysztof Daniel c0f90a9
+  inSDK=$(echo $dir | grep -c $BUILDDIR)
Krzysztof Daniel c0f90a9
+  if [ $inSDK = 0 ]; then
Krzysztof Daniel c0f90a9
+    if [ -e "$dir/META-INF/MANIFEST.MF" ]; then
Krzysztof Daniel c0f90a9
+      PROJECTNAME=$(grep Bundle-SymbolicName $dir/META-INF/MANIFEST.MF | cut --delimiter=';' -f 1 | cut --delimiter=' ' -f 2)
Krzysztof Daniel c0f90a9
+    elif [ -e "$dir/plugin.xml" ]; then
Krzysztof Daniel c0f90a9
+      PROJECTNAME=$(ant -Dbasedir=$dir -f $BUILDDIR/tmp/plugin-build.xml 2>&1 | grep echo | cut --delimiter=' ' -f 7)
Krzysztof Daniel c0f90a9
+    elif [ -e "$dir/fragment.xml" ]; then
Krzysztof Daniel c0f90a9
+      PROJECTNAME=$(ant -Dbasedir=$dir -f $BUILDDIR/tmp/fragment-build.xml 2>&1 | grep echo | cut --delimiter=' ' -f 7)
Krzysztof Daniel c0f90a9
+    fi
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+    if [ -z "$PROJECTNAME"  ]; then
Krzysztof Daniel c0f90a9
+      echo "ERROR: could not determine the plugin or fragment id for $dir"
Krzysztof Daniel c0f90a9
+      if [ $TESTING != true ]; then
Krzysztof Daniel c0f90a9
+        exit 1
Krzysztof Daniel c0f90a9
+      else
Krzysztof Daniel c0f90a9
+        ERROR="yes"
Krzysztof Daniel c0f90a9
+      fi
Krzysztof Daniel c0f90a9
+    fi
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+    if [ "x$ERROR" != "xyes" ]; then
Krzysztof Daniel c0f90a9
+      if [ $TESTING != true ] || `echo "$PROJECTNAME" | grep "org.eclipse"`; then
Krzysztof Daniel c0f90a9
+        echo "  making symlink: $BUILDDIR/plugins/$PROJECTNAME -> $dir"
Krzysztof Daniel c0f90a9
+        ln -sfT "$dir" $BUILDDIR/plugins/"$PROJECTNAME"
Krzysztof Daniel c0f90a9
+      fi
Krzysztof Daniel c0f90a9
+    fi;
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+  fi
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+done
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+rm -rf $BUILDDIR/tmp
Krzysztof Daniel c0f90a9
+echo done
Krzysztof Daniel c0f90a9
--- /dev/null
Krzysztof Daniel c0f90a9
+++ eclipse.pde.build/org.eclipse.pde.build/templates/package-build/customTargets-assemble-target.xml
Krzysztof Daniel c0f90a9
@@ -0,0 +1,15 @@
Krzysztof Daniel c0f90a9
+<project>
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   <target name="assemble.@id@">
Krzysztof Daniel c0f90a9
+       <ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+   <target name="assemble.@id@.@configs@">
Krzysztof Daniel c0f90a9
+       <ant antfile="${assembleScriptName}" dir="${buildDirectory}" />
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+</project>
Krzysztof Daniel c0f90a9
--- /dev/null
Krzysztof Daniel c0f90a9
+++ eclipse.pde.build/org.eclipse.pde.build/templates/package-build/customTargets.xml
Krzysztof Daniel c0f90a9
@@ -0,0 +1,154 @@
Krzysztof Daniel c0f90a9
+<project name="Build specific targets and properties" default="noDefault">
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   <fail unless="type" message="Please set the ${type} property to 'feature', 'plugin' or 'fragment'." />
Krzysztof Daniel c0f90a9
+   <fail unless="id" message="Please set the ${id} property to the feature, plugin or fragment id of the plugin you are building." />
Krzysztof Daniel c0f90a9
+   <fail unless="sourceDirectory" message="Please set the ${sourceDirectory} property to the directory that has the source plugins." />
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <copy file="${builder}/customTargets-assemble-target.xml" tofile="${buildDirectory}/customTargets-${id}-assemble-target.xml" />
Krzysztof Daniel c0f90a9
+   <replace file="${buildDirectory}/customTargets-${id}-assemble-target.xml" token="@id@" value="${id}" />
Krzysztof Daniel c0f90a9
+   <replace file="${buildDirectory}/customTargets-${id}-assemble-target.xml" token="@configs@" value="${configs}" />
Krzysztof Daniel c0f90a9
+   <replace file="${buildDirectory}/customTargets-${id}-assemble-target.xml" token="," value="." />
Krzysztof Daniel c0f90a9
+   <import file="${buildDirectory}/customTargets-${id}-assemble-target.xml" />
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="allElements">
Krzysztof Daniel c0f90a9
+       <ant antfile="${genericTargets}" target="${target}">
Krzysztof Daniel c0f90a9
+           <property name="type" value="${type}" />
Krzysztof Daniel c0f90a9
+           <property name="id" value="${id}" />
Krzysztof Daniel c0f90a9
+       </ant>
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="getMapFiles">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   <target name="clean" unless="noclean">
Krzysztof Daniel c0f90a9
+       <antcall target="allElements">
Krzysztof Daniel c0f90a9
+           <param name="target" value="cleanElement" />
Krzysztof Daniel c0f90a9
+       </antcall>
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="preSetup">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="postSetup">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="preFetch">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="postFetch">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="preGenerate">
Krzysztof Daniel c0f90a9
+       
Krzysztof Daniel c0f90a9
+           plugin projects to be in the 'plugins' directory. The build infrastructure
Krzysztof Daniel c0f90a9
+       normally arranges the projects during the fetch stage. Since we aren't doing
Krzysztof Daniel c0f90a9
+       the fetch stage, we have to manually arrange the files -->
Krzysztof Daniel c0f90a9
+       <exec dir="${builder}" executable="/bin/bash" failOnError="true">
Krzysztof Daniel c0f90a9
+           <arg line="prepare-build-dir.sh ${sourceDirectory} ${buildDirectory} ${testing}" />
Krzysztof Daniel c0f90a9
+       </exec>
Krzysztof Daniel c0f90a9
+       <antcall target="symlinkDeps" />
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   <target name="symlinkDeps" if="orbitDepsDir">
Krzysztof Daniel c0f90a9
+       <apply executable="ln" parallel="false" dir="${buildDirectory}/plugins" verbose="true">
Krzysztof Daniel c0f90a9
+           <arg line="-s" />
Krzysztof Daniel c0f90a9
+           <srcfile />
Krzysztof Daniel c0f90a9
+           <fileset dir="${orbitDepsDir}" includes="*.jar" />
Krzysztof Daniel c0f90a9
+       </apply>
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="postGenerate">
Krzysztof Daniel c0f90a9
+       <antcall target="clean" />
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="preProcess">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="postProcess">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="preAssemble">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="postAssemble">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="prePackage">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="postPackage">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="postBuild">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="test">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="publish">
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   
Krzysztof Daniel c0f90a9
+   <target name="noDefault">
Krzysztof Daniel c0f90a9
+       <echo message="You must specify a target when invoking this file" />
Krzysztof Daniel c0f90a9
+   </target>
Krzysztof Daniel c0f90a9
+
Krzysztof Daniel c0f90a9
+</project>
Krzysztof Daniel c0f90a9
--- /dev/null
Krzysztof Daniel c0f90a9
+++ eclipse.pde.build/org.eclipse.pde.build/templates/package-build/build.properties
Krzysztof Daniel c0f90a9
@@ -0,0 +1,12 @@
Krzysztof Daniel c0f90a9
+buildDirectory=${sourceDirectory}/build
Krzysztof Daniel c0f90a9
+buildLabel=rpmBuild
Krzysztof Daniel c0f90a9
+archivePrefix=eclipse
Krzysztof Daniel c0f90a9
+skipFetch=true
Krzysztof Daniel c0f90a9
+javacFailOnError=true
Krzysztof Daniel c0f90a9
+collectingFolder=eclipse
Krzysztof Daniel c0f90a9
+archivesFormat=*,*,*-zip
Krzysztof Daniel c0f90a9
+zipargs=-y
Krzysztof Daniel c0f90a9
+javacDebugInfo=true
Krzysztof Daniel c0f90a9
+archiveName=${id}.zip
Krzysztof Daniel c0f90a9
+runPackager=false
Krzysztof Daniel b468f97
+baseLocation=@DATADIR@/eclipse