Skip to content

Commit

Permalink
Remove remaining of Scala 2 in some scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-bucev committed May 8, 2024
1 parent a7303f3 commit 64e5ae9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 25 deletions.
3 changes: 1 addition & 2 deletions .larabot.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ nightly {
"sbt universal:stage"
"sbt -batch -Dtestsuite-parallelism=5 test"
"sbt -batch -Dtestsuite-parallelism=3 -Dtestcase-parallelism=5 it:test"
"bash bin/external-tests.sh --only-scalac"
"bash bin/external-tests.sh --only-dotty"
"bash bin/external-tests.sh"
"sbt -batch scripted"
"bash bin/build-slc-lib.sh"
]
Expand Down
3 changes: 1 addition & 2 deletions bin/bolts-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
set -e

TEST_DIR=$1
FRONTEND=$2
echo "Moving to $TEST_DIR"
mkdir -p "$TEST_DIR"
cd "$TEST_DIR" || exit 1
Expand All @@ -16,6 +15,6 @@ else
cd bolts || exit 1
fi

bash ./run-tests.sh "$FRONTEND"
bash ./run-tests.sh stainless-dotty

cd ../.. || true
24 changes: 3 additions & 21 deletions bin/external-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,10 @@ Usage: external-tests.sh [options]
-h | -help Print this message
--skip-build Do not build Stainless (saves time if the build is already up-to-date).
--only-scalac Run the tests for the Scalac frontend only.
--only-dotty Run the tests for the Dotty frontend only.
EOM
}

SKIP_BUILD=false
ONLY_SCALAC=false
ONLY_DOTTY=false
while [[ $# -gt 0 ]]; do
key="$1"

Expand All @@ -104,14 +100,6 @@ while [[ $# -gt 0 ]]; do
SKIP_BUILD=true
shift # past argument
;;
--only-scalac)
ONLY_SCALAC=true
shift # past argument
;;
--only-dotty)
ONLY_DOTTY=true
shift # past argument
;;
*) # unknown option
usage
exit 1
Expand Down Expand Up @@ -141,7 +129,7 @@ if [[ "$SKIP_BUILD" = false ]]; then

echo "Publishing Stainless..."

STAINLESS_VERSION=$(sbt publishLocal | $SED -n -r 's#^.*stainless-scalac-plugin_2.12.13/([^/]+)/poms.*$#\1#p' | head -n1)
STAINLESS_VERSION=$(sbt publishLocal | $SED -n -r 's#^.*stainless-dotty-plugin_3.3.3/([^/]+)/poms.*$#\1#p' | head -n1)

echo "Published Stainless version is: $STAINLESS_VERSION"
else
Expand All @@ -158,11 +146,5 @@ mkdir -p "$TEST_DIR"

# Stainless Actors are currently disabled: https://github.com/epfl-lara/stainless/issues/970
# "$BIN_DIR/stainless-actors-tests.sh" "$TEST_DIR" "$STAINLESS_VERSION"
if [[ "$ONLY_DOTTY" = false ]]; then
echo "Running bolts test for scalac"
"$BIN_DIR/bolts-tests.sh" "$TEST_DIR" "stainless-scalac"
fi
if [[ "$ONLY_SCALAC" = false ]]; then
echo "Running bolts test for dotty"
"$BIN_DIR/bolts-tests.sh" "$TEST_DIR" "stainless-dotty"
fi
echo "Running bolts test"
"$BIN_DIR/bolts-tests.sh" "$TEST_DIR" "stainless-dotty"
4 changes: 4 additions & 0 deletions bin/package-sbt-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fi

SCALA_VERSION="3.3.3"
SCALA_LIB_VERSION="3.3.3"
PUBLISHED_SBT_PLUGIN_DIR="$HOME/.ivy2/local/ch.epfl.lara/sbt-stainless/scala_2.12/sbt_1.0/$STAINLESS_VERSION"
LIB_SCALA_VERSION_JAR_NAME_PART=$(echo $SCALA_LIB_VERSION | cut -d '.' -f 1)
PUBLISHED_LIB_DIR="$HOME/.ivy2/local/ch.epfl.lara/stainless-library_$LIB_SCALA_VERSION_JAR_NAME_PART/$STAINLESS_VERSION"
PUBLISHED_DOTTY_DIR="$HOME/.ivy2/local/ch.epfl.lara/stainless-dotty-plugin_$SCALA_VERSION/$STAINLESS_VERSION"
Expand Down Expand Up @@ -39,6 +40,9 @@ info "$(tput bold)[] Locally publishing artifacts..."
sbt publishLocal >> $LOG 2>&1 && okay || fail

info "$(tput bold)[] Preparing SBT plugin jar..."
OUT_SBT_JAR_DIR="$OUTPUT/project/lib"
mkdir -p "$OUT_SBT_JAR_DIR"
cp "$PUBLISHED_SBT_PLUGIN_DIR/jars/sbt-stainless.jar" "$OUT_SBT_JAR_DIR/sbt-stainless.jar"
OUT_DOTTY_DIR="$OUTPUT/stainless/ch/epfl/lara/stainless-dotty-plugin_$SCALA_VERSION/$STAINLESS_VERSION"
mkdir -p "$OUT_DOTTY_DIR"
cp "$PUBLISHED_DOTTY_DIR/jars/stainless-dotty-plugin_$SCALA_VERSION.jar" "$OUT_DOTTY_DIR/stainless-dotty-plugin_$SCALA_VERSION-$STAINLESS_VERSION.jar"
Expand Down

0 comments on commit 64e5ae9

Please sign in to comment.