Skip to content

Commit 7bc22c7

Browse files
authored
update mill (#99)
Updates to the latest mill.
1 parent c99f828 commit 7bc22c7

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

build.sc

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ class RequestsModule(val crossScalaVersion: String) extends CrossScalaModule wit
2929
def ivyDeps = Agg(
3030
ivy"com.lihaoyi::geny::0.6.10"
3131
)
32-
object test extends Tests{
32+
object test extends Tests with TestModule.Utest {
3333
def ivyDeps = Agg(
3434
ivy"com.lihaoyi::utest::0.7.10",
3535
ivy"com.lihaoyi::ujson::1.3.13"
3636
)
37-
def testFrameworks = Seq("utest.runner.Framework")
3837
}
3938
}

mill

+19-7
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,39 @@
33
# This is a wrapper script, that automatically download mill from GitHub release pages
44
# You can give the required mill version with MILL_VERSION env variable
55
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
6-
DEFAULT_MILL_VERSION=0.9.12
6+
DEFAULT_MILL_VERSION=0.10.4
77

88
set -e
99

1010
if [ -z "$MILL_VERSION" ] ; then
1111
if [ -f ".mill-version" ] ; then
1212
MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)"
13-
elif [ -f "mill" ] && [ "$BASH_SOURCE" != "mill" ] ; then
13+
elif [ -f "mill" ] && [ "$0" != "mill" ] ; then
1414
MILL_VERSION=$(grep -F "DEFAULT_MILL_VERSION=" "mill" | head -n 1 | cut -d= -f2)
1515
else
1616
MILL_VERSION=$DEFAULT_MILL_VERSION
1717
fi
1818
fi
1919

20-
MILL_DOWNLOAD_PATH="$HOME/.mill/download"
21-
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/$MILL_VERSION"
20+
if [ "x${XDG_CACHE_HOME}" != "x" ] ; then
21+
MILL_DOWNLOAD_PATH="${XDG_CACHE_HOME}/mill/download"
22+
else
23+
MILL_DOWNLOAD_PATH="${HOME}/.cache/mill/download"
24+
fi
25+
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/${MILL_VERSION}"
26+
27+
version_remainder="$MILL_VERSION"
28+
MILL_MAJOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
29+
MILL_MINOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
2230

23-
if [ ! -x "$MILL_EXEC_PATH" ] ; then
24-
mkdir -p $MILL_DOWNLOAD_PATH
31+
if [ ! -s "$MILL_EXEC_PATH" ] ; then
32+
mkdir -p "$MILL_DOWNLOAD_PATH"
33+
if [ "$MILL_MAJOR_VERSION" -gt 0 ] || [ "$MILL_MINOR_VERSION" -ge 5 ] ; then
34+
ASSEMBLY="-assembly"
35+
fi
2536
DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download
26-
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION-assembly"
37+
MILL_VERSION_TAG=$(echo $MILL_VERSION | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/')
38+
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION_TAG}/$MILL_VERSION${ASSEMBLY}"
2739
curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL"
2840
chmod +x "$DOWNLOAD_FILE"
2941
mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"

0 commit comments

Comments
 (0)