Repository: incubator-unomi Updated Branches: refs/heads/master 3681c0155 -> 91ec0c546
UNOMI-42 Fix version numbers in build scripts This fix simply adds a setenv.sh file that contains version numbers and resolves the project version number dynamically so that we won't have to update them when changing the project's version. Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/91ec0c54 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/91ec0c54 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/91ec0c54 Branch: refs/heads/master Commit: 91ec0c54657bf4d2ffcd625bf77b8742cbe05cd5 Parents: 3681c01 Author: Serge Huber <[email protected]> Authored: Thu Jul 14 10:24:55 2016 +0200 Committer: Serge Huber <[email protected]> Committed: Thu Jul 14 10:24:55 2016 +0200 ---------------------------------------------------------------------- buildAndRun.sh | 11 ++++++++--- compileDeploy.sh | 9 +++++++-- setenv.sh | 22 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/91ec0c54/buildAndRun.sh ---------------------------------------------------------------------- diff --git a/buildAndRun.sh b/buildAndRun.sh index 4e3295b..4037f3a 100755 --- a/buildAndRun.sh +++ b/buildAndRun.sh @@ -18,11 +18,16 @@ # ################################################################################ echo Building... -mvn clean install -P integration-tests,performance-tests +DIRNAME=`dirname "$0"` +PROGNAME=`basename "$0"` +if [ -f "$DIRNAME/setenv.sh" ]; then + . "$DIRNAME/setenv.sh" +fi +mvn clean install -P integration-tests,performance-tests,rat pushd package/target echo Uncompressing Unomi package... -tar zxvf unomi-1.0.0-incubating-SNAPSHOT.tar.gz -cd unomi-1.0.0-incubating-SNAPSHOT/bin +tar zxvf unomi-$UNOMI_VERSION.tar.gz +cd unomi-$UNOMI_VERSION/bin echo Starting Unomi... ./karaf debug popd http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/91ec0c54/compileDeploy.sh ---------------------------------------------------------------------- diff --git a/compileDeploy.sh b/compileDeploy.sh index 27ede95..f1a5110 100755 --- a/compileDeploy.sh +++ b/compileDeploy.sh @@ -18,14 +18,19 @@ # ################################################################################ echo Setting up environment... +DIRNAME=`dirname "$0"` +PROGNAME=`basename "$0"` +if [ -f "$DIRNAME/setenv.sh" ]; then + . "$DIRNAME/setenv.sh" +fi if [ "x$CONTEXT_SERVER_KARAF_HOME" = "x" ]; then - CONTEXT_SERVER_KARAF_HOME=~/java/deployments/context-server/apache-karaf-3.0.2 + CONTEXT_SERVER_KARAF_HOME=~/java/deployments/context-server/apache-karaf-$KARAF_VERSION export CONTEXT_SERVER_KARAF_HOME fi echo Compiling... mvn clean install echo Deploying KAR package to $CONTEXT_SERVER_KARAF_HOME/deploy... -cp kar/target/unomi-kar-1.0.0-SNAPSHOT.kar $CONTEXT_SERVER_KARAF_HOME/deploy/ +cp kar/target/unomi-kar-$UNOMI_VERSION.kar $CONTEXT_SERVER_KARAF_HOME/deploy/ echo Purging Karaf local Maven repository, exploded KAR directory and temporary directory... rm -rf $CONTEXT_SERVER_KARAF_HOME/data/maven/repository/* rm -rf $CONTEXT_SERVER_KARAF_HOME/data/tmp/* http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/91ec0c54/setenv.sh ---------------------------------------------------------------------- diff --git a/setenv.sh b/setenv.sh new file mode 100755 index 0000000..e2489e2 --- /dev/null +++ b/setenv.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +################################################################################ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +export UNOMI_VERSION=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|Download\w+:)'` +echo Detected project version=$UNOMI_VERSION +export KARAF_VERSION=3.0.2
