From 283845b18c97cfbae75e39ae89fbaed2e1ee0a91 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Tue, 24 May 2016 19:29:09 +0200 Subject: update scripts --- packages/scripts/resources/lib/activate.inc.sh | 14 +++++ packages/scripts/resources/lib/environments.inc.sh | 70 ++++++++-------------- 2 files changed, 38 insertions(+), 46 deletions(-) (limited to 'packages/scripts/resources') diff --git a/packages/scripts/resources/lib/activate.inc.sh b/packages/scripts/resources/lib/activate.inc.sh index 79bed6b..b77b9fd 100644 --- a/packages/scripts/resources/lib/activate.inc.sh +++ b/packages/scripts/resources/lib/activate.inc.sh @@ -1,3 +1,17 @@ +# use to process /opt/activator entries +__activator() { + for product in $*; do + if [ -d "/opt/activator/$product/env" ]; then + for env in /opt/activator/$product/env/*; do + name=$(basename "$env") + eval "export '$name'='$(cat $env)'" + done + fi + if [ -d "/opt/activator/$product/bin" ]; then + export PATH="/opt/activator/$product/bin":$PATH + fi + done +} # non-interactive activate __activate_env() { diff --git a/packages/scripts/resources/lib/environments.inc.sh b/packages/scripts/resources/lib/environments.inc.sh index 8960d95..d615b47 100644 --- a/packages/scripts/resources/lib/environments.inc.sh +++ b/packages/scripts/resources/lib/environments.inc.sh @@ -1,46 +1,24 @@ - -function __sub_java7() { - export JAVA_HOME=/usr/lib/jvm/java-7-oraclejdk - export PATH=$JAVA_HOME/bin:$PATH -} - -function __sub_java8() { - export JAVA_HOME=/usr/lib/jvm/java-8-oraclejdk - export PATH=$JAVA_HOME/bin:$PATH -} - -function __sub_tools() { - export PATH=/opt/idea-iu15/bin:$PATH - export PATH=/opt/gwt-chromium/bin:$PATH - - export PATH=/opt/grails3/bin:$PATH - - export PATH=/opt/cern-scripts/bin:$PATH - - export TNS_ADMIN=/home/yfischer/.cache/tnsnames/admin_localhost - export JAVA_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN" - export GRADLE_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN" -} - -function __env_ideajava8() { - __sub_java8 - __sub_tools -} - -function __env_ideajava7() { - __sub_java7 - __sub_tools -} - -function __env_fwk24() { - __sub_java7 - - export PATH=/opt/idea-iu15/bin:$PATH - export PATH=/opt/gwt-chromium/bin:$PATH - export PATH=/opt/grails2.2.1/bin:$PATH - export PATH=/opt/cern-scripts/bin:$PATH - - export TNS_ADMIN=/home/yfischer/.cache/tnsnames/admin_localhost - export JAVA_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN" - export GRADLE_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN" -} +# Examples: +# +# function __env_ideajava8() { +# __activator oraclejdk8 idea-iu2016 groovy-bin-2.4.5 +# __activator gwt-chromium cern-scripts +# +# export TNS_ADMIN=/home/yfischer/.cache/tnsnames/admin_localhost +# export JAVA_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN" +# export GRADLE_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN" +# } +# +# function __env_fwk24() { +# __activator oraclejdk7 +# __activator gwt-chromium +# __activator idea-iu2016 +# __activator cern-scripts +# +# +# export PATH=/opt/grails2.2.1/bin:$PATH +# +# export TNS_ADMIN=/home/yfischer/.cache/tnsnames/admin_localhost +# export JAVA_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN" +# export GRADLE_OPTS="-Doracle.net.tns_admin=$TNS_ADMIN" +# } -- cgit v1.2.1