2017-02-27 16:15:15 +01:00
|
|
|
#!/usr/bin/env bash
|
2018-09-28 17:55:42 +02:00
|
|
|
set -euvx
|
2015-06-16 20:17:07 +02:00
|
|
|
|
2022-08-12 14:48:09 +02:00
|
|
|
# Force the use of coursier JNI stuff on Windows, which ought to work fine.
|
|
|
|
|
# JNI stuff is used to compute the default cache location on Windows (to get the AppData local
|
|
|
|
|
# dir, or something like this, via native Windows APIs).
|
|
|
|
|
# Without this, if ever coursier fails to load its JNI library on Windows, it falls back
|
|
|
|
|
# to using some powershell scripts (via dirs-dev/directories-jvm), which are often a problem,
|
|
|
|
|
# see sbt/sbt#5206.
|
|
|
|
|
# Enable this once sbt uses the upcoming lm-coursier-shaded version (> 2.0.10-1)
|
|
|
|
|
# export COURSIER_JNI="force"
|
|
|
|
|
|
2020-09-14 18:55:18 +02:00
|
|
|
if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" == "Linux" ]; then
|
2022-08-12 11:10:48 +02:00
|
|
|
SBT="sbt"
|
2020-09-14 18:55:18 +02:00
|
|
|
elif [ "$(uname)" == "Darwin" ]; then
|
2022-08-12 11:10:48 +02:00
|
|
|
SBT="sbt"
|
2020-09-14 18:55:18 +02:00
|
|
|
else
|
2022-08-12 11:10:48 +02:00
|
|
|
SBT="sbt.bat"
|
2020-09-14 18:55:18 +02:00
|
|
|
fi
|
|
|
|
|
|
2018-11-20 10:31:34 +01:00
|
|
|
lmCoursier() {
|
2020-09-14 16:00:01 +02:00
|
|
|
[ "${PLUGIN:-""}" = "sbt-lm-coursier" ]
|
2018-11-20 10:31:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
runLmCoursierTests() {
|
2019-06-19 17:13:44 +02:00
|
|
|
if [ "$TEST_GROUP" = 1 ]; then
|
|
|
|
|
SCRIPTED_EXTRA="sbt-lm-coursier/*"
|
2019-07-26 12:07:11 +02:00
|
|
|
elif [ "$TEST_GROUP" = 2 ]; then
|
|
|
|
|
SCRIPTED_EXTRA="scala-211/*"
|
2019-06-19 17:13:44 +02:00
|
|
|
else
|
|
|
|
|
SCRIPTED_EXTRA=""
|
|
|
|
|
fi
|
|
|
|
|
|
2019-04-24 18:20:32 +02:00
|
|
|
# publishing locally to ensure shading runs fine
|
2020-09-14 18:55:18 +02:00
|
|
|
./metadata/scripts/with-test-repo.sh $SBT \
|
2021-01-10 22:02:04 +01:00
|
|
|
+lm-coursier-shaded/publishLocal \
|
|
|
|
|
+lm-coursier/test \
|
2019-06-19 17:13:44 +02:00
|
|
|
"sbt-lm-coursier/scripted shared-$TEST_GROUP/* $SCRIPTED_EXTRA"
|
2018-11-20 10:31:34 +01:00
|
|
|
}
|
|
|
|
|
|
2017-02-27 16:15:15 +01:00
|
|
|
runSbtCoursierTests() {
|
2018-11-22 14:23:50 +01:00
|
|
|
if [ "$TEST_GROUP" = 1 ]; then
|
|
|
|
|
SCRIPTED_EXTRA="sbt-coursier/*"
|
2019-07-26 12:07:11 +02:00
|
|
|
elif [ "$TEST_GROUP" = 2 ]; then
|
|
|
|
|
SCRIPTED_EXTRA="scala-211/*"
|
2018-11-22 14:23:50 +01:00
|
|
|
else
|
|
|
|
|
SCRIPTED_EXTRA=""
|
|
|
|
|
fi
|
|
|
|
|
|
2020-09-14 18:55:18 +02:00
|
|
|
./metadata/scripts/with-test-repo.sh $SBT \
|
2018-11-20 17:17:53 +01:00
|
|
|
sbt-coursier-shared/test \
|
2018-11-22 14:23:50 +01:00
|
|
|
"sbt-coursier/scripted shared-$TEST_GROUP/* $SCRIPTED_EXTRA"
|
2017-02-27 16:15:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-09-14 16:24:50 +02:00
|
|
|
if lmCoursier; then
|
2018-11-20 10:31:34 +01:00
|
|
|
runLmCoursierTests
|
2017-02-27 16:15:15 +01:00
|
|
|
else
|
2018-09-28 17:55:42 +02:00
|
|
|
runSbtCoursierTests
|
2015-06-16 20:17:07 +02:00
|
|
|
fi
|
2015-06-17 19:36:53 +02:00
|
|
|
|