Skip to content
This repository
Browse code

Added plugin signing script.

  • Loading branch information...
commit eceaab014f2af883e3721bc8f7e73e72c4d4a229 1 parent 1d1d4a7
Iulian Dragos authored September 17, 2012
65  org.scalaide.worksheet.update-site/plugin-signing.sh
... ...
@@ -0,0 +1,65 @@
  1
+#!/bin/bash
  2
+
  3
+ECLIPSE=/Applications/dev/eclipse-helios/Eclipse.app/Contents/MacOS/eclipse
  4
+
  5
+THIS=$(pwd)
  6
+TARGET_DIR=$THIS/target
  7
+BUNDLE_DIR=$TARGET_DIR/site
  8
+
  9
+EXPECTED_ARGS=4
  10
+E_BADARGS=65
  11
+
  12
+if [[ ! -f ${ECLIPSE} ]]; then
  13
+	echo "Please update ECLIPSE (${ECLIPSE}) to point to an existing Eclipse installation."
  14
+	echo "Aborting.."
  15
+	exit 1
  16
+fi
  17
+
  18
+if [ $# -ne $EXPECTED_ARGS ]
  19
+then
  20
+  echo "Usage: ./plugin-signing <path to keystore> <alias> <store password> <key password>"
  21
+  exit $E_BADARGS
  22
+fi
  23
+
  24
+PATH_KEYSTORE=$1
  25
+ALIAS=$2
  26
+STORE_PWD=$3
  27
+KEY_PWD=$4
  28
+
  29
+signJars()
  30
+{
  31
+  # $1 is the folder containing the JARs to be signed
  32
+  JAR_FOLDER=$1
  33
+  
  34
+  for i in ${JAR_FOLDER}/*.jar
  35
+
  36
+  do
  37
+
  38
+  jarsigner -keystore $PATH_KEYSTORE -storepass $STORE_PWD -verbose -keypass $KEY_PWD $i $ALIAS
  39
+
  40
+  done
  41
+}
  42
+
  43
+# These files will be recreated after the plug-in JARs are signed.
  44
+rm -rf ${BUNDLE_DIR}/artifacts.jar
  45
+rm -rf ${BUNDLE_DIR}/content.jar
  46
+rm -rf ${TARGET_DIR}/site_assembly.zip
  47
+rm -rf ${TARGET_DIR}/site.zip
  48
+
  49
+FEATURES_DIR=$BUNDLE_DIR/features
  50
+PLUGINS_DIR=$BUNDLE_DIR/plugins
  51
+
  52
+# Sign both the features and plugins JARs
  53
+signJars ${FEATURES_DIR}
  54
+signJars ${PLUGINS_DIR}
  55
+
  56
+# This will re-create both 'artifacts.jar' and 'content.jar'
  57
+$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
  58
+
  59
+# This will make sure that the above produced plug-in is visible on p2 repository
  60
+$ECLIPSE -debug -consolelog -nosplash -verbose -application org.eclipse.equinox.p2.publisher.CategoryPublisher -metadataRepository file:${BUNDLE_DIR} -categoryDefinition file:${BUNDLE_DIR}/site.xml 
  61
+
  62
+# Re-create the  site_assembly.zip
  63
+pushd target/
  64
+zip -r site_assembly.zip site/
  65
+popd

0 notes on commit eceaab0

Please sign in to comment.
Something went wrong with that request. Please try again.