Skip to content

Commit a18d9db

Browse files
Adapt mill build to Dotty
1 parent affced6 commit a18d9db

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

build.sc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ trait SourcecodeTestModule extends ScalaModule {
6464
}
6565

6666
object sourcecode extends Module {
67-
object jvm extends Cross[JvmSourcecodeModule]("2.11.12", "2.12.8", "2.13.0", "0.21.0-bin-SNAPSHOT")
67+
val dottyVersion = Option(sys.props("dottyVersion"))
68+
object jvm extends Cross[JvmSourcecodeModule]((List("2.11.12", "2.12.8", "2.13.0") ++ "0.21.0-bin-SNAPSHOT"): _*)
6869
class JvmSourcecodeModule(val crossScalaVersion: String)
6970
extends SourcecodeMainModule with ScalaModule with SourcecodeModule {
7071

mill

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env sh
2+
3+
# This is a wrapper script, that automatically download mill from GitHub release pages
4+
# You can give the required mill version with MILL_VERSION env variable
5+
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
6+
DEFAULT_MILL_VERSION=0.5.0
7+
8+
set -e
9+
10+
if [ -z "$MILL_VERSION" ] ; then
11+
if [ -f ".mill-version" ] ; then
12+
MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)"
13+
elif [ -f "mill" ] && [ "$BASH_SOURCE" != "mill" ] ; then
14+
MILL_VERSION=$(grep -F "DEFAULT_MILL_VERSION=" "mill" | head -n 1 | cut -d= -f2)
15+
else
16+
MILL_VERSION=$DEFAULT_MILL_VERSION
17+
fi
18+
fi
19+
20+
MILL_DOWNLOAD_PATH="$HOME/.mill/download"
21+
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/$MILL_VERSION"
22+
23+
if [ ! -x "$MILL_EXEC_PATH" ] ; then
24+
mkdir -p $MILL_DOWNLOAD_PATH
25+
DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download
26+
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION-assembly"
27+
curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL"
28+
chmod +x "$DOWNLOAD_FILE"
29+
mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"
30+
unset DOWNLOAD_FILE
31+
unset MILL_DOWNLOAD_URL
32+
fi
33+
34+
unset MILL_DOWNLOAD_PATH
35+
unset MILL_VERSION
36+
37+
exec $MILL_EXEC_PATH "$@"

0 commit comments

Comments
 (0)