Skip to content

Commit

Permalink
Update .mill-version (#1575)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi authored Oct 24, 2024
1 parent 12f9f19 commit 372a91c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.12
0.12.0
4 changes: 4 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ trait AmmInternalModule extends CrossSbtModule with Bloop.Module {
trait AmmTests extends super.Tests with TestModule.Utest {
def ivyDeps = super.ivyDeps() ++ Agg(Deps.utest)
def forkArgs = Seq("-Xmx2g", "-Dfile.encoding=UTF8")
def testForkGrouping = discoveredTestClasses().grouped(1).toSeq
def testSandboxWorkingDir = false
}
def allBoundIvyDeps = T { transitiveIvyDeps() ++ scalaLibraryIvyDeps().map(bindDependency()) }
def sources = T.sources {
Expand Down Expand Up @@ -909,6 +911,7 @@ def publishDocs(skipDeploy: Boolean = false): Command[Unit] = {
"sbt",
"readme/run"
).call(
cwd = T.workspace,
env = Map(
"AMMONITE_ASSEMBLY" -> ammoniteAssembly().path.toString,
"CONSTANTS_FILE" -> generateConstantsFile(returnDirectory = false).toString
Expand Down Expand Up @@ -969,6 +972,7 @@ def publishDocs(skipDeploy: Boolean = false): Command[Unit] = {
"sbt",
"readme/run"
).call(
cwd = T.workspace,
env = Map(
"AMMONITE_ASSEMBLY" -> ammoniteAssembly().path.toString,
"CONSTANTS_FILE" -> constantsFile.toString
Expand Down
22 changes: 19 additions & 3 deletions mill
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
# This is a wrapper script, that automatically download mill from GitHub release pages
# You can give the required mill version with MILL_VERSION env variable
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
DEFAULT_MILL_VERSION=0.10.7

set -e

if [ -z "${DEFAULT_MILL_VERSION}" ] ; then
DEFAULT_MILL_VERSION=0.11.12
fi

if [ -z "$MILL_VERSION" ] ; then
if [ -f ".mill-version" ] ; then
MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)"
Expand Down Expand Up @@ -37,15 +40,28 @@ if [ ! -s "$MILL_EXEC_PATH" ] ; then
fi
DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download
MILL_VERSION_TAG=$(echo $MILL_VERSION | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/')
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION_TAG}/$MILL_VERSION${ASSEMBLY}"
MILL_DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/$MILL_VERSION/mill-dist-$MILL_VERSION.jar"
curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL"
chmod +x "$DOWNLOAD_FILE"
mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"
unset DOWNLOAD_FILE
unset MILL_DOWNLOAD_URL
fi

if [ -z "$MILL_MAIN_CLI" ] ; then
MILL_MAIN_CLI="${0}"
fi

MILL_FIRST_ARG=""

# first arg is a long flag for "--interactive" or starts with "-i"
if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then
# Need to preserve the first position of those listed options
MILL_FIRST_ARG=$1
shift
fi

unset MILL_DOWNLOAD_PATH
unset MILL_VERSION

exec $MILL_EXEC_PATH "$@"
exec $MILL_EXEC_PATH $MILL_FIRST_ARG -D "mill.main.cli=${MILL_MAIN_CLI}" "$@"

0 comments on commit 372a91c

Please sign in to comment.