#!/bin/sh
# Compile and run a Scala 3 project offline with the installed sbt.
set -e
cd "$AUTOPKGTEST_TMP"
export HOME="$AUTOPKGTEST_TMP/home"
mkdir -p "$HOME" hello/src/main/scala hello/project
cd hello
printf 'name := "hello"\n' > build.sbt
printf '@main def hello(): Unit = println("hello from sbt")\n' > src/main/scala/Hello.scala
sbt about compile run < /dev/null 2>&1 | tee ../log
grep -q '^\[info\] This is sbt 2' ../log
grep -q '^hello from sbt$' ../log
