Skip to content

Commit

Permalink
Fix #3450: Remove the stubs library.
Browse files Browse the repository at this point in the history
It has been moved to the separate repository at
https://github.com/scala-js/scala-js-stubs.
  • Loading branch information
sjrd committed Sep 6, 2018
1 parent 3474756 commit 5a54514
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 60 deletions.
2 changes: 1 addition & 1 deletion DEVELOPING.md
Expand Up @@ -175,6 +175,6 @@ following incantations.
`SCALA_VERSION` refers to the Scala version used by the separate project.

> ++SCALA_VERSION
> ;compiler/publishLocal;library/publishLocal;testInterface/publishLocal;stubs/publishLocal;jUnitRuntime/publishLocal;jUnitPlugin/publishLocal
> ;compiler/publishLocal;library/publishLocal;testInterface/publishLocal;jUnitRuntime/publishLocal;jUnitPlugin/publishLocal
> ++2.10.7
> ;ir/publishLocal;io/publishLocal;logging/publishLocal;linker/publishLocal;jsEnvs/publishLocal;jsEnvsTestKit/publishLocal;nodeJSEnv/publishLocal;testAdapter/publishLocal;sbtPlugin/publishLocal
24 changes: 11 additions & 13 deletions Jenkinsfile
Expand Up @@ -265,35 +265,33 @@ def Tasks = [
loggingJS/mimaReportBinaryIssues linkerJS/mimaReportBinaryIssues
''',

"tools-stubs": '''
"tools": '''
setJavaVersion $java
npm install &&
sbt ++$scala ir/test io/test logging/compile linker/compile \
stubs/package jsEnvs/test nodeJSEnv/test testAdapter/test \
jsEnvs/test nodeJSEnv/test testAdapter/test \
ir/mimaReportBinaryIssues io/mimaReportBinaryIssues \
logging/mimaReportBinaryIssues linker/mimaReportBinaryIssues \
jsEnvs/mimaReportBinaryIssues jsEnvsTestKit/mimaReportBinaryIssues \
nodeJSEnv/mimaReportBinaryIssues \
testAdapter/mimaReportBinaryIssues \
stubs/mimaReportBinaryIssues &&
testAdapter/mimaReportBinaryIssues &&
sbt ++$scala ir/compile:doc io/compile:doc logging/compile:doc \
linker/compile:doc jsEnvs/compile:doc \
jsEnvsTestKit/compile:doc nodeJSEnv/compile:doc \
testAdapter/compile:doc stubs/compile:doc
testAdapter/compile:doc
''',

"tools-stubs-sbtplugin": '''
"tools-sbtplugin": '''
setJavaVersion $java
npm install &&
sbt ++$scala ir/test io/test logging/compile linker/compile \
stubs/package jsEnvs/test nodeJSEnv/test testAdapter/test \
jsEnvs/test nodeJSEnv/test testAdapter/test \
sbtPlugin/package \
ir/mimaReportBinaryIssues io/mimaReportBinaryIssues \
logging/mimaReportBinaryIssues linker/mimaReportBinaryIssues \
jsEnvs/mimaReportBinaryIssues jsEnvsTestKit/mimaReportBinaryIssues \
nodeJSEnv/mimaReportBinaryIssues \
testAdapter/mimaReportBinaryIssues \
stubs/mimaReportBinaryIssues \
sbtPlugin/mimaReportBinaryIssues &&
sbt ++$scala library/scalastyle javalanglib/scalastyle javalib/scalastyle \
ir/scalastyle compiler/scalastyle \
Expand All @@ -314,7 +312,7 @@ def Tasks = [
sbt ++$scala ir/compile:doc io/compile:doc logging/compile:doc \
linker/compile:doc jsEnvs/compile:doc \
jsEnvsTestKit/compile:doc nodeJSEnv/compile:doc \
testAdapter/compile:doc stubs/compile:doc \
testAdapter/compile:doc \
sbtPlugin/compile:doc
''',

Expand All @@ -331,7 +329,7 @@ def Tasks = [
# Then go into standalone project and test
npm install &&
sbt ++2.11.12 compiler/publishLocal library/publishLocal \
testInterface/publishLocal stubs/publishLocal \
testInterface/publishLocal \
jUnitPlugin/publishLocal jUnitRuntime/publishLocal &&
sbt ++$toolsscala ${SBT_VER_OVERRIDE:+^^$SBT_VER_OVERRIDE} \
ir/publishLocal io/publishLocal logging/publishLocal \
Expand Down Expand Up @@ -416,9 +414,9 @@ limitedCIScalaVersions.each { scalaVersion ->
quickMatrix.add([task: "test-suite-ecma-script6", scala: scalaVersion, java: mainJavaVersion, testSuite: "testSuite"])
}
allJavaVersions.each { javaVersion ->
quickMatrix.add([task: "tools-stubs-sbtplugin", scala: "2.10.7", java: javaVersion])
quickMatrix.add([task: "tools-stubs", scala: "2.11.12", java: javaVersion])
quickMatrix.add([task: "tools-stubs", scala: "2.12.4", java: javaVersion])
quickMatrix.add([task: "tools-sbtplugin", scala: "2.10.7", java: javaVersion])
quickMatrix.add([task: "tools", scala: "2.11.12", java: javaVersion])
quickMatrix.add([task: "tools", scala: "2.12.4", java: javaVersion])
}
quickMatrix.add([task: "partestc", scala: "2.11.0", java: mainJavaVersion])
quickMatrix.add([task: "sbtplugin-test", toolsscala: "2.10.7", sbt_version_override: "", java: mainJavaVersion])
Expand Down
1 change: 0 additions & 1 deletion build.sbt
Expand Up @@ -21,7 +21,6 @@ val scalalib = Build.scalalib
val libraryAux = Build.libraryAux
val library = Build.library
val minilib = Build.minilib
val stubs = Build.stubs
val testInterface = Build.testInterface
val jUnitRuntime = Build.jUnitRuntime
val jUnitTestOutputsJS = Build.jUnitTestOutputsJS
Expand Down
7 changes: 5 additions & 2 deletions library/src/main/scala/scala/scalajs/js/annotation/README.md
@@ -1,3 +1,6 @@
**Attention**: Some files in here are also published in the Scala.js stubs JVM library (see the stubs project in the Scala.js build).
**Attention**: Some annotations in here are also published in the Scala.js
stubs JVM library, which lives in the separate repository at
https://github.com/scala-js/scala-js-stubs.

If you add (or rename) a file, make sure the files in the stubs project are up to date.
If you add or change annotations here, consider whether it makes sense to make
them available in the stubs.
@@ -0,0 +1,6 @@
**Attention**: Some annotations in here are also published in the Scala.js
stubs JVM library, which lives in the separate repository at
https://github.com/scala-js/scala-js-stubs.

If you add or change annotations here, consider whether it makes sense to make
them available in the stubs.
9 changes: 0 additions & 9 deletions project/Build.scala
Expand Up @@ -534,7 +534,6 @@ object Build {
clean in testAdapter, clean in plugin,
clean in javalanglib, clean in javalib, clean in scalalib,
clean in libraryAux, clean in library, clean in minilib,
clean in stubs,
clean in testInterface,
clean in jUnitRuntime, clean in jUnitPlugin,
clean in jUnitTestOutputsJS, clean in jUnitTestOutputsJVM,
Expand Down Expand Up @@ -1153,14 +1152,6 @@ object Build {
))
).withScalaJSCompiler.dependsOn(library)

lazy val stubs: Project = project.settings(
commonSettings,
publishSettings,
name := "Scala.js Stubs",
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
previousArtifactSetting
)

// Test framework
lazy val testInterface = (project in file("test-interface")).enablePlugins(
MyScalaJSPlugin
Expand Down
3 changes: 1 addition & 2 deletions sbt-plugin-test/build.sbt
Expand Up @@ -102,8 +102,7 @@ lazy val testFrameworkJVM = project.in(file("testFramework/jvm")).
settings(
testFrameworkCommonSettings,
libraryDependencies ++= Seq(
"org.scala-sbt" % "test-interface" % "1.0",
"org.scala-js" %% "scalajs-stubs" % scalaJSVersion % "provided"
"org.scala-sbt" % "test-interface" % "1.0"
)
)

Expand Down
Expand Up @@ -7,6 +7,9 @@ import scala.scalajs.reflect.Reflect
* A typical testing framework would use portable-scala-reflect instead.
*/
private[framework] object Platform {
type EnableReflectiveInstantiation =
scala.scalajs.reflect.annotation.EnableReflectiveInstantiation

def instantiateTestClass(fullName: String, classLoader: ClassLoader): Test = {
val cls = Reflect.lookupInstantiatableClass(fullName).getOrElse {
throw new ClassNotFoundException(s"Cannot find $fullName")
Expand Down
Expand Up @@ -5,6 +5,8 @@ package sbttest.framework
* A typical testing framework would use portable-scala-reflect instead.
*/
private[framework] object Platform {
class EnableReflectiveInstantiation extends scala.annotation.Annotation

def instantiateTestClass(fullName: String, classLoader: ClassLoader): Test = {
val cls = Class.forName(fullName, true, classLoader)
assert(classOf[Test].isAssignableFrom(cls), fullName)
Expand Down
@@ -1,6 +1,6 @@
package sbttest.framework

import scala.scalajs.reflect.annotation.EnableReflectiveInstantiation
import Platform.EnableReflectiveInstantiation

@EnableReflectiveInstantiation
class Test
2 changes: 1 addition & 1 deletion scripts/publish.sh
Expand Up @@ -16,7 +16,7 @@ SBT1_SBTVERSION="1.0.0"

COMPILER="compiler jUnitPlugin"
LIBS="library irJS ioJS loggingJS linkerJS testInterface jUnitRuntime"
JVM_LIBS="ir io logging linker jsEnvs jsEnvsTestKit nodeJSEnv testAdapter stubs"
JVM_LIBS="ir io logging linker jsEnvs jsEnvsTestKit nodeJSEnv testAdapter"

# Publish compiler
for v in $FULL_VERSIONS; do
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 5a54514

Please sign in to comment.