Skip to content

Commit

Permalink
Fixed bootstrap tests (#1501)
Browse files Browse the repository at this point in the history
We need to use the assembly instead of the script.
If we use the script, it will read the `.mill-version` file and run with the wrong version.

Fix an potential issue with non-existant paths in `ScalaModule.docJar` target.

Pull request: #1501
  • Loading branch information
lefou authored Sep 28, 2021
1 parent b5eee0a commit dc2a0cd
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ object dev extends MillModule {
override def assembly = T{
val isWin = scala.util.Properties.isWin
val millPath = T.ctx.dest / (if (isWin) "mill.bat" else "mill")
os.move(super.assembly().path, millPath)
os.copy(super.assembly().path, millPath)
PathRef(millPath)
}

Expand Down
12 changes: 6 additions & 6 deletions ci/test-mill-bootstrap-0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ git stash -u
git stash -a

# First build
./mill -i all __.publishLocal launcher
cp out/launcher/dest/mill ~/mill-1
./mill -i "{__.publishLocal,assembly}"
cp out/assembly/dest/mill ~/mill-1

# Clean up
git stash -u
git stash -a

rm -rf ~/.mill
rm -rf ~/.mill/ammonite

# Differentiate first and second builds
git config --global user.name "Your Name"
Expand All @@ -24,14 +24,14 @@ echo "Build 2" > info.txt && git add info.txt && git commit -m "Add info.txt"
ci/patch-mill-bootstrap.sh

# Second build
~/mill-1 -i all __.publishLocal launcher
cp out/launcher/dest/mill ~/mill-2
~/mill-1 -i "{__.publishLocal,assembly}"
cp out/assembly/dest/mill ~/mill-2

# Clean up
git stash -u
git stash -a

rm -rf ~/.mill
rm -rf ~/.mill/ammonite

# Patch local build
ci/patch-mill-bootstrap.sh
Expand Down
12 changes: 6 additions & 6 deletions ci/test-mill-bootstrap-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ git stash -u
git stash -a

# First build
./mill -i all __.publishLocal launcher
cp out/launcher/dest/mill ~/mill-1
./mill -i "{__.publishLocal,assembly}"
cp out/assembly/dest/mill ~/mill-1

# Clean up
git stash -u
git stash -a

rm -rf ~/.mill
rm -rf ~/.mill/ammonite

# Differentiate first and second builds
git config --global user.name "Your Name"
Expand All @@ -24,14 +24,14 @@ echo "Build 2" > info.txt && git add info.txt && git commit -m "Add info.txt"
ci/patch-mill-bootstrap.sh

# Second build
~/mill-1 -i all __.publishLocal launcher
cp out/launcher/dest/mill ~/mill-2
~/mill-1 -i "{__.publishLocal,assembly}"
cp out/assembly/dest/mill ~/mill-2

# Clean up
git stash -u
git stash -a

rm -rf ~/.mill
rm -rf ~/.mill/ammonite

# Patch local build
ci/patch-mill-bootstrap.sh
Expand Down
2 changes: 1 addition & 1 deletion ci/test-mill-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ git stash -a
# Build Mill
./mill -i dev.assembly

rm -rf ~/.mill
rm -rf ~/.mill/ammonite

# Patch local build
ci/patch-mill-bootstrap.sh
Expand Down
2 changes: 1 addition & 1 deletion ci/test-mill-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ci/publish-local.sh
git stash -u
git stash -a

rm -rf ~/.mill
rm -rf ~/.mill/ammonite

# Patch local build
ci/patch-mill-bootstrap.sh
Expand Down
2 changes: 2 additions & 0 deletions scalalib/src/ScalaModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ trait ScalaModule extends JavaModule { outer =>
),
docSources()
.map(_.path)
.filter(os.exists)
.flatMap(os.walk(_))
.filter(_.ext == "tasty")
.map(_.toString),
Expand All @@ -304,6 +305,7 @@ trait ScalaModule extends JavaModule { outer =>
Seq("-d", javadocDir.toNIO.toString),
docSources()
.map(_.path)
.filter(os.exists)
.flatMap(os.walk(_))
.filter(os.isFile)
.map(_.toString),
Expand Down

0 comments on commit dc2a0cd

Please sign in to comment.