Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/check-cross-version-deps.sc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ val modules =

for { module <- modules } {
println(s"Checking for $module...")
val depRegex = "\\[\\d+]\\s+[│└├─\\S\\s]+\\s([\\w.-]+):([\\w.-]+):([\\w\\s\\S.-]+)".r
val depRegex = "[│└├─\\S\\s]+\\s([\\w.-]+):([\\w.-]+):([\\w\\s\\S.-]+)".r
val scalaDepSuffixRegex = "^(.+?)(_[23](?:\\.\\d{2})?)?$".r
val deps = os.proc(os.pwd / "mill", "-i", s"$module.ivyDepsTree")
val deps = os.proc(os.pwd / "mill", "-i", s"$module.showMvnDepsTree")
.call(cwd = os.pwd)
.out
.lines()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ jobs:
- name: Check native-image config format
run: ./mill -i __.checkNativeImageConfFormat
- name: Check Ammonite availability
run: ./mill -i 'dummy.amm[_].resolvedRunIvyDeps'
run: ./mill -i 'dummy.amm[_].resolvedRunMvnDeps'
- name: Check for cross Scala version conflicts
run: .github/scripts/check-cross-version-deps.sc
- name: Scalafix check
Expand Down
2 changes: 1 addition & 1 deletion .mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.15
1.0.4
454 changes: 235 additions & 219 deletions build.mill.scala

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mill
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"

if [[ $IS_WINDOWS ]]; then
exec "$DIR/millw" "$@"
exec "$DIR/mill.bat" "$@"
else
exec "$DIR/millw" $COMMAND
fi
2 changes: 1 addition & 1 deletion mill.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rem setlocal seems to be unavailable on Windows 95/98/ME
rem but I don't think we need to support them in 2019
setlocal enabledelayedexpansion

if [!DEFAULT_MILL_VERSION!]==[] ( set "DEFAULT_MILL_VERSION=0.12.15" )
if [!DEFAULT_MILL_VERSION!]==[] ( set "DEFAULT_MILL_VERSION=1.0.4" )

if [!MILL_GITHUB_RELEASE_CDN!]==[] ( set "MILL_GITHUB_RELEASE_CDN=" )

Expand Down
2 changes: 1 addition & 1 deletion millw
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if [ "$1" = "--setup-completions" ] ; then
fi

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


Expand Down
8 changes: 5 additions & 3 deletions project/deps/package.mill.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package build.project.deps
import mill._
import scalalib._

import mill.*
import mill.api.BuildInfo
import scalalib.*

object Cli {
def runnerLegacyVersion = "1.7.1" // last runner version to support pre-LTS Scala 3 versions
Expand Down Expand Up @@ -99,7 +101,7 @@ object TestDeps {

object InternalDeps {
object Versions {
def mill: String = _root_.mill.main.BuildInfo.millVersion
def mill: String = BuildInfo.millVersion
def lefouMillwRef = "166bcdf5741de8569e0630e18c3b2ef7e252cd96"
}
}
Expand Down
45 changes: 25 additions & 20 deletions project/publish/package.mill.scala
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package build.project.publish
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
import $ivy.`org.eclipse.jgit:org.eclipse.jgit:6.8.0.202311291450-r`

import build.project.settings
import com.lumidion.sonatype.central.client.core.{PublishingType, SonatypeCredentials}
import settings.{PublishLocalNoFluff, workspaceDirName}
import de.tobiasroeser.mill.vcs.version._
import mill._
import mill.*
import mill.javalib.publish.Artifact
import scalalib._
import mill.util.{Tasks, VcsVersion}
import scalalib.*
import org.eclipse.jgit.api.Git
import mill.api.{BuildCtx, ModuleCtx, Task}

import java.nio.charset.Charset
import scala.concurrent.duration._
import scala.jdk.CollectionConverters._
import scala.concurrent.duration.*
import scala.jdk.CollectionConverters.*

lazy val (ghOrg: String, ghName: String) = {
def gh: (ghOrg: String, ghName: String) = {
def default = ("VirtusLab", "scala-cli")
val isCI = System.getenv("CI") != null
if (isCI) {
Expand Down Expand Up @@ -62,7 +62,9 @@ lazy val (ghOrg: String, ghName: String) = {
default
}

private def computePublishVersion(state: VcsState, simple: Boolean): String =
lazy val (ghOrg: String, ghName: String) = gh

private def computePublishVersion(state: VcsVersion.State, simple: Boolean): String =
if (state.commitsSinceLastTag > 0)
if (simple) {
val versionOrEmpty = state.lastTag
Expand Down Expand Up @@ -141,15 +143,18 @@ trait ScalaCliPublishModule extends SonatypeCentralPublishModule with PublishLoc
)
override def publishVersion: T[String] = finalPublishVersion()
override def sourceJar: T[PathRef] = Task {
import mill.util.Jvm.createJar
val allSources0 = allSources().map(_.path).filter(os.exists).toSet
createJar(
allSources0 ++ resources().map(_.path).filter(os.exists),
manifest(),
(input, relPath) =>
!allSources0(input) ||
(!relPath.segments.contains(".scala") && !relPath.segments.contains(workspaceDirName))
)
PathRef {
import mill.util.Jvm.createJar
val allSources0 = allSources().map(_.path).filter(os.exists)
createJar(
jar = Task.dest / "out.jar",
inputPaths = allSources0 ++ resources().map(_.path).filter(os.exists),
manifest = manifest(),
fileFilter = (input, relPath) =>
!allSources0.toSet(input) ||
(!relPath.segments.contains(".scala") && !relPath.segments.contains(workspaceDirName))
)
}
}
}

Expand Down Expand Up @@ -211,7 +216,7 @@ def publishSonatype(
publisher.publishAll(
publishingType = publishingType,
singleBundleName = finalBundleName,
artifacts = artifacts: _*
artifacts = artifacts*
)
}

Expand All @@ -235,7 +240,7 @@ def setShouldPublish() = Task.Command {
val charSet = Charset.defaultCharset()
val nl = System.lineSeparator()
os.write.append(
os.Path(envFile, Task.workspace),
os.Path(envFile, BuildCtx.workspaceRoot),
s"SHOULD_PUBLISH=${shouldPublish()}$nl".getBytes(charSet)
)
}
Loading
Loading