Skip to content

Commit 92b9610

Browse files
committed
Put linker interface in its own project
1 parent 403ddf3 commit 92b9610

26 files changed

+52
-11
lines changed

Jenkinsfile

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,20 +308,22 @@ def Tasks = [
308308
'set scalaJSStage in testSuite := FastOptStage' \
309309
++$scala testSuite/bootstrap:test &&
310310
sbt ++$scala irJS/mimaReportBinaryIssues \
311-
loggingJS/mimaReportBinaryIssues linkerJS/mimaReportBinaryIssues
311+
loggingJS/mimaReportBinaryIssues \
312+
linkerInterfaceJS/mimaReportBinaryIssues linkerJS/mimaReportBinaryIssues
312313
''',
313314

314315
"tools": '''
315316
setJavaVersion $java
316317
npm install &&
317-
sbt ++$scala ir/test logging/compile linker/compile \
318-
jsEnvs/test nodeJSEnv/test testAdapter/test \
319-
ir/mimaReportBinaryIssues \
320-
logging/mimaReportBinaryIssues linker/mimaReportBinaryIssues \
318+
sbt ++$scala ir/test logging/compile linkerInterface/compile \
319+
linker/compile jsEnvs/test nodeJSEnv/test testAdapter/test \
320+
ir/mimaReportBinaryIssues logging/mimaReportBinaryIssues \
321+
linkerInterface/mimaReportBinaryIssues linker/mimaReportBinaryIssues \
321322
jsEnvs/mimaReportBinaryIssues jsEnvsTestKit/mimaReportBinaryIssues \
322323
nodeJSEnv/mimaReportBinaryIssues \
323324
testAdapter/mimaReportBinaryIssues &&
324325
sbt ++$scala ir/compile:doc logging/compile:doc \
326+
linkerInterface/compile:doc \
325327
linker/compile:doc jsEnvs/compile:doc \
326328
jsEnvsTestKit/compile:doc nodeJSEnv/compile:doc \
327329
testAdapter/compile:doc
@@ -330,11 +332,11 @@ def Tasks = [
330332
"tools-sbtplugin": '''
331333
setJavaVersion $java
332334
npm install &&
333-
sbt ++$scala ir/test logging/compile linker/compile \
334-
jsEnvs/test nodeJSEnv/test testAdapter/test \
335+
sbt ++$scala ir/test logging/compile linkerInterface/compile \
336+
linker/compile jsEnvs/test nodeJSEnv/test testAdapter/test \
335337
sbtPlugin/package \
336-
ir/mimaReportBinaryIssues \
337-
logging/mimaReportBinaryIssues linker/mimaReportBinaryIssues \
338+
ir/mimaReportBinaryIssues logging/mimaReportBinaryIssues \
339+
linkerInterface/mimaReportBinaryIssues linker/mimaReportBinaryIssues \
338340
jsEnvs/mimaReportBinaryIssues jsEnvsTestKit/mimaReportBinaryIssues \
339341
nodeJSEnv/mimaReportBinaryIssues \
340342
testAdapter/mimaReportBinaryIssues \
@@ -343,6 +345,8 @@ def Tasks = [
343345
ir/scalastyle compiler/scalastyle \
344346
compiler/test:scalastyle \
345347
logging/scalastyle logging/test:scalastyle \
348+
linkerInterface/scalastyle \
349+
linkerInterface/scalastyle \
346350
linker/scalastyle linker/test:scalastyle \
347351
jsEnvs/scalastyle jsEnvsTestKit/scalastyle nodeJSEnv/scalastyle \
348352
jsEnvs/test:scalastyle nodeJSEnv/test:scalastyle testAdapter/scalastyle \
@@ -356,6 +360,7 @@ def Tasks = [
356360
jUnitTestOutputsJVM/scalastyle jUnitTestOutputsJVM/test:scalastyle \
357361
jUnitTestOutputsJS/scalastyle jUnitTestOutputsJS/test:scalastyle &&
358362
sbt ++$scala ir/compile:doc logging/compile:doc \
363+
linkerInterface/compile:doc \
359364
linker/compile:doc jsEnvs/compile:doc \
360365
jsEnvsTestKit/compile:doc nodeJSEnv/compile:doc \
361366
testAdapter/compile:doc \
@@ -378,6 +383,7 @@ def Tasks = [
378383
jUnitPlugin/publishLocal jUnitRuntime/publishLocal &&
379384
sbt ++$toolsscala \
380385
ir/publishLocal logging/publishLocal \
386+
linkerInterface/publishLocal \
381387
linker/publishLocal jsEnvs/publishLocal \
382388
nodeJSEnv/publishLocal testAdapter/publishLocal \
383389
sbtPlugin/publishLocal &&

build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ val irJS = Build.irProjectJS
66
val compiler = Build.compiler
77
val logging = Build.logging
88
val loggingJS = Build.loggingJS
9+
val linkerInterface = Build.linkerInterface
10+
val linkerInterfaceJS = Build.linkerInterfaceJS
911
val linker = Build.linker
1012
val linkerJS = Build.linkerJS
1113
val jsEnvs = Build.jsEnvs

project/BinaryIncompatibilities.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ object BinaryIncompatibilities {
1313
val Linker = Seq(
1414
)
1515

16+
val LinkerInterface = Seq(
17+
)
18+
1619
val JSEnvs = Seq(
1720
)
1821

project/Build.scala

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,34 @@ object Build {
658658
library
659659
)
660660

661+
val commonLinkerInterfaceSettings = Def.settings(
662+
commonSettings,
663+
publishSettings,
664+
fatalWarningsSettings,
665+
name := "Scala.js linker interface",
666+
667+
unmanagedSourceDirectories in Compile +=
668+
baseDirectory.value.getParentFile / "shared/src/main/scala",
669+
unmanagedSourceDirectories in Test +=
670+
baseDirectory.value.getParentFile / "shared/src/test/scala",
671+
672+
previousArtifactSetting,
673+
mimaBinaryIssueFilters ++= BinaryIncompatibilities.LinkerInterface,
674+
exportJars := true, // required so ScalaDoc linking works
675+
676+
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a")
677+
)
678+
679+
lazy val linkerInterface: Project = (project in file("linker-interface/jvm")).settings(
680+
commonLinkerInterfaceSettings,
681+
).dependsOn(irProject, logging)
682+
683+
lazy val linkerInterfaceJS: Project = (project in file("linker-interface/js")).settings(
684+
commonLinkerInterfaceSettings,
685+
).withScalaJSCompiler.dependsOn(
686+
library, irProjectJS, loggingJS,
687+
)
688+
661689
val commonLinkerSettings = Def.settings(
662690
commonSettings,
663691
publishSettings,
@@ -698,7 +726,7 @@ object Build {
698726
parallelCollectionsDependencies(scalaVersion.value)
699727
),
700728
fork in Test := true
701-
).dependsOn(irProject, logging, jUnitAsyncJVM % "test")
729+
).dependsOn(linkerInterface, irProject, logging, jUnitAsyncJVM % "test")
702730

703731
lazy val linkerJS: Project = (project in file("linker/js")).enablePlugins(
704732
MyScalaJSPlugin
@@ -707,7 +735,7 @@ object Build {
707735
crossVersion := ScalaJSCrossVersion.binary,
708736
scalaJSLinkerConfig in Test ~= (_.withModuleKind(ModuleKind.CommonJSModule))
709737
).withScalaJSCompiler.withScalaJSJUnitPlugin.dependsOn(
710-
library, irProjectJS, loggingJS, jUnitRuntime % "test", testBridge % "test", jUnitAsyncJS % "test"
738+
linkerInterfaceJS, library, irProjectJS, loggingJS, jUnitRuntime % "test", testBridge % "test", jUnitAsyncJS % "test"
711739
)
712740

713741
lazy val jsEnvs: Project = (project in file("js-envs")).settings(

project/build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ unmanagedSourceDirectories in Compile ++= {
1818
root / "ir/src/main/scala",
1919
root / "logging/shared/src/main/scala",
2020
root / "logging/jvm/src/main/scala",
21+
root / "linker-interface/shared/src/main/scala",
22+
root / "linker-interface/jvm/src/main/scala",
2123
root / "linker/shared/src/main/scala",
2224
root / "linker/jvm/src/main/scala",
2325
root / "js-envs/src/main/scala",

0 commit comments

Comments
 (0)