Skip to content

Commit

Permalink
Merge branch 'com-lihaoyi:main' into adding-sonatype-central
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrapyre authored May 25, 2024
2 parents a898a0f + 9ec9bc1 commit 5813468
Show file tree
Hide file tree
Showing 62 changed files with 1,402 additions and 391 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
./mill -i -k __.ivyDepsTree
./mill -i -k __.ivyDepsTree --withRuntime
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: ${{ matrix.java-version }}
Expand Down Expand Up @@ -86,11 +85,19 @@ jobs:
- java-version: 17
millargs: docs.githubPages


uses: ./.github/workflows/run-mill-action.yml
with:
java-version: ${{ matrix.java-version }}
millargs: ${{ matrix.millargs }}

compiler-bridge:
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '8'
millargs: bridge.__.publishLocal
env-bridge-versions: 'essential'

format-check:
uses: ./.github/workflows/run-mill-action.yml
with:
Expand Down Expand Up @@ -145,7 +152,7 @@ jobs:
publish-sonatype:
# when in master repo, publish all tags and manual runs on main
if: github.repository == 'com-lihaoyi/mill' && (startsWith( github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' ) )
needs: [linux, windows, format-check, bincompat-check, scalafix-check, itest]
needs: [linux, windows, compiler-bridge, format-check, bincompat-check, scalafix-check, itest]

runs-on: ubuntu-latest

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/run-mill-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ on:
timeout-minutes:
default: 90
type: number
env-bridge-versions:
default: 'none'
type: string

jobs:
build:

runs-on: ${{ inputs.os }}
continue-on-error: ${{ inputs.continue-on-error }}
timeout-minutes: ${{ inputs.timeout-minutes }}
env:
MILL_COMPILER_BRIDGE_VERSIONS: ${{ inputs.env-bridge-versions }}

steps:
- uses: actions/checkout@v4
Expand Down
107 changes: 59 additions & 48 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
import $ivy.`com.github.lolgab::mill-mima::0.1.0`
import $ivy.`net.sourceforge.htmlcleaner:htmlcleaner:2.29`
import $ivy.`com.lihaoyi::mill-contrib-buildinfo:`
import $ivy.`com.goyeau::mill-scalafix::0.3.2`
import $ivy.`com.goyeau::mill-scalafix::0.4.0`

// imports
import com.github.lolgab.mill.mima.{CheckDirection, ProblemFilter, Mima}
Expand Down Expand Up @@ -52,13 +52,15 @@ object Settings {
object Deps {

// The Scala version to use
val scalaVersion = "2.13.13"
// When updating, run "Publish Bridges" Github Actions for the new version
// and then add to it `bridgeScalaVersions`
val scalaVersion = "2.13.14"
// Scoverage 1.x will not get releases for newer Scala versions
val scalaVersionForScoverageWorker1 = "2.13.8"
// The Scala 2.12.x version to use for some workers
val workerScalaVersion212 = "2.12.19"

val testScala213Version = "2.13.10"
val testScala213Version = "2.13.14"
// Scala Native 4.2 will not get releases for new Scala version
val testScala213VersionForScalaNative42 = "2.13.8"
val testScala212Version = "2.12.6"
Expand All @@ -78,6 +80,7 @@ object Deps {
val scalajsEnvSelenium = ivy"org.scala-js::scalajs-env-selenium:1.1.1"
val scalajsSbtTestAdapter = ivy"org.scala-js::scalajs-sbt-test-adapter:${scalaJsVersion}"
val scalajsLinker = ivy"org.scala-js::scalajs-linker:${scalaJsVersion}"
val scalajsImportMap = ivy"com.armanbilge::scalajs-importmap:0.1.1"
}

object Scalanative_0_4 {
Expand All @@ -89,7 +92,7 @@ object Deps {
}

object Scalanative_0_5 {
val scalanativeVersion = "0.5.0"
val scalanativeVersion = "0.5.1"
val scalanativeTools = ivy"org.scala-native::tools:${scalanativeVersion}"
val scalanativeUtil = ivy"org.scala-native::util:${scalanativeVersion}"
val scalanativeNir = ivy"org.scala-native::nir:${scalanativeVersion}"
Expand Down Expand Up @@ -120,22 +123,22 @@ object Deps {
val playVersion = "2.9.1"
}
object Play_3_0 extends Play {
val playVersion = "3.0.1"
val playVersion = "3.0.3"
}
val play =
Seq(Play_3_0, Play_2_9, Play_2_8, Play_2_7, Play_2_6).map(p => (p.playBinVersion, p)).toMap

val acyclic = ivy"com.lihaoyi:::acyclic:0.3.11"
val ammoniteVersion = "3.0.0-M1"
val acyclic = ivy"com.lihaoyi:::acyclic:0.3.12"
val ammoniteVersion = "3.0.0-M2-2-741e5dbb"
val asmTree = ivy"org.ow2.asm:asm-tree:9.7"
val bloopConfig = ivy"ch.epfl.scala::bloop-config:1.5.5"

val coursier = ivy"io.get-coursier::coursier:2.1.9"
val coursier = ivy"io.get-coursier::coursier:2.1.10"
val coursierInterface = ivy"io.get-coursier:interface:1.0.19"

val cask = ivy"com.lihaoyi::cask:0.9.1"
val castor = ivy"com.lihaoyi::castor:0.3.0"
val fastparse = ivy"com.lihaoyi::fastparse:3.0.2"
val fastparse = ivy"com.lihaoyi::fastparse:3.1.0"
val flywayCore = ivy"org.flywaydb:flyway-core:8.5.13"
val graphvizJava = ivy"guru.nidi:graphviz-java-all-j2v8:0.18.1"
val junixsocket = ivy"com.kohlschutter.junixsocket:junixsocket-core:2.9.1"
Expand All @@ -149,10 +152,10 @@ object Deps {

val junitInterface = ivy"com.github.sbt:junit-interface:0.13.3"
val lambdaTest = ivy"de.tototec:de.tobiasroeser.lambdatest:0.8.0"
val log4j2Core = ivy"org.apache.logging.log4j:log4j-core:2.23.0"
val osLib = ivy"com.lihaoyi::os-lib:0.10.0"
val pprint = ivy"com.lihaoyi::pprint:0.8.1"
val mainargs = ivy"com.lihaoyi::mainargs:0.6.3"
val log4j2Core = ivy"org.apache.logging.log4j:log4j-core:2.23.1"
val osLib = ivy"com.lihaoyi::os-lib:0.10.1"
val pprint = ivy"com.lihaoyi::pprint:0.9.0"
val mainargs = ivy"com.lihaoyi::mainargs:0.7.0"
val millModuledefsVersion = "0.10.9"
val millModuledefsString = s"com.lihaoyi::mill-moduledefs:${millModuledefsVersion}"
val millModuledefs = ivy"${millModuledefsString}"
Expand All @@ -161,14 +164,13 @@ object Deps {
// can't use newer versions, as these need higher Java versions
val testng = ivy"org.testng:testng:7.5.1"
val sbtTestInterface = ivy"org.scala-sbt:test-interface:1.0"
val scalaCheck = ivy"org.scalacheck::scalacheck:1.17.0"
def scalaCompiler(scalaVersion: String) = ivy"org.scala-lang:scala-compiler:${scalaVersion}"
// last scalafmt release supporting Java 8 is 3.7.15
val scalafmtDynamic = ivy"org.scalameta::scalafmt-dynamic:3.7.15" // scala-steward:off
def scalap(scalaVersion: String) = ivy"org.scala-lang:scalap:${scalaVersion}"
def scalaReflect(scalaVersion: String) = ivy"org.scala-lang:scala-reflect:${scalaVersion}"
val scalacScoveragePlugin = ivy"org.scoverage:::scalac-scoverage-plugin:1.4.11"
val scoverage2Version = "2.1.0"
val scoverage2Version = "2.1.1"
val scalacScoverage2Plugin = ivy"org.scoverage:::scalac-scoverage-plugin:${scoverage2Version}"
val scalacScoverage2Reporter = ivy"org.scoverage::scalac-scoverage-reporter:${scoverage2Version}"
val scalacScoverage2Domain = ivy"org.scoverage::scalac-scoverage-domain:${scoverage2Version}"
Expand All @@ -178,16 +180,15 @@ object Deps {
val scalatags = ivy"com.lihaoyi::scalatags:0.12.0"
def scalaXml = ivy"org.scala-lang.modules::scala-xml:2.2.0"
// keep in sync with doc/antora/antory.yml
val semanticDBscala = ivy"org.scalameta:::semanticdb-scalac:4.9.3"
val semanticDbJava = ivy"com.sourcegraph:semanticdb-java:0.9.9"
val semanticDBscala = ivy"org.scalameta:::semanticdb-scalac:4.9.5"
val semanticDbJava = ivy"com.sourcegraph:semanticdb-java:0.9.10"
val sourcecode = ivy"com.lihaoyi::sourcecode:0.3.1"
val upickle = ivy"com.lihaoyi::upickle:3.2.0"
val utest = ivy"com.lihaoyi::utest:0.8.2"
val upickle = ivy"com.lihaoyi::upickle:3.3.1"
val windowsAnsi = ivy"io.github.alexarchambault.windows-ansi:windows-ansi:0.0.5"
val zinc = ivy"org.scala-sbt::zinc:1.9.6"
val zinc = ivy"org.scala-sbt::zinc:1.10.0"
// keep in sync with doc/antora/antory.yml
val bsp4j = ivy"ch.epfl.scala:bsp4j:2.2.0-M2"
val fansi = ivy"com.lihaoyi::fansi:0.4.0"
val fansi = ivy"com.lihaoyi::fansi:0.5.0"
val jarjarabrams = ivy"com.eed3si9n.jarjarabrams::jarjar-abrams-core:1.14.0"
val requests = ivy"com.lihaoyi::requests:0.8.2"
val sonatypeCentralClient = ivy"com.lumidion::sonatype-central-client-requests:0.2.0"
Expand All @@ -198,15 +199,17 @@ object Deps {
ivy"commons-io:commons-io:2.16.1",
ivy"com.google.code.gson:gson:2.10.1",
ivy"com.google.protobuf:protobuf-java:3.25.3",
ivy"com.google.guava:guava:33.1.0-jre",
ivy"com.google.guava:guava:33.2.0-jre",
ivy"org.yaml:snakeyaml:2.2",
ivy"org.apache.commons:commons-compress:[1.26.0,)"
)

/** Used in tests. */
object TestDeps {
// tests framework (test)
val scalaCheck = ivy"org.scalacheck::scalacheck:1.18.0"
val scalaTest = ivy"org.scalatest::scalatest:3.2.18"
val utest = ivy"com.lihaoyi::utest:0.8.3"
val zioTest = ivy"dev.zio::zio-test:2.0.21"
}

Expand Down Expand Up @@ -235,10 +238,13 @@ def millBinPlatform: T[String] = T {

def baseDir = build.millSourcePath

val essentialBridgeScalaVersions =
Seq(Deps.scalaVersion, Deps.scalaVersionForScoverageWorker1, Deps.workerScalaVersion212)
// published compiler bridges
val bridgeScalaVersions = Seq(
// Our version of Zinc doesn't work with Scala 2.12.0 and 2.12.4 compiler
// bridges. We skip 2.12.1 because it's so old not to matter, and we need a
// non-supported scala versionm for testing purposes. We skip 2.13.0-2 because
// non-supported scala version for testing purposes. We skip 2.13.0-2 because
// scaladoc fails on windows
/*"2.12.0",*/ /*2.12.1",*/ "2.12.2",
"2.12.3", /*"2.12.4",*/ "2.12.5",
Expand All @@ -256,7 +262,8 @@ val bridgeScalaVersions = Seq(
"2.12.17",
"2.12.18",
"2.12.19",
/*"2.13.0", "2.13.1", "2.13.2",*/ "2.13.3",
/*"2.13.0", "2.13.1", "2.13.2",*/
"2.13.3",
"2.13.4",
"2.13.5",
"2.13.6",
Expand All @@ -266,7 +273,8 @@ val bridgeScalaVersions = Seq(
"2.13.10",
"2.13.11",
"2.13.12",
"2.13.13"
"2.13.13",
"2.13.14"
)

// We limit the number of compiler bridges to compile and publish for local
Expand All @@ -276,9 +284,10 @@ val bridgeScalaVersions = Seq(
// if given.
val compilerBridgeScalaVersions =
interp.watchValue(sys.env.get("MILL_COMPILER_BRIDGE_VERSIONS")) match {
case None => Seq.empty[String]
case Some("all") => bridgeScalaVersions
case Some(versions) => versions.split(',').map(_.trim).toSeq
case None | Some("") | Some("none") => Seq.empty[String]
case Some("all") => (essentialBridgeScalaVersions ++ bridgeScalaVersions).distinct
case Some("essential") => essentialBridgeScalaVersions
case Some(versions) => versions.split(',').map(_.trim()).filterNot(_.isEmpty).toSeq
}
val bridgeVersion = "0.0.1"

Expand Down Expand Up @@ -354,6 +363,7 @@ trait MillPublishJavaModule extends MillJavaModule with PublishModule {
trait MillScalaModule extends ScalaModule with MillJavaModule with ScalafixModule { outer =>
def scalaVersion = Deps.scalaVersion
def scalafixScalaBinaryVersion = ZincWorkerUtil.scalaBinaryVersion(scalaVersion())
def semanticDbVersion = Deps.semanticDBscala.version
def scalacOptions =
super.scalacOptions() ++ Seq(
"-deprecation",
Expand All @@ -363,7 +373,7 @@ trait MillScalaModule extends ScalaModule with MillJavaModule with ScalafixModul
"-Xlint:adapted-args"
)

def testIvyDeps: T[Agg[Dep]] = Agg(Deps.utest)
def testIvyDeps: T[Agg[Dep]] = Agg(Deps.TestDeps.utest)
def testModuleDeps: Seq[JavaModule] =
if (this == main) Seq(main)
else Seq(this, main.test)
Expand Down Expand Up @@ -413,7 +423,7 @@ trait MillBaseTestsModule extends MillJavaModule with TestModule {
s"-DTEST_SCALAJS_VERSION=${Deps.Scalajs_1.scalaJsVersion}",
s"-DTEST_SCALANATIVE_0_4_VERSION=${Deps.Scalanative_0_4.scalanativeVersion}",
s"-DTEST_SCALANATIVE_0_5_VERSION=${Deps.Scalanative_0_5.scalanativeVersion}",
s"-DTEST_UTEST_VERSION=${Deps.utest.dep.version}",
s"-DTEST_UTEST_VERSION=${Deps.TestDeps.utest.dep.version}",
s"-DTEST_SCALATEST_VERSION=${Deps.TestDeps.scalaTest.dep.version}",
s"-DTEST_TEST_INTERFACE_VERSION=${Deps.sbtTestInterface.dep.version}",
s"-DTEST_ZIOTEST_VERSION=${Deps.TestDeps.zioTest.dep.version}",
Expand Down Expand Up @@ -523,7 +533,8 @@ trait BridgeModule extends MillPublishJavaModule with CrossScalaModule {
def pomSettings = commonPomSettings(artifactName())
def crossFullScalaVersion = true
def ivyDeps = Agg(
ivy"org.scala-sbt:compiler-interface:${Versions.zinc}",
ivy"org.scala-sbt:compiler-interface:${Deps.zinc.version}",
ivy"org.scala-sbt:util-interface:${Deps.zinc.version}",
ivy"org.scala-lang:scala-compiler:${crossScalaVersion}"
)

Expand All @@ -532,23 +543,21 @@ trait BridgeModule extends MillPublishJavaModule with CrossScalaModule {
Seq(PathRef(T.dest))
}

def generatedSources = T {
import mill.scalalib.api.ZincWorkerUtil.{grepJar, scalaBinaryVersion}
val resolvedJars = resolveDeps(
T.task {
Agg(ivy"org.scala-sbt::compiler-bridge:${Deps.zinc.dep.version}").map(bindDependency())
},
def compilerBridgeIvyDeps: T[Agg[Dep]] = Agg(
ivy"org.scala-sbt::compiler-bridge:${Deps.zinc.version}".exclude("*" -> "*")
)

def compilerBridgeSourceJars: T[Agg[PathRef]] = T {
resolveDeps(
T.task { compilerBridgeIvyDeps().map(bindDependency()) },
sources = true
)()
}

val bridgeJar = grepJar(
resolvedJars,
s"compiler-bridge_${scalaBinaryVersion(scalaVersion())}",
Deps.zinc.dep.version,
true
)

mill.api.IO.unpackZip(bridgeJar.path, os.rel)
def generatedSources = T {
compilerBridgeSourceJars().foreach { jar =>
mill.api.IO.unpackZip(jar.path, os.rel)
}

Seq(PathRef(T.dest))
}
Expand Down Expand Up @@ -731,7 +740,7 @@ def formatDep(dep: Dep) = {
object scalalib extends MillStableScalaModule {
def moduleDeps = Seq(main, scalalib.api, testrunner)
def ivyDeps = Agg(Deps.scalafmtDynamic, Deps.scalaXml)
def testIvyDeps = super.testIvyDeps() ++ Agg(Deps.scalaCheck)
def testIvyDeps = super.testIvyDeps() ++ Agg(Deps.TestDeps.scalaCheck)
def testTransitiveDeps = super.testTransitiveDeps() ++ Seq(worker.testDep())

object backgroundwrapper extends MillPublishJavaModule with MillJavaModule {
Expand Down Expand Up @@ -797,7 +806,8 @@ object scalajslib extends MillStableScalaModule with BuildInfo {
formatDep(Deps.Scalajs_1.scalajsEnvExoegoJsdomNodejs)
),
BuildInfo.Value("scalajsEnvPhantomJs", formatDep(Deps.Scalajs_1.scalajsEnvPhantomjs)),
BuildInfo.Value("scalajsEnvSelenium", formatDep(Deps.Scalajs_1.scalajsEnvSelenium))
BuildInfo.Value("scalajsEnvSelenium", formatDep(Deps.Scalajs_1.scalajsEnvSelenium)),
BuildInfo.Value("scalajsImportMap", formatDep(Deps.Scalajs_1.scalajsImportMap))
)
}

Expand All @@ -818,7 +828,8 @@ object scalajslib extends MillStableScalaModule with BuildInfo {
Deps.Scalajs_1.scalajsEnvJsdomNodejs,
Deps.Scalajs_1.scalajsEnvExoegoJsdomNodejs,
Deps.Scalajs_1.scalajsEnvPhantomjs,
Deps.Scalajs_1.scalajsEnvSelenium
Deps.Scalajs_1.scalajsEnvSelenium,
Deps.Scalajs_1.scalajsImportMap
)
}
}
Expand Down
4 changes: 4 additions & 0 deletions contrib/docker/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ object docker extends DockerConfig {
def user = "new-user"
// Optionally override the docker executable to use something else
def executable = "podman"
// If the executable is docker (which is also the default), you can optionally also pass a platform parameter
// docker buildx is then used to build multi-platform images
def platform = "linux/arm64"
}
----


Run mill in interactive mode to see the docker client output, like `mill -i foo.docker.build`.
Loading

0 comments on commit 5813468

Please sign in to comment.