Skip to content

Instantly share code, notes, and snippets.

@ilaborie
Created October 3, 2014 08:47
Show Gist options
  • Save ilaborie/34d8cb97470f0d4cc502 to your computer and use it in GitHub Desktop.
Save ilaborie/34d8cb97470f0d4cc502 to your computer and use it in GitHub Desktop.
Build Eclipse Target
#!/bin/bash
DIST="dist"
rm -rf $DIST/*
mkdir $DIST
function download {
echo "download $2 --> $1"
if [ ! -f "$1" ]; then
curl --progress -L -o $1 $2
else
echo "SKIP DOWNLOAD $2, $1 already exists"
fi
}
function fixUpdateSite {
if [ ! -f "$1/content.xml" ]; then
eclipse -noSplash -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher -metadataRepository file:$PWD/$1 -artifactRepository file:$PWD/$1 -source $PWD/$1 -configs ANY -publishArtifacts
fi
}
function downloadUnzipRename {
if [ ! -d "$1" ]; then
FILE="$1.zip"
download $FILE $2
unzip $FILE
mv eclipse $1
rm $FILE
else
echo "SKIP $1 already exists"
fi
cp -r $1/* $DIST
}
function downloadUnzip {
if [ ! -d "$1" ]; then
FILE="$1.zip"
download $FILE $2
unzip $FILE -d $1
rm $FILE
else
echo "SKIP $1 already exists"
fi
cp -r $1/* $DIST
}
### Eclipse ###
# Luna
LUNA_URL="https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.4.1-201409250400/$LUNA_FILE&r=1"
LUNA_OUT="eclipse-SDK-4.4.1-win32-x86_64"
downloadUnzipRename $LUNA_OUT $LUNA_URL
# Delta Pack
DELTAPACK_URL="https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.4.1-201409250400/$DELTAPACK_FILE&r=1"
DELTAPACK_OUT="eclipse-4.4.1-delta-pack"
downloadUnzipRename $DELTAPACK_OUT $DELTAPACK_URL
# Nebula
NEBULA_FILE="nebula-repository.zip"
NEBULA_URL="http://download.eclipse.org/technology/nebula/snapshot/repository.zip"
NEBULA_OUT="eclipse-nebula"
downloadUnzip $NEBULA_OUT $NEBULA_FILE $NEBULA_URL
# GEF
GEF_URL="https://www.eclipse.org/downloads/download.php?file=/tools/gef/downloads/drops/3.9.101/R201408150207/GEF-Update-3.9.101.zip&r=1"
GEF_OUT="gef-3.9.101"
downloadUnzip $GEF_OUT $GEF_URL
# Update Site
rm $DIST/content.*
rm $DIST/artifacts.*
fixUpdateSite $DIST
# Generate plop.target
echo "Generate plop.target"
rm plop.target
echo '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="plop" sequenceNumber="6">
<locations>
<location path="${workspace_loc:target-platforms}/'$LUNA_OUT'" type="Profile"/>
<location path="${workspace_loc:target-platforms}/'$DELTAPACK_OUT'" type="Directory"/>
<location path="${workspace_loc:target-platforms}/'$NEBULA_OUT'" type="Directory"/>
<location path="${workspace_loc:target-platforms}/'$GEF_OUT'" type="Directory"/>
</locations>
</target>' > plop.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment