Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 59 lines (43 sloc) 1.666 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
#!/bin/bash

ECLIPSE=/Applications/dev/eclipse-helios/Eclipse.app/Contents/MacOS/eclipse

THIS=$(pwd)
TARGET_DIR=$THIS/target
BUNDLE_DIR=$TARGET_DIR/site

EXPECTED_ARGS=4
E_BADARGS=65

if [ $# -ne $EXPECTED_ARGS ]
then
  echo "Usage: ./plugin-signing <path to keystore> <alias> <store password> <key password>"
  exit $E_BADARGS
fi

PATH_KEYSTORE=$1
ALIAS=$2
STORE_PWD=$3
KEY_PWD=$4

signJars()
{
  # $1 is the folder containing the JARs to be signed
  JAR_FOLDER=$1
  
  for i in ${JAR_FOLDER}/*.jar

  do

  jarsigner -keystore $PATH_KEYSTORE -storepass $STORE_PWD -verbose -keypass $KEY_PWD $i $ALIAS

  done
}

# These files will be recreated after the plug-in JARs are signed.
rm -rf ${BUNDLE_DIR}/artifacts.jar
rm -rf ${BUNDLE_DIR}/content.jar
rm -rf ${TARGET_DIR}/site_assembly.zip
rm -rf ${TARGET_DIR}/site.zip

FEATURES_DIR=$BUNDLE_DIR/features
PLUGINS_DIR=$BUNDLE_DIR/plugins

# Sign both the features and plugins JARs
signJars ${FEATURES_DIR}
signJars ${PLUGINS_DIR}

# This will re-create both 'artifacts.jar' and 'content.jar'
$ECLIPSE -debug -consolelog -nosplash -verbose -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher -metadataRepository file:${BUNDLE_DIR} -artifactRepository file:${BUNDLE_DIR} -source ${BUNDLE_DIR} -compress -append -publishArtifacts

# This will make sure that the above produced plug-in is visible on p2 repository
$ECLIPSE -debug -consolelog -nosplash -verbose -application org.eclipse.equinox.p2.publisher.CategoryPublisher -metadataRepository file:${BUNDLE_DIR} -categoryDefinition file:${BUNDLE_DIR}/site.xml

# Re-create the site_assembly.zip
pushd target/
zip -r site_assembly.zip site/
popd
Something went wrong with that request. Please try again.