2 Star 3 Fork 2

小帅丶 / deeplearning4j

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
buildmultiplescalaversions.sh 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
#! /bin/bash
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function echoError() {
(>&2 echo "$1")
}
function sparkError() {
echoError "Changing Spark major version to 2 in the build did not change the state of your working copy, is Spark 1.x still the default ?"
exit 2
}
function scalaError() {
echoError "Changing Scala major version to 2.10 in the build did not change the state of your working copy, is Scala 2.11 still the default ?"
exit 2
}
function whatchanged() {
cd "$BASEDIR"
for i in $(git status -s --porcelain -- $(find ./ -mindepth 2 -name pom.xml)|awk '{print $2}'); do
echo "$(dirname $i)"
cd "$BASEDIR"
done
}
function beep(){ echo -e '\a';}
set -eu
./change-scala-versions.sh 2.11
./change-spark-versions.sh 1 # should be idempotent, this is the default
mvn "$@"
./change-spark-versions.sh 2
if [ -z "$(whatchanged)" ]; then
sparkError;
else
if [[ "${@#-pl}" = "$@" ]]; then
mvn -Dmaven.clean.skip=true -pl $(whatchanged| tr '\n' ',') -amd "$@"
else
# the arguments already tweak the project list ! don't tweak them more
# as this can lead to conflicts (excluding a project that's not part of
# the reactor)
mvn "$@"
fi
fi
./change-scala-versions.sh 2.10
./change-spark-versions.sh 1
if [ -z "$(whatchanged)" ]; then
scalaError;
else
if [[ "${@#-pl}" = "$@" ]]; then
mvn -Dmaven.clean.skip=true -pl $(whatchanged| tr '\n' ',') -amd "$@"
else
# the arguments already tweak the project list ! don't tweak them more
# as this can lead to conflicts (excluding a project that's not part of
# the reactor)
mvn "$@"
fi
fi
./change-scala-versions.sh 2.11 # back to the default
# notify user the build is done
beep
sleep 1; beep
sleep 1; beep
Java
1
https://gitee.com/xshuai/deeplearning4j.git
git@gitee.com:xshuai/deeplearning4j.git
xshuai
deeplearning4j
deeplearning4j
master

搜索帮助