Skip to content

Commit

Permalink
Add multi-module BSP tests (#4262)
Browse files Browse the repository at this point in the history
This PR adds multi-module non-regression tests of the BSP support. This
is helpful for #4145, that
touches some BSP things in `MillBuildServer`.

Pull request: #4262
  • Loading branch information
alexarchambault authored Jan 8, 2025
1 parent 933e60b commit c9e0b69
Show file tree
Hide file tree
Showing 12 changed files with 328 additions and 0 deletions.
26 changes: 26 additions & 0 deletions integration/ide/bsp-server/resources/project/build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,38 @@ package build

import mill._

// testing a simple Java module
object `hello-java` extends scalalib.JavaModule

// testing a simple Scala module
object `hello-scala` extends scalalib.ScalaModule {
def scalaVersion = Option(System.getenv("TEST_SCALA_2_13_VERSION")).getOrElse(???)
}

// testing a simple Kotlin module
object `hello-kotlin` extends kotlinlib.KotlinModule {
def kotlinVersion = Option(System.getenv("TEST_KOTLIN_VERSION")).getOrElse(???)
}

// testing a two-module setup, with one module depending on the other,
// involving ivyDeps, but also compile-time only and runtime only dependencies
object lib extends scalalib.JavaModule {
import scalalib._
def compileIvyDeps = Agg(
ivy"junit:junit:4.13.2"
)
def ivyDeps = Agg(
ivy"org.slf4j:slf4j-api:2.0.16"
)
}

object app extends scalalib.JavaModule {
import scalalib._
def moduleDeps = Seq(lib)
def ivyDeps = Agg(
ivy"ch.qos.logback:logback-core:1.5.15"
)
def runIvyDeps = Agg(
ivy"com.mysql:mysql-connector-j:9.1.0"
)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
{
"items": [
{
"target": {
"uri": "file:///workspace/app"
},
"classpath": [
"file:///coursier-cache/https/repo1.maven.org/maven2/ch/qos/logback/logback-core/1.5.15/logback-core-1.5.15.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar",
"file:///workspace/lib/compile-resources",
"file:///workspace/out/lib/compile.dest/classes",
"file:///workspace/app/compile-resources"
]
},
{
"target": {
"uri": "file:///workspace/lib"
},
"classpath": [
"file:///coursier-cache/https/repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar",
"file:///workspace/lib/compile-resources"
]
},
{
"target": {
"uri": "file:///workspace/hello-java"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
{
"items": [
{
"target": {
"uri": "file:///workspace/app"
},
"modules": [
{
"name": "ch.qos.logback:logback-core",
"version": "1.5.15"
},
{
"name": "org.slf4j:slf4j-api",
"version": "2.0.16"
}
]
},
{
"target": {
"uri": "file:///workspace/lib"
},
"modules": [
{
"name": "junit:junit",
"version": "4.13.2"
},
{
"name": "org.slf4j:slf4j-api",
"version": "2.0.16"
}
]
},
{
"target": {
"uri": "file:///workspace/hello-java"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
{
"items": [
{
"target": {
"uri": "file:///workspace/app"
},
"sources": [
"file:///coursier-cache/https/repo1.maven.org/maven2/ch/qos/logback/logback-core/1.5.15/logback-core-1.5.15-sources.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16-sources.jar"
]
},
{
"target": {
"uri": "file:///workspace/lib"
},
"sources": [
"file:///coursier-cache/https/repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2-sources.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16-sources.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar"
]
},
{
"target": {
"uri": "file:///workspace/hello-java"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
{
"items": [
{
"target": {
"uri": "file:///workspace/app"
},
"options": [],
"classpath": [
"file:///coursier-cache/https/repo1.maven.org/maven2/ch/qos/logback/logback-core/1.5.15/logback-core-1.5.15.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar",
"file:///workspace/lib/compile-resources",
"file:///workspace/out/lib/compile.dest/classes",
"file:///workspace/app/compile-resources"
],
"classDirectory": "file:///workspace/out/app/compile.dest/classes"
},
{
"target": {
"uri": "file:///workspace/lib"
},
"options": [],
"classpath": [
"file:///coursier-cache/https/repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar",
"file:///workspace/lib/compile-resources"
],
"classDirectory": "file:///workspace/out/lib/compile.dest/classes"
},
{
"target": {
"uri": "file:///workspace/hello-java"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
{
"items": [
{
"target": {
"uri": "file:///workspace/app"
},
"classpath": [
"file:///coursier-cache/https/repo1.maven.org/maven2/com/mysql/mysql-connector-j/9.1.0/mysql-connector-j-9.1.0.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/ch/qos/logback/logback-core/1.5.15/logback-core-1.5.15.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/4.26.1/protobuf-java-4.26.1.jar",
"file:///workspace/lib/compile-resources",
"file:///workspace/lib/resources",
"file:///workspace/out/lib/compile.dest/classes",
"file:///workspace/app/compile-resources",
"file:///workspace/app/resources",
"file:///workspace/out/app/compile.dest/classes"
],
"jvmOptions": [],
"workingDirectory": "/workspace",
"environmentVariables": {},
"mainClasses": []
},
{
"target": {
"uri": "file:///workspace/lib"
},
"classpath": [
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar",
"file:///workspace/lib/compile-resources",
"file:///workspace/lib/resources",
"file:///workspace/out/lib/compile.dest/classes"
],
"jvmOptions": [],
"workingDirectory": "/workspace",
"environmentVariables": {},
"mainClasses": []
},
{
"target": {
"uri": "file:///workspace/hello-java"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
{
"items": [
{
"target": {
"uri": "file:///workspace/app"
},
"classpath": [
"file:///coursier-cache/https/repo1.maven.org/maven2/com/mysql/mysql-connector-j/9.1.0/mysql-connector-j-9.1.0.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/ch/qos/logback/logback-core/1.5.15/logback-core-1.5.15.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/com/google/protobuf/protobuf-java/4.26.1/protobuf-java-4.26.1.jar",
"file:///workspace/lib/compile-resources",
"file:///workspace/lib/resources",
"file:///workspace/out/lib/compile.dest/classes",
"file:///workspace/app/compile-resources",
"file:///workspace/app/resources",
"file:///workspace/out/app/compile.dest/classes"
],
"jvmOptions": [],
"workingDirectory": "/workspace",
"environmentVariables": {},
"mainClasses": []
},
{
"target": {
"uri": "file:///workspace/lib"
},
"classpath": [
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar",
"file:///workspace/lib/compile-resources",
"file:///workspace/lib/resources",
"file:///workspace/out/lib/compile.dest/classes"
],
"jvmOptions": [],
"workingDirectory": "/workspace",
"environmentVariables": {},
"mainClasses": []
},
{
"target": {
"uri": "file:///workspace/hello-java"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"items": [
{
"target": {
"uri": "file:///workspace/app"
},
"outputPaths": []
},
{
"target": {
"uri": "file:///workspace/lib"
},
"outputPaths": []
},
{
"target": {
"uri": "file:///workspace/hello-java"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"items": [
{
"target": {
"uri": "file:///workspace/app"
},
"resources": []
},
{
"target": {
"uri": "file:///workspace/lib"
},
"resources": []
},
{
"target": {
"uri": "file:///workspace/hello-java"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
{
"items": [
{
"target": {
"uri": "file:///workspace/app"
},
"options": [],
"classpath": [
"file:///coursier-cache/https/repo1.maven.org/maven2/ch/qos/logback/logback-core/1.5.15/logback-core-1.5.15.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar",
"file:///workspace/lib/compile-resources",
"file:///workspace/out/lib/compile.dest/classes",
"file:///workspace/app/compile-resources"
],
"classDirectory": "file:///workspace/out/app/compile.dest/classes"
},
{
"target": {
"uri": "file:///workspace/lib"
},
"options": [],
"classpath": [
"file:///coursier-cache/https/repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar",
"file:///coursier-cache/https/repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar",
"file:///workspace/lib/compile-resources"
],
"classDirectory": "file:///workspace/out/lib/compile.dest/classes"
},
{
"target": {
"uri": "file:///workspace/hello-java"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
{
"items": [
{
"target": {
"uri": "file:///workspace/app"
},
"sources": [
{
"uri": "file:///workspace/app/src",
"kind": 2,
"generated": false
}
]
},
{
"target": {
"uri": "file:///workspace/lib"
},
"sources": [
{
"uri": "file:///workspace/lib/src",
"kind": 2,
"generated": false
}
]
},
{
"target": {
"uri": "file:///workspace/hello-java"
Expand Down
Loading

0 comments on commit c9e0b69

Please sign in to comment.