diff --git a/DEVELOPING.md b/DEVELOPING.md index 55bc21f622..81d52e654a 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -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 diff --git a/Jenkinsfile b/Jenkinsfile index 55c033b60e..f5faf3c448 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 \ @@ -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 ''', @@ -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 \ @@ -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]) diff --git a/build.sbt b/build.sbt index 99e7a6b897..b924255044 100644 --- a/build.sbt +++ b/build.sbt @@ -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 diff --git a/library/src/main/scala/scala/scalajs/js/annotation/README.md b/library/src/main/scala/scala/scalajs/js/annotation/README.md index 9ce7ebfaae..29511f2b5c 100644 --- a/library/src/main/scala/scala/scalajs/js/annotation/README.md +++ b/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. diff --git a/library/src/main/scala/scala/scalajs/reflect/annotation/README.md b/library/src/main/scala/scala/scalajs/reflect/annotation/README.md new file mode 100644 index 0000000000..29511f2b5c --- /dev/null +++ b/library/src/main/scala/scala/scalajs/reflect/annotation/README.md @@ -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. diff --git a/project/Build.scala b/project/Build.scala index ac53f7d074..5d3fa98983 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -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, @@ -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 diff --git a/sbt-plugin-test/build.sbt b/sbt-plugin-test/build.sbt index e11ae77c6d..8c2c5cefdf 100644 --- a/sbt-plugin-test/build.sbt +++ b/sbt-plugin-test/build.sbt @@ -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" ) ) diff --git a/sbt-plugin-test/testFramework/js/src/main/scala/sbttest/framework/Platform.scala b/sbt-plugin-test/testFramework/js/src/main/scala/sbttest/framework/Platform.scala index 76447187b5..66de2800fb 100644 --- a/sbt-plugin-test/testFramework/js/src/main/scala/sbttest/framework/Platform.scala +++ b/sbt-plugin-test/testFramework/js/src/main/scala/sbttest/framework/Platform.scala @@ -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") diff --git a/sbt-plugin-test/testFramework/jvm/src/main/scala/sbttest/framework/Platform.scala b/sbt-plugin-test/testFramework/jvm/src/main/scala/sbttest/framework/Platform.scala index cc0abd82ff..8c6dd17595 100644 --- a/sbt-plugin-test/testFramework/jvm/src/main/scala/sbttest/framework/Platform.scala +++ b/sbt-plugin-test/testFramework/jvm/src/main/scala/sbttest/framework/Platform.scala @@ -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) diff --git a/sbt-plugin-test/testFramework/shared/src/main/scala/sbttest/framework/Test.scala b/sbt-plugin-test/testFramework/shared/src/main/scala/sbttest/framework/Test.scala index 3834b6da03..43cb01b5d6 100644 --- a/sbt-plugin-test/testFramework/shared/src/main/scala/sbttest/framework/Test.scala +++ b/sbt-plugin-test/testFramework/shared/src/main/scala/sbttest/framework/Test.scala @@ -1,6 +1,6 @@ package sbttest.framework -import scala.scalajs.reflect.annotation.EnableReflectiveInstantiation +import Platform.EnableReflectiveInstantiation @EnableReflectiveInstantiation class Test diff --git a/scripts/publish.sh b/scripts/publish.sh index 081b9bfb04..9472286cdf 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -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 diff --git a/stubs/src/main/scala/scala/scalajs/js/annotation/ExportAnnotations.scala b/stubs/src/main/scala/scala/scalajs/js/annotation/ExportAnnotations.scala deleted file mode 100644 index b000bd268a..0000000000 --- a/stubs/src/main/scala/scala/scalajs/js/annotation/ExportAnnotations.scala +++ /dev/null @@ -1,20 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - - -package scala.scalajs.js.annotation - -import scala.annotation.Annotation - -class JSExportAll extends scala.annotation.Annotation - -class JSExport extends scala.annotation.Annotation { - def this(name: String) = this() -} - -class JSExportTopLevel(name: String) extends scala.annotation.Annotation diff --git a/stubs/src/main/scala/scala/scalajs/reflect/annotation/ReflectAnnotations.scala b/stubs/src/main/scala/scala/scalajs/reflect/annotation/ReflectAnnotations.scala deleted file mode 100644 index 56a2a004bc..0000000000 --- a/stubs/src/main/scala/scala/scalajs/reflect/annotation/ReflectAnnotations.scala +++ /dev/null @@ -1,10 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ __ ____ Scala.js API ** -** / __/ __// _ | / / / _ | __ / // __/ (c) 2013-2017, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ ** -** /____/\___/_/ |_/____/_/ | |__/ /____/ ** -** |/____/ ** -\* */ -package scala.scalajs.reflect.annotation - -class EnableReflectiveInstantiation extends scala.annotation.Annotation