Skip to content

Commit 501d033

Browse files
committed
WIP
1 parent 02b3cb8 commit 501d033

File tree

2 files changed

+87
-79
lines changed

2 files changed

+87
-79
lines changed

build.mill.scala

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -931,10 +931,10 @@ trait Cli extends CrossSbtModule with ProtoBuildModule with CliLaunchers
931931
override def mainClass: T[Option[String]] = Some("scala.cli.ScalaCli")
932932

933933
private def scala3GraalProcessorClassPath: T[Seq[PathRef]] = Task {
934-
resolveDeps(Task {
934+
defaultResolver().classpath {
935935
val bind = bindDependency()
936936
Seq(Deps.scala3GraalProcessor).map(bind)
937-
})()
937+
}
938938
}
939939

940940
override def nativeImageClassPath: T[Seq[PathRef]] = Task {
@@ -1217,47 +1217,47 @@ trait CliIntegration extends SbtModule
12171217
private def testArgs(args: Seq[String], launcher: os.Path, cliKind: String): Seq[String] =
12181218
extraTestArgs(launcher, cliKind) ++ debugTestArgs(args)
12191219

1220-
def jvm(args: String*): Command[(msg: String, results: Seq[TestResult])] = Task.Command {
1220+
def jvm(args: String*): Command[(msg: String, results: Seq[TestResult])] = Task.Command {
1221+
testTask(
1222+
Task.Anon(args ++ testArgs(args, Launchers.jvm().path, "jvm")),
1223+
Task.Anon(Seq.empty[String])
1224+
)()
1225+
}
1226+
1227+
def jvmBootstrapped(args: String*): Command[(msg: String, results: Seq[TestResult])] =
1228+
Task.Command {
12211229
testTask(
1222-
Task.Anon(args ++ testArgs(args, Launchers.jvm().path, "jvm")),
1230+
Task.Anon(args ++ testArgs(args, Launchers.jvmBootstrapped().path, "jvmBootstrapped")),
12231231
Task.Anon(Seq.empty[String])
12241232
)()
12251233
}
12261234

1227-
def jvmBootstrapped(args: String*): Command[(msg: String, results: Seq[TestResult])] =
1228-
Task.Command {
1229-
testTask(
1230-
Task.Anon(args ++ testArgs(args, Launchers.jvmBootstrapped().path, "jvmBootstrapped")),
1231-
Task.Anon(Seq.empty[String])
1232-
)()
1233-
}
1235+
def native(args: String*): Command[(msg: String, results: Seq[TestResult])] = Task.Command {
1236+
testTask(
1237+
Task.Anon(args ++ testArgs(args, Launchers.native().path, "native")),
1238+
Task.Anon(Seq.empty[String])
1239+
)()
1240+
}
12341241

1235-
def native(args: String*): Command[(msg: String, results: Seq[TestResult])] = Task.Command {
1242+
def nativeStatic(args: String*): Command[(msg: String, results: Seq[TestResult])] =
1243+
Task.Command {
12361244
testTask(
1237-
Task.Anon(args ++ testArgs(args, Launchers.native().path, "native")),
1245+
Task.Anon(args ++ testArgs(args, Launchers.nativeStatic().path, "native-static")),
12381246
Task.Anon(Seq.empty[String])
12391247
)()
12401248
}
12411249

1242-
def nativeStatic(args: String*): Command[(msg: String, results: Seq[TestResult])] =
1243-
Task.Command {
1244-
testTask(
1245-
Task.Anon(args ++ testArgs(args, Launchers.nativeStatic().path, "native-static")),
1246-
Task.Anon(Seq.empty[String])
1247-
)()
1248-
}
1249-
1250-
def nativeMostlyStatic(args: String*): Command[(msg: String, results: Seq[TestResult])] =
1251-
Task.Command {
1252-
testTask(
1253-
Task.Anon(args ++ testArgs(
1254-
args,
1255-
Launchers.nativeMostlyStatic().path,
1256-
"native-mostly-static"
1257-
)),
1258-
Task.Anon(Seq.empty[String])
1259-
)()
1260-
}
1250+
def nativeMostlyStatic(args: String*): Command[(msg: String, results: Seq[TestResult])] =
1251+
Task.Command {
1252+
testTask(
1253+
Task.Anon(args ++ testArgs(
1254+
args,
1255+
Launchers.nativeMostlyStatic().path,
1256+
"native-mostly-static"
1257+
)),
1258+
Task.Anon(Seq.empty[String])
1259+
)()
1260+
}
12611261
}
12621262
}
12631263

project/settings/package.mill.scala

Lines changed: 55 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -579,16 +579,22 @@ trait PublishLocalNoFluff extends SonatypeCentralPublishModule {
579579
))
580580
}
581581

582-
publisher.publishLocal(
583-
jar = jar().path,
584-
sourcesJar = emptyZip().path,
585-
docJar = emptyZip().path,
586-
pom = pom().path,
587-
ivy = Right(ivy().path),
588-
artifact = artifactMetadata(),
589-
publishInfos = Seq.empty
582+
val artifact = artifactMetadata()
583+
val jarPath = jar().path
584+
val pomPath = pom().path
585+
val ivyPath = ivy().path
586+
val emptyPath = emptyZip().path
587+
588+
val contents = Map[os.SubPath, Array[Byte]](
589+
os.sub / s"${artifact.id}-${artifact.version}.jar" -> os.read.bytes(jarPath),
590+
os.sub / s"${artifact.id}-${artifact.version}-sources.jar" -> os.read.bytes(emptyPath),
591+
os.sub / s"${artifact.id}-${artifact.version}-javadoc.jar" -> os.read.bytes(emptyPath),
592+
os.sub / s"${artifact.id}-${artifact.version}.pom" -> os.read.bytes(pomPath),
593+
os.sub / "ivy.xml" -> os.read.bytes(ivyPath)
590594
)
591595

596+
publisher.publishLocal(artifact, contents)
597+
592598
jar()
593599
}
594600
}
@@ -613,48 +619,50 @@ trait LocalRepo extends Module {
613619
VcsVersion.vcsState()
614620
}
615621
def localRepoZip: T[PathRef] = Task {
616-
val repoVer = vcsState().format()
617-
val ver = version()
618-
localRepo()
619-
val repoDir = BuildCtx.workspaceRoot / "out" / "repo" / ver
620-
val destDir = Task.dest / ver / "repo.zip"
621-
val dest = destDir / "repo.zip"
622-
623-
import java.io._
624-
import java.util.zip._
625-
os.makeDir.all(destDir)
626-
var fos: FileOutputStream = null
627-
var zos: ZipOutputStream = null
628-
try {
629-
fos = new FileOutputStream(dest.toIO)
630-
zos = new ZipOutputStream(new BufferedOutputStream(fos))
631-
632-
val versionEntry = new ZipEntry("version")
633-
versionEntry.setTime(0L)
634-
zos.putNextEntry(versionEntry)
635-
zos.write(repoVer.getBytes(StandardCharsets.UTF_8))
636-
zos.flush()
637-
638-
os.walk(repoDir).filter(_ != repoDir).foreach { p =>
639-
val isDir = os.isDir(p)
640-
val name = p.relativeTo(repoDir).toString + (if (isDir) "/" else "")
641-
val entry = new ZipEntry(name)
642-
entry.setTime(os.mtime(p))
643-
zos.putNextEntry(entry)
644-
if (!isDir) {
645-
zos.write(os.read.bytes(p))
646-
zos.flush()
622+
BuildCtx.withFilesystemCheckerDisabled {
623+
val repoVer = vcsState().format()
624+
val ver = version()
625+
localRepo()
626+
val repoDir = BuildCtx.workspaceRoot / "out" / "repo" / ver
627+
val destDir = Task.dest / ver / "repo.zip"
628+
val dest = destDir / "repo.zip"
629+
630+
import java.io._
631+
import java.util.zip._
632+
os.makeDir.all(destDir)
633+
var fos: FileOutputStream = null
634+
var zos: ZipOutputStream = null
635+
try {
636+
fos = new FileOutputStream(dest.toIO)
637+
zos = new ZipOutputStream(new BufferedOutputStream(fos))
638+
639+
val versionEntry = new ZipEntry("version")
640+
versionEntry.setTime(0L)
641+
zos.putNextEntry(versionEntry)
642+
zos.write(repoVer.getBytes(StandardCharsets.UTF_8))
643+
zos.flush()
644+
645+
os.walk(repoDir).filter(_ != repoDir).foreach { p =>
646+
val isDir = os.isDir(p)
647+
val name = p.relativeTo(repoDir).toString + (if (isDir) "/" else "")
648+
val entry = new ZipEntry(name)
649+
entry.setTime(os.mtime(p))
650+
zos.putNextEntry(entry)
651+
if (!isDir) {
652+
zos.write(os.read.bytes(p))
653+
zos.flush()
654+
}
655+
zos.closeEntry()
647656
}
648-
zos.closeEntry()
657+
zos.finish()
658+
}
659+
finally {
660+
if (zos != null) zos.close()
661+
if (fos != null) fos.close()
649662
}
650-
zos.finish()
651-
}
652-
finally {
653-
if (zos != null) zos.close()
654-
if (fos != null) fos.close()
655-
}
656663

657-
PathRef(dest)
664+
PathRef(dest)
665+
}
658666
}
659667

660668
def localRepoJar: T[PathRef] = Task {

0 commit comments

Comments
 (0)