Blob Blame History Raw
#!/bin/sh -x

CDTTAG=CDT_8_0_1
#ECLIPSEBASE=$(rpm --eval %{_libdir})/eclipse

if test x`uname -i` = 'xi386'; then export plat=""; else export plat=-`uname -i`; fi

#eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/technology/subversive/0.7/pde-update-site/ -installIU org.eclipse.team.svn.pde.build.feature.group

TOPDIR=$(pwd)

mkdir -p temp && cd temp
TEMPDIR=$(pwd)
mkdir -p home
mkdir -p ws
# we need to use a special svn pde extension to fetch some parts for the cdt build so we unzip a fresh 3.6 SDK and add the
# special plug-in via the p2 director
if true; then
rm -rf sdk
mkdir -p sdk
pushd sdk
wget http://download.eclipse.org/eclipse/downloads/drops/R-3.7.1-201109091335/eclipse-SDK-3.7.1-linux-gtk${plat}.tar.gz
cp ../../eclipse-SDK-3.7.1-linux-gtk${plat}.tar.gz .
tar -xzvf eclipse-SDK-3.7.1-linux-gtk${plat}.tar.gz
ECLIPSEBASE=$TEMPDIR/sdk/eclipse
# pushd eclipse
# ./eclipse -nosplash -consolelog -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/technology/subversive/0.7/pde-update-site/ -installIU org.eclipse.team.svn.pde.build.feature.group
# popd
pushd eclipse/plugins
wget http://download.eclipse.org/technology/subversive/0.7/pde-update-site/plugins/org.eclipse.team.svn.pde.build_0.7.9.I20110419-1700.jar
wget http://download.eclipse.org/egit/pde/updates-nightly/plugins/org.eclipse.egit.fetchfactory_0.12.0.201108111757.jar
popd
popd
fi

ECLIPSEBASE=$TEMPDIR/sdk/eclipse

if true; then
wget http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/snapshot/org.eclipse.cdt-$CDTTAG.tar.gz
rm -rf org.eclipse.cdt-$CDTTAG
tar -xzvf org.eclipse.cdt-$CDTTAG.tar.gz

cd org.eclipse.cdt-$CDTTAG/releng/org.eclipse.cdt.releng/

# The build.xml doesn't fetch master or testing features so we must add this ourselves.
sed --in-place -e'99,99i\\t\t<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">\n\t\t\t<property name="builder" value="${basedir}/master"/>\n\t\t</ant>' build.xml
sed --in-place -e'99,99i\\t\t<ant antfile="build.xml" dir="${pde.build.scripts}" target="fetch">\n\t\t\t<property name="builder" value="${basedir}/testing"/>\n\t\t</ant>' build.xml
sed --in-place -e'61,61i\\t\t<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">\n\t\t\t<property name="builder" value="${basedir}/master"/>\n\t\t</ant>' build.xml
sed --in-place -e'61,61i\\t\t<ant antfile="build.xml" dir="${pde.build.scripts}" target="preBuild">\n\t\t\t<property name="builder" value="${basedir}/testing"/>\n\t\t</ant>' build.xml

# Remove copying of binary jar in build.xml.  We remove this jar so this operation will fail.
sed --in-place -e "/copy file=\"\${buildDirectory}.*net\.sourceforge\.lpg/,/\/>/"d build.xml 

pushd codan
# the feature id does not match what is found in the customTargets.xml which causes pdebuild to stop so make it the same
sed --in-place -e "s,value=\"org.eclipse.cdt.codan\",value=\"org.eclipse.cdt.codan.feature\",g" customTargets.xml
popd
fi


PDEBUILDVERSION=$(ls $ECLIPSEBASE/plugins | grep org.eclipse.pde.build_ | sed 's/org.eclipse.pde.build_//')
LAUNCHERJAR=$(ls $ECLIPSEBASE/plugins \
  | grep org.eclipse.equinox.launcher_)
LAUNCHER=$ECLIPSEBASE/plugins/$LAUNCHERJAR
echo $LAUNCHER
pushd org.eclipse.cdt-$CDTTAG/releng/org.eclipse.cdt.releng
cp $TOPDIR/cdt.map maps
java -jar $LAUNCHER \
     -Duser.home=$TEMPDIR/home                        \
     org.eclipse.core.launcher.Main \
  -Dpde.build.scripts=$ECLIPSEBASE/plugins/org.eclipse.pde.build_$PDEBUILDVERSION/scripts \
  -application org.eclipse.ant.core.antRunner \
  -buildfile build.xml -DbaseLocation=$ECLIPSEBASE \
  -Dpde.build.scripts=$ECLIPSEBASE/plugins/org.eclipse.pde.build_$PDEBUILDVERSION/scripts \
  -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=$TEMPDIR/dropins \
  -DcdtTag=$CDTTAG \
  -DdontUnzip=true fetch

find . -name net.*.jar -exec rm {} \;

cd .. && tar jcf eclipse-cdt-fetched-src-$CDTTAG.tar.bz2 org.eclipse.cdt.releng --exclude "*scmCache*"
popd