Repository navigation
Expand file tree
/
Copy pathbuild.mill
More file actions
82 lines (75 loc) · 3.72 KB
/
Copy pathbuild.mill
File metadata and controls
82 lines (75 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package build
import mill.*, scalalib.*, publish.*
import mill.api.BuildCtx
object millbun extends ScalaModule, PublishModule {
// Compile target = the minimum Mill the plugin supports; Mill 1.x keeps plugin binary
// compatibility forwards, so the floor stays where it is while the suite below runs on
// the latest stable release.
def millVersion = "1.1.5"
// The integration fixtures run Mill in-process via mill-testkit, so THIS is the Mill the
// plugin is tested against (fixture `//| mill-version` headers are only read for the
// mismatch warning). Kept at the latest stable Mill; the plugin jar under test is still
// the one compiled against millVersion above, i.e. the real consumer shape.
def millTestkitVersion = "1.1.8"
// Must match the Scala that Mill 1.1.x compiles build files with (3.8.2): a plugin built
// with a newer Scala emits TASTy that consumers' Mill cannot read. Fixtures and examples
// are free to use newer Scala (they are on 3.9.0 LTS); this pin is not.
def scalaVersion = "3.8.2"
def jvmVersion = "25"
def platformSuffix = "_mill1"
def artifactName = "mill-bun"
def mvnDeps = Seq(
// mill-libs is Scala-cross-published but intentionally not Mill-platform-cross-published.
mvn"com.lihaoyi::mill-libs:$millVersion"
)
object test extends ScalaTests, TestModule.Utest {
def mvnDeps = Seq(
mvn"com.lihaoyi::utest:0.8.5"
)
}
object integration extends ScalaTests, TestModule.Utest {
def mvnDeps = Seq(
mvn"com.lihaoyi::mill-testkit:$millTestkitVersion",
mvn"com.lihaoyi::utest:0.8.5"
)
override def resources = Task.Sources()
def forkEnv = Task {
val millScript =
if (scala.util.Properties.isWin) BuildCtx.workspaceRoot / "mill.bat"
else BuildCtx.workspaceRoot / "mill"
// No ivy2Local in the fallback: a stale mill-bun jar in ~/.ivy2/local would silently
// shadow the freshly published test repo whenever the pinned version goes missing there.
val repos = Seq(publishLocalTestRepo().path.toNIO.toUri.toASCIIString) ++
Seq(Task.env.getOrElse("COURSIER_REPOSITORIES", "central"))
Map(
"MILL_EXECUTABLE_PATH" -> millScript.toString,
"COURSIER_REPOSITORIES" -> repos.mkString("|"),
// Default to the managed toolchain, so the suite exercises the same Bun the plugin
// pins rather than whatever the developer happens to have on PATH. The shared
// download cache means all fixtures reuse one archive. Export MILL_BUN_USE_SYSTEM=true
// to run against a local Bun instead.
"MILL_BUN_USE_SYSTEM" -> Task.env.getOrElse("MILL_BUN_USE_SYSTEM", "false")
// The lockfile requirement runs the SHIPPED default (strict): dependency-bearing
// fixtures commit a bun.lock, regenerated via mill.bun.RegenerateFixtureLocks, and
// fixtures that deliberately test the relaxed path opt out in their own build.mill.
)
}
}
// CI injects release versions via PUBLISH_VERSION; local builds stay on NIGHTLY.
// Task.Input, so switching PUBLISH_VERSION between runs re-evaluates instead of serving a
// stale cached version — a plain Task here silently kept the old value and poisoned
// publishLocalTestRepo until a manual clean.
def publishVersion: T[String] = Task.Input {
Task.env.getOrElse("PUBLISH_VERSION", "0.0.0-NIGHTLY")
}
def pomSettings = PomSettings(
description = "Bun-backed Mill plugin for Scala.js and TypeScript workflows",
organization = "com.tjclp",
url = "https://github.com/tjc-lp/mill-bun-plugin",
licenses = Seq(License.MIT),
versionControl = VersionControl.github("tjc-lp", "mill-bun-plugin"),
developers = Seq(
Developer("tjc-lp", "TJC-LP", "https://github.com/tjc-lp")
)
)
}