Permalink
Browse files

Merge pull request #17 from skyluc/ecosystem-build

Updates pom.xml and new ecosystem build
  • Loading branch information...
2 parents 1a5782b + 283bf1e commit 3a8068f3de9bb4cfb1bc627fb6712ea25f14e127 @kaptoxic committed Oct 14, 2013
Showing with 82 additions and 459 deletions.
  1. +73 −45 ch.epfl.insynth.build/ecosystem-build.sh
  2. +9 −414 ch.epfl.insynth.build/pom.xml
@@ -1,65 +1,93 @@
#!/bin/bash -e
-# url names for each flavor defined below
-URL_NAMES=(
-"dev-indigo-2_9"
-"dev-indigo-2_10"
-"dev-juno-2_9"
-"dev-juno-2_10"
-"stable-indigo-2_9"
-"stable-indigo-2_10"
-"stable-juno-2_9"
-"stable-juno-2_10"
-)
-
-# combinations of flavors to build
-FLAVORS=(
-"-Pindigo -Pdev-scala-ide-indigo-scala-2.9 -P2.9.x"
-"-Pindigo -Pdev-scala-ide-indigo-scala-2.10 -P2.10.x"
-"-Pjuno -Pdev-scala-ide-juno-scala-2.9 -P2.9.x"
-"-Pjuno -Pdev-scala-ide-juno-scala-2.10 -P2.10.x"
-"-Pindigo -Pstable-scala-ide-indigo-scala-2.9 -P2.9.x"
-"-Pindigo -Pstable-scala-ide-indigo-scala-2.10 -P2.10.x"
-"-Pjuno -Pstable-scala-ide-juno-scala-2.9 -P2.9.x"
-"-Pjuno -Pstable-scala-ide-juno-scala-2.10 -P2.10.x"
-)
+if [ -n "${DEBUG}" ]
+then
+ set -x
+fi
+
+# takes has parameters eclipse update site URLs, like:
+# http://download.scala-ide.org/sdk/e37/scala29/stable/site/
+# http://download.scala-ide.org/sdk/next/e38/scala210/dev/site/
+#
+# It extract the profile information from the URL, build the plugins,
+# and merge the update sites.
# root dir (containing this script)
-#ROOT_DIR=$(dirname $0)
+ROOT_DIR=$(dirname $0)
+cd ${ROOT_DIR}
ROOT_DIR=${PWD}
-TARGET_DIR=/localhome/kuraj/temp/insynth-maven-build
+TARGET_DIR=${ROOT_DIR}/ecosystem
mkdir -p ${TARGET_DIR}
-for ((i=0; i < ${#FLAVORS[@]}; i++))
+############################
+## Installing merge tool
+############################
+MERGE_TOOL_REPO_DIR=${TARGET_DIR}/merge-tool
+MERGE_TOOL_DIR=${MERGE_TOOL_REPO_DIR}/maven-tool/merge-site
+if [ ! -d "${MERGE_TOOL_REPO_DIR}" ]
+then
+ git clone -o origin git://github.com/scala-ide/build-tools "${MERGE_TOOL_REPO_DIR}"
+fi
+
+cd "${MERGE_TOOL_REPO_DIR}"
+git fetch origin
+git checkout master
+git reset --hard
+git merge --ff-only origin/master
+
+
+############################
+## Real script
+############################
+
+COMBINED_SITE_DIR=${TARGET_DIR}/site
+mkdir -p ${COMBINED_SITE_DIR}
+
+for ECOSYSTEM_SITE in "$@"
do
-FLAVOR=${FLAVORS[$i]}
+ cd ${ROOT_DIR}
-COMB=${URL_NAMES[$i]}
-echo "Building InSynth with $FLAVOR into ${TARGET_DIR}/${COMB}"
+ echo ${ECOSYSTEM_SITE}
+ ECLIPSE_VERSION=${ECOSYSTEM_SITE#*/sdk*/e}
+ ECLIPSE_VERSION=${ECLIPSE_VERSION%%/*}
-mvn -Pset-versions $FLAVOR -Dtycho.style=maven --non-recursive exec:java
+ SCALA_VERSION=${ECOSYSTEM_SITE#*/sdk*/e*/scala}
+ SCALA_VERSION=${SCALA_VERSION%%/*}
-mvn -Pset-versions $FLAVOR -Dversion.tag=v clean package
+ case ${ECLIPSE_VERSION} in
+ 37 )
+ ECLIPSE_PROFILE="-Peclipse-indigo"
+ ;;
+ 38 )
+ ECLIPSE_PROFILE="-Peclipse-juno"
+ ;;
+ esac
-RETVAL=$?
-[ $RETVAL -ne 0 ] && echo "Maven build for $FLAVOR failed! Press enter to continue..." && read line
+ case ${SCALA_VERSION} in
+ 29 )
+ SCALA_PROFILE="-Pscala-2.9.x"
+ ;;
+ 210 )
+ SCALA_PROFILE="-Pscala-2.10.x"
+ ;;
+ 211 )
+ SCALA_PROFILE="-Pscala-2.11.x"
+ ;;
+ esac
-rm -rf ${TARGET_DIR}/$COMB
+ echo "Building InSynth with '${ECLIPSE_PROFILE} ${SCALA_PROFILE}'"
-cp -r ${ROOT_DIR}/ch.epfl.insynth.update-site/target/site/ ${TARGET_DIR}/$COMB
+ mvn -Pset-versions "${ECLIPSE_PROFILE}" "${SCALA_PROFILE}" -Drepo.scala-ide=${ECOSYSTEM_SITE} -Dtycho.style=maven --non-recursive exec:java
-# if needed publishing to LARA update site
-if [ $# -lt 1 ];
-then
- echo "Not copying files to insynth@laraserver.epfl.ch"
-else
- echo "Copying files to insynth@laraserver.epfl.ch"
- ssh insynth@laraserver.epfl.ch "rm -rf ~/public_html/$COMB"
- scp -r ${TARGET_DIR}/$COMB insynth@laraserver.epfl.ch:~/public_html/
-fi
+ mvn "${ECLIPSE_PROFILE}" "${SCALA_PROFILE}" -Drepo.scala-ide=${ECOSYSTEM_SITE} -Dversion.tag=v clean package
+
+ echo "Copying into combined site"
+
+ cd "${MERGE_TOOL_DIR}"
+ mvn "-Drepo.source=file://${ROOT_DIR}/ch.epfl.insynth.update-site/target/site" "-Drepo.dest=${COMBINED_SITE_DIR}" package
done
-exit
+echo "All done"
Oops, something went wrong.

0 comments on commit 3a8068f

Please sign in to comment.