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

Add a MillBuildModule and improve BSP for build.sc #1972

Closed
wants to merge 18 commits into from
Closed
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
5 changes: 2 additions & 3 deletions bsp/src/mill/bsp/MillBuildServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,7 @@ class MillBuildServer(
}
case (id, module: JavaModule) =>
T.task {
val items = module.sources().map(p => sourceItem(p.path, false)) ++
module.generatedSources().map(p => sourceItem(p.path, true))
val items = module.allSources().map(p => sourceItem(p.path, false))
new SourcesItem(id, items.asJava)
}
}
Expand Down Expand Up @@ -638,7 +637,7 @@ class MillBuildServer(
case ((msg, cleaned), targetId) =>
val module = bspModulesById(targetId)
val mainModule = new MainModule {
override implicit def millDiscover: Discover[_] = Discover[this.type]
override implicit def millDiscover: Discover[this.type] = Discover[this.type]
}
val compileTargetName = (module.millModuleSegments ++ Segments(Label("compile"))).render
log.debug(s"about to clean: ${compileTargetName}")
Expand Down
13 changes: 11 additions & 2 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ object Deps {
val sourcecode = ivy"com.lihaoyi::sourcecode:0.3.0"
val upickle = ivy"com.lihaoyi::upickle:2.0.0"
val utest = ivy"com.lihaoyi::utest:0.7.11"
val usingDirectives = ivy"org.virtuslab:using_directives:0.0.10"
val windowsAnsi = ivy"io.github.alexarchambault.windows-ansi:windows-ansi:0.0.4"
val zinc = ivy"org.scala-sbt::zinc:1.8.0"
val bsp = ivy"ch.epfl.scala:bsp4j:2.1.0-M3"
Expand Down Expand Up @@ -338,8 +339,7 @@ trait MillModule extends MillApiModule with MillAutoTestSetup with WithMillCompi
with AcyclicConfig

object main extends MillModule {

override def moduleDeps = Seq(core, client)
override def moduleDeps = Seq(buildfile, core, client)
override def ivyDeps = Agg(
Deps.windowsAnsi
)
Expand All @@ -350,6 +350,15 @@ object main extends MillModule {
"-DMILL_VERSION=" + publishVersion()
)

object buildfile extends MillInternalModule {
override def moduleDeps = Seq(main.api)
override def ivyDeps = Agg(
Deps.osLib,
Deps.usingDirectives,
Deps.upickle
)
}

object api extends MillApiModule {
override def ivyDeps = Agg(
Deps.osLib,
Expand Down
1 change: 1 addition & 0 deletions integration/forked-server/src/forked-server-tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package forked.server
object DocAnnotationsTests extends DocAnnotationsTests(fork = true, clientServer = true)
object HygieneTests extends HygieneTests(fork = true, clientServer = true)
object LargeProjectTests extends LargeProjectTests(fork = true, clientServer = true)
object MillBuildModuleTests extends MillBuildModuleTests(fork = true, clientServer = true)
object MillJvmOptsTests extends MillJvmOptsTests(fork = true, clientServer = true)
object ScriptsInvalidationTests extends ScriptsInvalidationTests(fork = true, clientServer = true)
object ScriptsInvalidationForeignTests
Expand Down
1 change: 1 addition & 0 deletions integration/forked/src/forked-tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package forked
object DocAnnotationsTests extends DocAnnotationsTests(fork = true, clientServer = false)
object HygieneTests extends HygieneTests(fork = true, clientServer = false)
object LargeProjectTests extends LargeProjectTests(fork = true, clientServer = false)
object MillBuildModuleTests extends MillBuildModuleTests(fork = true, clientServer = false)
object MillJvmOptsTests extends MillJvmOptsTests(fork = true, clientServer = false)
object ScriptsInvalidationTests extends ScriptsInvalidationTests(fork = true, clientServer = false)
object ScriptsInvalidationForeignTests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.10.7
Loading