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

Move BuildInfo from sources into resources, defer use of resources during compilation #2425

Merged
merged 41 commits into from
Apr 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
504d6ff
.
lihaoyi Apr 6, 2023
1075d7e
build.sc compiles
lihaoyi Apr 7, 2023
482b52f
move to resource based buildinfo
lihaoyi Apr 7, 2023
18a54a4
.
lihaoyi Apr 7, 2023
c9382e5
cleanup
lihaoyi Apr 7, 2023
9eef9c3
fix
lihaoyi Apr 7, 2023
028c779
.
lihaoyi Apr 7, 2023
cddc254
transitiveCompileClasspath should include compile.classes
lihaoyi Apr 7, 2023
0dc7664
wip replacing contribu/buildinfo with new implementation
lihaoyi Apr 7, 2023
80b8d0b
contrib.buildinfo.test passes
lihaoyi Apr 7, 2023
1a5bb75
fix build.sc
lihaoyi Apr 7, 2023
ac0e98e
.
lihaoyi Apr 7, 2023
f6e96b0
.
lihaoyi Apr 7, 2023
5050886
.
lihaoyi Apr 7, 2023
f490919
update patch bootstrap
lihaoyi Apr 7, 2023
196c320
add mill-contrib-buildinfo import to patch
lihaoyi Apr 7, 2023
e2625ce
scaladoc
lihaoyi Apr 7, 2023
e28d97f
fixcompile
lihaoyi Apr 7, 2023
fe6aef7
fix-compile
lihaoyi Apr 7, 2023
a622dca
.
lihaoyi Apr 7, 2023
6600186
fixbsp
lihaoyi Apr 7, 2023
f351a10
add import to patch
lihaoyi Apr 7, 2023
2c2590d
.
lihaoyi Apr 7, 2023
a5fabc3
fixpatch
lihaoyi Apr 7, 2023
a5f9e54
BuildInfo.Value
lihaoyi Apr 7, 2023
147942e
update patch
lihaoyi Apr 7, 2023
8af9b5d
fixbuild
lihaoyi Apr 7, 2023
6590af0
.
lihaoyi Apr 7, 2023
1455fcd
rename to BuildInfo.buildinfo.properties
lihaoyi Apr 8, 2023
d2ebf93
use relative getResourceAsStream
lihaoyi Apr 8, 2023
818f7fc
.
lihaoyi Apr 8, 2023
6aa9984
update build.sc buildinfo
lihaoyi Apr 8, 2023
e229fc9
update
lihaoyi Apr 8, 2023
235fc7f
remove-println
lihaoyi Apr 8, 2023
d50c0ed
fix-patch
lihaoyi Apr 8, 2023
1ae58e4
.
lihaoyi Apr 8, 2023
f725a38
debug
lihaoyi Apr 8, 2023
8ea492f
.
lihaoyi Apr 8, 2023
8d7f669
add publishLocal to make test-mill-dev pass
lihaoyi Apr 8, 2023
a6e2084
bump timeout for flaky test
lihaoyi Apr 8, 2023
f36c0b8
scalafmt
lihaoyi Apr 8, 2023
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
Prev Previous commit
Next Next commit
fixpatch
  • Loading branch information
lihaoyi committed Apr 7, 2023
commit a5fabc33eb57ad5739d252d6126b26c6500ce0f2
42 changes: 21 additions & 21 deletions ci/mill-bootstrap.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/build.sc b/build.sc
index 46f995a8e..fa704d988 100644
index 46f995a8e..96c777c30 100644
--- a/build.sc
+++ b/build.sc
@@ -2,22 +2,11 @@
@@ -2,22 +2,12 @@
import $file.ci.shared
import $file.ci.upload
import $ivy.`org.scalaj::scalaj-http:2.4.2`
Expand All @@ -11,7 +11,7 @@ index 46f995a8e..fa704d988 100644
import $ivy.`net.sourceforge.htmlcleaner:htmlcleaner:2.25`
+import $ivy.`com.lihaoyi::mill-contrib-buildinfo:$MILL_VERSION`
+import mill.contrib.buildinfo.BuildInfo

// imports
-import com.github.lolgab.mill.mima
-import com.github.lolgab.mill.mima.{
Expand All @@ -27,10 +27,10 @@ index 46f995a8e..fa704d988 100644
import mill._
import mill.define.{Command, Source, Sources, Target, Task}
import mill.eval.Evaluator
@@ -185,12 +174,8 @@ object Deps {
@@ -185,12 +175,8 @@ object Deps {
val requests = ivy"com.lihaoyi::requests:0.8.0"
}

-def millVersion: T[String] = T { VcsVersion.vcsState().format() }
-def millLastTag: T[String] = T {
- VcsVersion.vcsState().lastTag.getOrElse(
Expand All @@ -42,10 +42,10 @@ index 46f995a8e..fa704d988 100644
def millBinPlatform: T[String] = T {
val tag = millLastTag()
if (tag.contains("-M")) tag
@@ -201,176 +186,6 @@ def millBinPlatform: T[String] = T {
@@ -201,176 +187,6 @@ def millBinPlatform: T[String] = T {
}
def baseDir = build.millSourcePath

-
-trait BuildInfo extends JavaModule {
- def buildInfoPackageName: String
Expand Down Expand Up @@ -219,10 +219,10 @@ index 46f995a8e..fa704d988 100644
trait MillPublishModule extends PublishModule {
override def artifactName = "mill-" + super.artifactName()
def publishVersion = millVersion()
@@ -420,27 +235,8 @@ trait MillCoursierModule extends CoursierModule {
@@ -420,27 +236,8 @@ trait MillCoursierModule extends CoursierModule {
)
}

-trait MillMimaConfig extends mima.Mima {
+trait MillMimaConfig extends Module {
def skipPreviousVersions: T[Seq[String]] = T(Seq.empty[String])
Expand All @@ -246,43 +246,43 @@ index 46f995a8e..fa704d988 100644
- }
- lazy val issueFilterByModule: Map[MillMimaConfig, Seq[ProblemFilter]] = Map()
}

/** A Module compiled with applied Mill-specific compiler plugins: mill-moduledefs. */
@@ -729,6 +525,7 @@ object scalajslib extends MillModule with BuildInfo{
@@ -729,6 +526,7 @@ object scalajslib extends MillModule with BuildInfo{
}
object worker extends Cross[WorkerModule]("1")
class WorkerModule(scalajsWorkerVersion: String) extends MillInternalModule {
+ override def millSourcePath: os.Path = super.millSourcePath / scalajsWorkerVersion
override def moduleDeps = Seq(scalajslib.`worker-api`)
override def ivyDeps = Agg(
Deps.Scalajs_1.scalajsLinker,
@@ -791,6 +588,7 @@ object contrib extends MillModule {

@@ -791,6 +589,7 @@ object contrib extends MillModule {
object worker extends Cross[WorkerModule](Deps.play.keys.toSeq: _*)
class WorkerModule(playBinary: String) extends MillInternalModule {
+ override def millSourcePath: os.Path = super.millSourcePath / playBinary
override def sources = T.sources {
// We want to avoid duplicating code as long as the Play APIs allow.
// But if newer Play versions introduce incompatibilities,
@@ -982,6 +780,7 @@ object scalanativelib extends MillModule {
@@ -982,6 +781,7 @@ object scalanativelib extends MillModule {
object worker extends Cross[WorkerModule]("0.4")
class WorkerModule(scalaNativeWorkerVersion: String)
extends MillInternalModule {
+ override def millSourcePath: os.Path = super.millSourcePath / scalaNativeWorkerVersion
override def moduleDeps = Seq(scalanativelib.`worker-api`)
override def ivyDeps = scalaNativeWorkerVersion match {
case "0.4" =>
@@ -1142,6 +941,7 @@ trait IntegrationTestModule extends MillScalaModule {
@@ -1142,6 +942,7 @@ trait IntegrationTestModule extends MillScalaModule {
}

trait IntegrationTestCrossModule extends IntegrationTestModule {
+ override def millSourcePath = super.millSourcePath / repoSlug
object local extends ModeModule
object fork extends ModeModule
object server extends ModeModule
@@ -1696,53 +1496,7 @@ def launcher = T {


@@ -1696,53 +1497,7 @@ def launcher = T {
def uploadToGithub(authKey: String) = T.command {
- val vcsState = VcsVersion.vcsState()
- val label = vcsState.format()
Expand Down Expand Up @@ -333,5 +333,5 @@ index 46f995a8e..fa704d988 100644
- }
+ // never upload a bootstrapped version
}

def validate(ev: Evaluator): Command[Unit] = T.command {
def validate(ev: Evaluator): Command[Unit] = T.command {