Skip to content

Commit

Permalink
scala-native 0.5 (#1233)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k authored May 1, 2024
1 parent c9049ff commit 5c90540
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 10 deletions.
11 changes: 6 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ lazy val specs2 = project.in(file(".")).
analysisJVM, shapelessJVM, formJVM, markdownJVM, gwtJVM, junitJVM, scalacheckJVM, mockJVM, xmlJVM,
tests, fpJS, catsJS, commonJS, matcherJS, coreJS, matcherExtraJS, scalazJS, analysisJS,
shapelessJS, junitJS, scalacheckJS, mockJS, fpNative, catsNative, commonNative, matcherNative,
coreNative, matcherExtraNative, scalazNative, analysisNative, shapelessNative, junitNative,
coreNative, matcherExtraNative, scalazNative, analysisNative, junitNative,
scalacheckNative, mockNative
)

Expand Down Expand Up @@ -55,7 +55,6 @@ lazy val commonJsSettings = Seq(
) ++ depends.jsMacrotaskExecutor

lazy val commonNativeSettings = Seq(
nativeLinkStubs := true
)

lazy val commonJsNativeSettings = Seq(
Expand Down Expand Up @@ -304,7 +303,7 @@ lazy val pom = Project(id = "pom", base = file("pom")).
dependsOn(catsJVM, commonJVM, matcherJVM, matcherExtraJVM, coreJVM, scalazJVM, html, analysisJVM,
shapelessJVM, formJVM, markdownJVM, gwtJVM, junitJVM, scalacheckJVM, mockJVM)

lazy val shapeless = crossProject(JSPlatform, JVMPlatform, NativePlatform).
lazy val shapeless = crossProject(JSPlatform, JVMPlatform).
crossType(CrossType.Pure).
in(file("shapeless")).
settings(
Expand All @@ -315,12 +314,14 @@ lazy val shapeless = crossProject(JSPlatform, JVMPlatform, NativePlatform).
).
jsSettings(depends.jsTest, commonJsSettings).
jvmSettings(depends.jvmTest, commonJvmSettings).
nativeSettings(depends.nativeTest, commonNativeSettings).
//nativeSettings(depends.nativeTest, commonNativeSettings).
dependsOn(matcher, matcherExtra % "test->test")

lazy val shapelessJS = shapeless.js
lazy val shapelessJVM = shapeless.jvm
lazy val shapelessNative = shapeless.native

// TODO https://github.com/milessabin/shapeless/issues/1355
// lazy val shapelessNative = shapeless.native

lazy val scalaz = crossProject(JSPlatform, JVMPlatform, NativePlatform).in(file("scalaz")).
settings(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.portablescala.reflect

import scala.scalanative.reflect.{Reflect => ScalaNativeReflect}

object Reflect {
def lookupLoadableModuleClass(fqcn: String): Option[LoadableModuleClass] =
ScalaNativeReflect.lookupLoadableModuleClass(fqcn)

def lookupInstantiatableClass(fqcn: String): Option[InstantiatableClass] =
ScalaNativeReflect.lookupInstantiatableClass(fqcn)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.portablescala.reflect

package object annotation {
type EnableReflectiveInstantiation =
scala.scalanative.reflect.annotation.EnableReflectiveInstantiation
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.portablescala

package object reflect {
type InstantiatableClass = scala.scalanative.reflect.InstantiatableClass

type LoadableModuleClass = scala.scalanative.reflect.LoadableModuleClass
}
5 changes: 2 additions & 3 deletions project/depends.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ object depends {
def nativeTest =
Seq(libraryDependencies ++= Seq(
"org.scala-native" %%% "test-interface" % nativeVersion,
"org.portable-scala" %%% "portable-scala-reflect" % "1.1.1"
))

def scalaParser = Def.setting {
Seq("org.scala-lang.modules" %%% "scala-parser-combinators" % "1.1.2")
}
def scalaParserNative = Def.setting {
Seq("org.scala-lang.modules" %%% "scala-parser-combinators" % "2.1.0")
Seq("org.scala-lang.modules" %%% "scala-parser-combinators" % "2.4.0")
}

def scalaXml = "org.scala-lang.modules" %% "scala-xml" % "2.1.0"
Expand All @@ -58,7 +57,7 @@ object depends {
lazy val tagsoup = "org.ccil.cowan.tagsoup" % "tagsoup" % "1.2.1"

lazy val scalacheck = Def.setting {
"org.scalacheck" %%% "scalacheck" % "1.15.4"
"org.scalacheck" %%% "scalacheck" % "1.18.0"
}

def paradise(scalaVersion: String) =
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.13.0")
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.16.0")
val scalaNativeVersion =
Option(System.getenv("SCALANATIVE_VERSION")).getOrElse("0.4.3")
Option(System.getenv("SCALANATIVE_VERSION")).getOrElse("0.5.1")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
addSbtPlugin("org.scala-native" % "sbt-scala-native" % scalaNativeVersion)
Expand Down

0 comments on commit 5c90540

Please sign in to comment.