Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #1434

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
25 changes: 11 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
pip install -r examples/requirements.txt --no-dependencies
- uses: coursier/[email protected]
with:
jvm: 8
jvm: 21
- run: ./mill -i scala.examples.test
shell: bash

Expand All @@ -39,17 +39,14 @@ jobs:
fail-fast: false
matrix:
OS: [ubuntu-latest]
JDK: [8]
SCALA: [2.12.18, 2.12.19, 2.13.13, 2.13.14, 3.3.3, 3.4.2]
JDK: [21]
SCALA: [2.12.18, 2.12.19, 2.13.13, 2.13.14, 3.3.4, 3.4.2]
include:
- OS: windows-latest
JDK: 8
JDK: 21
SCALA: 2.13.14
- OS: macos-13
JDK: 8
SCALA: 2.13.14
- OS: ubuntu-latest
JDK: 17
JDK: 21
SCALA: 2.13.14
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -79,7 +76,7 @@ jobs:
submodules: true
- uses: coursier/[email protected]
with:
jvm: 8
jvm: 21
apps: scala-cli
- run: .github/scripts/run/run-its.sh
shell: bash
Expand All @@ -93,7 +90,7 @@ jobs:
submodules: true
- uses: coursier/[email protected]
with:
jvm: 8
jvm: 21
- run: ./mill __.mimaReportBinaryIssues
shell: bash

Expand All @@ -106,7 +103,7 @@ jobs:
submodules: true
- uses: coursier/[email protected]
with:
jvm: 17
jvm: 21
apps: cs
- run: ./mill docs.generate
shell: bash
Expand All @@ -121,7 +118,7 @@ jobs:
submodules: true
- uses: coursier/[email protected]
with:
jvm: "temurin:17"
jvm: 21
apps: scalafmt
- run: scalafmt --check

Expand All @@ -134,14 +131,14 @@ jobs:
submodules: true
- uses: coursier/[email protected]
with:
jvm: 8
jvm: 21
apps:
- run: |
mv .mill-jvm-opts .mill-jvm-opts.bak
echo "-Xmx2g" > .mill-jvm-opts
cat .mill-jvm-opts.bak | grep -v Xmx >> .mill-jvm-opts
# sometimes running into memory issues when attempting __.publishLocal upfront
for SV in $(./mill dev.scalaVersions); do
for SV in $(./mill -i dev.scalaVersions); do
./mill -i '__['"$SV"'].compile'
./mill -i '__['"$SV"'].docJar'
./mill -i '__['"$SV"'].publishLocal'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
submodules: true
- uses: coursier/[email protected]
with:
jvm: 8
jvm: 21
- run: echo "$PGP_SECRET" | base64 --decode | gpg --batch --import
shell: bash
env:
Expand All @@ -26,13 +26,13 @@ jobs:
mv .mill-jvm-opts .mill-jvm-opts.bak
cat .mill-jvm-opts.bak | grep -v Xmx > .mill-jvm-opts
# sometimes running into memory issues when attempting __.publishLocal or __.publishArtifacts upfront
for SV in $(./mill dev.scalaVersions); do
for SV in $(./mill -i dev.scalaVersions); do
./mill -i '__['"$SV"'].compile'
./mill -i '__['"$SV"'].docJar'
./mill -i '__['"$SV"'].publishLocal'
done
./mill -i __.publishLocal
./mill -i ci.publishSonatype __.publishArtifacts
./mill -i ci.publishSonatype --tasks __.publishArtifacts
shell: bash
env:
PGP_PASSWORD: ${{ secrets.PUBLISH_SECRET_KEY_PASSWORD }}
Expand All @@ -49,7 +49,7 @@ jobs:
submodules: true
- uses: coursier/[email protected]
with:
jvm: 8
jvm: 21
- run: ./mill -i ci.uploadLaunchers
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
Expand All @@ -67,7 +67,7 @@ jobs:
submodules: true
- uses: coursier/[email protected]
with:
jvm: 8
jvm: 21
- run: scripts/update-docker-images.sh
shell: bash
env:
Expand All @@ -84,7 +84,7 @@ jobs:
submodules: true
- uses: coursier/[email protected]
with:
jvm: 17
jvm: 21
apps: cs
- run: |
./mill docs.generate --npm-install --yarn-run-build
Expand Down
2 changes: 1 addition & 1 deletion .mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.7
0.12.8
38 changes: 17 additions & 21 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,8 @@ trait ScalaInterpreter extends Cross.Module[String] with AlmondModule with Bloop
val metabrowse =
if (crossScalaVersion.startsWith("2."))
Agg(
Deps.metabrowseServer
// don't let metabrowse bump our slf4j version (switching to v2 can be quite sensitive when Spark is involved)
.exclude(("org.slf4j", "slf4j-api")),
// bump the scalameta version, so that all scalameta JARs have the same version as the few scalameta
// dependencies of Ammonite
Deps.scalameta
// The scalameta versions of mtags (Metals) and Ammonite may clash here :\
Deps.mtags
)
else
Agg.empty
Expand Down Expand Up @@ -449,10 +445,9 @@ object scala extends Module {
object `scala-interpreter` extends Cross[ScalaInterpreter](ScalaVersions.all)
object `scala-kernel` extends Cross[ScalaKernel](ScalaVersions.all)
object `coursier-logger` extends Cross[CoursierLogger](ScalaVersions.binaries)
object `shared-directives`
extends Cross[SharedDirectives]("2.12.15" +: ScalaVersions.binaries)
object launcher extends Launcher
object `almond-scalapy` extends Cross[AlmondScalaPy](ScalaVersions.binaries)
object `shared-directives` extends Cross[SharedDirectives](ScalaVersions.binaries)
object launcher extends Launcher
object `almond-scalapy` extends Cross[AlmondScalaPy](ScalaVersions.binaries)
object `almond-rx` extends Cross[AlmondRx](Seq(ScalaVersions.scala212, ScalaVersions.scala213))

object `toree-hooks` extends Cross[ToreeHooks](ScalaVersions.binaries)
Expand All @@ -468,7 +463,7 @@ trait Examples extends SbtModule {
private def examplesScalaVersion = "2.12.19"
private def baseRepoRoot = os.sub / "out" / "repo"
def scalaVersion = ScalaVersions.scala3Latest
object test extends SbtModuleTests {
object test extends SbtTests {
def testFramework = "munit.Framework"
def ivyDeps = T {
super.ivyDeps() ++ Agg(
Expand All @@ -483,11 +478,11 @@ trait Examples extends SbtModule {
scala.`almond-scalapy`(ScalaVersions.scala212)
.publishLocalNoFluff((baseRepoRoot / "{VERSION}").toString)()
super.forkArgs() ++ Seq(
s"-Dalmond.examples.dir=${os.pwd / "examples"}",
s"-Dalmond.examples.dir=${T.workspace / "examples"}",
s"-Dalmond.examples.output-dir=${T.dest / "output"}",
s"-Dalmond.examples.jupyter-path=${T.dest / "jupyter"}",
s"-Dalmond.examples.launcher=${scala.`scala-kernel`(examplesScalaVersion).launcher().path}",
s"-Dalmond.examples.repo-root=${baseRepoRoot / scala.`scala-kernel`(examplesScalaVersion).publishVersion()}"
s"-Dalmond.examples.repo-root=${T.workspace / baseRepoRoot / scala.`scala-kernel`(examplesScalaVersion).publishVersion()}"
)
}
}
Expand Down Expand Up @@ -570,7 +565,7 @@ trait Integration extends SbtModule {
Deps.testUtil
)

object test extends SbtModuleTests with TestCommand {
object test extends SbtTests with TestCommand {
object helper extends ScalaModule {
def scalaVersion = ScalaVersions.scala3Latest
def scala213 = T {
Expand All @@ -596,7 +591,7 @@ trait Integration extends SbtModule {
val version = scala.`local-repo`(ScalaVersions.scala3Latest).version()
super.forkArgs() ++ Seq(
"-Xmx768m", // let's not use too much memory here, Windows CI sometimes runs short on it
s"-Dalmond.test.local-repo=${scala.`local-repo`(ScalaVersions.scala3Latest).repoRoot.toString.replace("{VERSION}", version)}",
s"-Dalmond.test.local-repo=${(T.workspace / scala.`local-repo`(ScalaVersions.scala3Latest).repoRoot).toString.replace("{VERSION}", version)}",
s"-Dalmond.test.version=$version",
s"-Dalmond.test.cs-launcher=${GetCs.cs(Deps.coursier.dep.version, "2.1.2")}",
s"-Dalmond.test.scala-version=${ScalaVersions.scala3Latest}",
Expand Down Expand Up @@ -685,7 +680,7 @@ object docs extends ScalaModule with AlmondRepositories {

// TODO Run yarn run thing right after, add --watch mode

val websiteDir = os.pwd / "docs" / "website"
val websiteDir = T.workspace / "docs" / "website"

if (npmInstall)
Util.run(Seq("npm", "install"), dir = websiteDir.toIO)
Expand All @@ -706,7 +701,7 @@ object docs extends ScalaModule with AlmondRepositories {
Util.withBgProcess(
Seq("yarn", "run", "start"),
dir = websiteDir.toIO,
waitFor = () => Util.waitForDir((os.pwd / outputDir.split('/').toSeq).toIO)
waitFor = () => Util.waitForDir((T.workspace / outputDir.split('/').toSeq).toIO)
) {
runMdoc()
}
Expand Down Expand Up @@ -741,9 +736,9 @@ object dev extends Module {
val launcher0 = launcher().path.toNIO
val specialLauncher0 = specialLauncher().path.toNIO
if (console)
jupyterConsole0(launcher0, specialLauncher0, jupyterDir.toNIO, args0)
jupyterConsole0(launcher0, specialLauncher0, jupyterDir.toNIO, args0, T.workspace)
else
jupyterServer(launcher0, specialLauncher0, jupyterDir.toNIO, args0)
jupyterServer(launcher0, specialLauncher0, jupyterDir.toNIO, args0, T.workspace)
}
}

Expand All @@ -770,7 +765,7 @@ object dev extends Module {
}
def scalaVersions() = T.command {
for (sv <- ScalaVersions.all)
println(sv)
mill.api.SystemStreams.original.out.println(sv)
}

def launcher(scalaVersion: String = ScalaVersions.scala213) = T.command {
Expand Down Expand Up @@ -846,7 +841,8 @@ object ci extends Module {
pgpPassword = pgpPassword,
data = data,
timeout = timeout,
log = T.ctx().log
log = T.ctx().log,
workspace = T.workspace
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/dev-from-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Once done building, this should print the path to the kernel launcher, like

Optionally, pass a Scala version, like
```text
$ ./mill dev.launcherFast 2.12.13
$ ./mill dev.launcherFast --scalaVersion 2.12.13
```

You can then run that launcher to install it on your system:
Expand All @@ -87,7 +87,7 @@ version to `./mill dev.jupyter`, beware to pass the same version to `./mill -w d

### List available Scala versions
```text
$ ./mill dev.scalaVersions
$ ./mill -i dev.scalaVersions
2.13.4
2.13.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ object ExampleProperties {
"almond.examples.dir",
sys.error("Expected almond.examples.dir to be set")
)
os.Path(pathStr, os.pwd)
os.Path(pathStr)
}
lazy val outputDirectory = {
val pathStr = sys.props.getOrElse(
"almond.examples.output-dir",
sys.error("Expected almond.examples.output-dir to be set")
)
os.Path(pathStr, os.pwd)
os.Path(pathStr)
}
lazy val launcher = {
val pathStr = sys.props.getOrElse(
"almond.examples.launcher",
sys.error("Expected almond.examples.launcher to be set")
)
os.Path(pathStr, os.pwd)
os.Path(pathStr)
}
lazy val repoRoot = {
val pathStr = sys.props.getOrElse(
"almond.examples.repo-root",
sys.error("Expected almond.examples.repo-root to be set")
)
os.Path(pathStr, os.pwd)
os.Path(pathStr)
}
lazy val jupyterPath = {
val pathStr = sys.props.getOrElse(
"almond.examples.jupyter-path",
sys.error("Expected almond.examples.jupyter-path to be set")
)
os.Path(pathStr, os.pwd)
os.Path(pathStr)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object KernelLauncher {
)

lazy val localRepoRoot = sys.props.get("almond.test.local-repo")
.map(os.Path(_, os.pwd))
.map(os.Path(_))
.getOrElse {
sys.error("almond.test.local-repo Java property not set")
}
Expand All @@ -72,7 +72,7 @@ object KernelLauncher {
Option(System.getenv("ALMOND_INTEGRATION_TMP")).getOrElse {
sys.error("ALMOND_INTEGRATION_TMP not set")
}
val base = os.Path(System.getenv("ALMOND_INTEGRATION_TMP"), os.pwd)
val base = os.Path(System.getenv("ALMOND_INTEGRATION_TMP"))
val rng = new SecureRandom
val d = base / s"run-${math.abs(rng.nextInt().toLong)}"
os.makeDir.all(d)
Expand Down

This file was deleted.

Loading
Loading