Skip to content

Commit

Permalink
Ensure the -i option is always respected and passed first for all `…
Browse files Browse the repository at this point in the history
…./mill` calls
  • Loading branch information
Gedochao committed Nov 10, 2023
1 parent 9e93c4a commit 6757bf6
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/build-linux-aarch64-from-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ git config --global --add safe.directory "$(pwd)"

./mill -i show cli.nativeImage
./mill -i copyDefaultLauncher ./artifacts
if "true" == $(./mill -i ci.shouldPublish); then
if "true" == $(./mill -i --disable-callgraph-invalidation ci.shouldPublish); then
.github/scripts/generate-os-packages.sh
fi
6 changes: 3 additions & 3 deletions .github/scripts/generate-native-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false
# Using 'mill -i' so that the Mill process doesn't outlive this invocation

if [[ "$OSTYPE" == "msys" ]]; then
./mill.bat -i ci.copyJvm --dest jvm
./mill.bat -i --disable-callgraph-invalidation ci.copyJvm --dest jvm
export JAVA_HOME="$(pwd -W | sed 's,/,\\,g')\\jvm"
export GRAALVM_HOME="$JAVA_HOME"
export PATH="$(pwd)/bin:$PATH"
echo "PATH=$PATH"
./mill.bat -i "$COMMAND" generate-native-image.bat ""
./mill.bat -i --disable-callgraph-invalidation "$COMMAND" generate-native-image.bat ""
./generate-native-image.bat
else
if [ $# == "0" ]; then
Expand All @@ -42,7 +42,7 @@ else
esac
fi

./mill -i "$COMMAND" generate-native-image.sh ""
./mill -i --disable-callgraph-invalidation "$COMMAND" generate-native-image.sh ""
bash ./generate-native-image.sh
"${CLEANUP[@]}"
fi
8 changes: 4 additions & 4 deletions .github/scripts/generate-os-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ else
fi

packager() {
"$mill" -i packager.run "$@"
"$mill" -i --disable-callgraph-invalidation packager.run "$@"
}

launcher() {
Expand All @@ -34,17 +34,17 @@ launcher() {
launcherName="scala"
fi

"$mill" -i copyTo "$launcherMillCommand" "$launcherName" 1>&2
"$mill" -i --disable-callgraph-invalidation copyTo "$launcherMillCommand" "$launcherName" 1>&2
echo "$launcherName"
}

version() {
"$mill" -i writePackageVersionTo scala-cli-version 1>&2
"$mill" -i --disable-callgraph-invalidation writePackageVersionTo scala-cli-version 1>&2
cat scala-cli-version
}

shortVersion() {
"$mill" -i writeShortPackageVersionTo scala-cli-short-version 1>&2
"$mill" -i --disable-callgraph-invalidation writeShortPackageVersionTo scala-cli-short-version 1>&2
cat scala-cli-short-version
}

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/generate-slim-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
WORKDIR="$ROOT/out/docker-slim-workdir"

mkdir -p "$WORKDIR"
./mill -i copyTo cli.nativeImageMostlyStatic "$WORKDIR/scala-cli" 1>&2
./mill -i --disable-callgraph-invalidation copyTo cli.nativeImageMostlyStatic "$WORKDIR/scala-cli" 1>&2

cd "$WORKDIR"
docker build -t scala-cli-slim -f "$ROOT/.github/scripts/docker/ScalaCliSlimDockerFile" .
2 changes: 1 addition & 1 deletion .github/scripts/publish-docker-images.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eu

SCALA_CLI_VERSION="$(./mill -i ci.publishVersion)"
SCALA_CLI_VERSION="$(./mill -i --disable-callgraph-invalidation ci.publishVersion)"

docker tag scala-cli virtuslab/scala-cli:latest
docker tag scala-cli virtuslab/scala-cli:"$SCALA_CLI_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/publish-slim-docker-images.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eu

SCALA_CLI_VERSION="$(./mill -i ci.publishVersion)"
SCALA_CLI_VERSION="$(./mill -i --disable-callgraph-invalidation ci.publishVersion)"

docker tag scala-cli-slim virtuslab/scala-cli-slim:latest
docker tag scala-cli-slim virtuslab/scala-cli-slim:"$SCALA_CLI_VERSION"
Expand Down
Loading

0 comments on commit 6757bf6

Please sign in to comment.