Skip to content

Commit

Permalink
Merge branch 'tickets/ssh-45-native' into 'main'
Browse files Browse the repository at this point in the history
SSH-45 Scala Native Support

See merge request reactivecore/kreuzberg!44
  • Loading branch information
nob13 committed Jan 3, 2024
2 parents 70f9ac6 + 70d3fae commit 0c82b6d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: gitlabdocker.rcxt.de/builder/scala:v2-11
image: gitlabdocker.rcxt.de/builder/scala:v3-11

variables:
SBT_OPTS: "-Dsbt.ivy.home=$PWD/cache/ivy -Divy.home=$PWD/cache/ivy -Dsbt.global.base=$PWD/cache/sbt -Dsbt.boot.directory=$PWD/cache/sbt_boot -Dsbt.coursier.home=$PWD/cache/coursier"
Expand Down
2 changes: 1 addition & 1 deletion .jvmopts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-Xmx2G
-Xmx4G

7 changes: 7 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ The aim of Kreuzberg is to simplify the use of Scala in web applications. Its ke
- Declarative components
- Separation of the runtime engine from the component implementation. Each component declares how it functions, while the act of combining and running components is performed by an engine.
- Automatically generated API calls between client and server. One trait is defined and implemented on the server. Stubs (on the client side) and dispatchers (on the server side) are macro-generated.

**Note:** This depends on experimental Scala features.
- Deriving HTML Forms from Case-Classes, including Validation.
- HTML technique agnosticism. There is support for Scalatags and Scala XML, and more implementations can be added.
- Theoretically, it should be possible to implement a server-side engine, but this has not yet been done.

Expand Down Expand Up @@ -75,3 +78,7 @@ For simplification, there is a `SimpleComponentBase`, which makes it easier to i

- ScalaJS Only: `~examplesJS/fastOptJS`
- Full: `~runner/reStart`

# Notes

- Scala Native is not tested
20 changes: 13 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ val logsettings = libraryDependencies ++= Seq(
)

/** Defines a component. */
lazy val lib = (crossProject(JSPlatform, JVMPlatform) in file("lib"))
lazy val lib = (crossProject(JSPlatform, JVMPlatform, NativePlatform) in file("lib"))
.settings(
name := "kreuzberg",
testSettings,
Expand All @@ -82,7 +82,7 @@ lazy val lib = (crossProject(JSPlatform, JVMPlatform) in file("lib"))
)

/** Common codes for Engine */
lazy val engineCommon = (crossProject(JSPlatform, JVMPlatform) in file("engine-common"))
lazy val engineCommon = (crossProject(JSPlatform, JVMPlatform, NativePlatform) in file("engine-common"))
.settings(
name := "kreuzberg-engine-common",
testSettings,
Expand Down Expand Up @@ -117,7 +117,7 @@ lazy val engineZio = (project in file("engine-zio"))
publishSettings
)

lazy val xml = (crossProject(JSPlatform, JVMPlatform) in file("xml"))
lazy val xml = (crossProject(JSPlatform, JVMPlatform, NativePlatform) in file("xml"))
.settings(
name := "kreuzberg-xml",
libraryDependencies ++= Seq(
Expand All @@ -129,7 +129,7 @@ lazy val xml = (crossProject(JSPlatform, JVMPlatform) in file("xml"))
)
.dependsOn(lib, engineCommon % Test)

lazy val scalatags = (crossProject(JSPlatform, JVMPlatform) in file("scalatags"))
lazy val scalatags = (crossProject(JSPlatform, JVMPlatform, NativePlatform) in file("scalatags"))
.settings(
name := "kreuzberg-scalatags",
libraryDependencies ++= Seq(
Expand All @@ -140,7 +140,7 @@ lazy val scalatags = (crossProject(JSPlatform, JVMPlatform) in file("scalatags")
)
.dependsOn(lib, engineCommon % Test)

lazy val rpc = (crossProject(JSPlatform, JVMPlatform) in file("rpc"))
lazy val rpc = (crossProject(JSPlatform, JVMPlatform, NativePlatform) in file("rpc"))
.settings(
name := "kreuzberg-rpc",
libraryDependencies ++= Seq(
Expand All @@ -153,7 +153,7 @@ lazy val rpc = (crossProject(JSPlatform, JVMPlatform) in file("rpc"))
)
.dependsOn(lib)

lazy val extras = (crossProject(JSPlatform, JVMPlatform) in file("extras"))
lazy val extras = (crossProject(JSPlatform, JVMPlatform, NativePlatform) in file("extras"))
.settings(
name := "kreuzberg-extras",
testSettings,
Expand Down Expand Up @@ -243,21 +243,27 @@ lazy val root = (project in file("."))
.aggregate(
lib.js,
lib.jvm,
lib.native,
engineNaive,
engineZio,
engineCommon.js,
engineCommon.jvm,
engineCommon.native,
xml.js,
xml.jvm,
xml.native,
scalatags.js,
scalatags.jvm,
scalatags.native,
extras.js,
extras.jvm,
extras.native,
miniserver,
examples.js,
examples.jvm,
examplesZio.js,
examplesZio.jvm,
rpc.js,
rpc.jvm
rpc.jvm,
rpc.native
)
18 changes: 11 additions & 7 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.1")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.1")
addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.3")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.21")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.1")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.16")

addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.1")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.1")

addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.3")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.21")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")

0 comments on commit 0c82b6d

Please sign in to comment.