Skip to content

Commit

Permalink
Fix native image example (merged HumbleUI#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Oct 26, 2021
2 parents e513dd5 + 69b32a2 commit 2ab911b
Show file tree
Hide file tree
Showing 41 changed files with 199 additions and 1,377 deletions.
7 changes: 7 additions & 0 deletions examples/native-image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
|Mac arm64|sdkman|1. `curl -s "https://get.sdkman.io" \| bash`<br>2. `sdk install sbt` |https://stackoverflow.com/questions/66464412/install-scala-to-apple-silicon|
## run example application

```sh
// at jwm dir
./script/build.py
./script/publish_local.py
cd examples/native-image
```

```sh
sbt run
```
Expand Down
12 changes: 10 additions & 2 deletions examples/native-image/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import Dependencies._
import scala.sys.process._

resolvers += "jetbrain skija" at "https://packages.jetbrains.team/maven/p/skija/maven"

val mavenLocal = "Local Maven Repository" at "file://"+Path.userHome+"/.m2/repository"
resolvers += mavenLocal
// general
name := "example"
version := "0.0.0"
ThisBuild / organization := "io.github.humbleui.jwm.examples.jwm"

// package stuff
maintainer := "john doe"
maintainer := "io.github.HumbleUI"
packageSummary := "example jwm application"
packageDescription := """example jwm application."""
enablePlugins(JavaAppPackaging, WindowsPlugin)
Expand Down Expand Up @@ -76,9 +77,16 @@ genIconIfNotExists := {
case _ => ()
}
}
// use sources from sibling directory
lazy val srcSettings = Seq(
Compile / javaSource := baseDirectory.value / ".." / "dashboard" / "java",
Compile / resourceDirectory := baseDirectory.value / ".." / "dashboard" / "resources"
)


lazy val example = project
.in(file("."))
.settings(srcSettings)
.settings(
libraryDependencies ++= Dependencies.deps,
assembly / mainClass := Some("io.github.humbleui.jwm.examples.Example"),
Expand Down
12 changes: 6 additions & 6 deletions examples/native-image/project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import sbt._

import Utils._
object Dependencies {
val skijaVersion = "0.93.1"
val jwmVersion = "0.2.4"
val jwmVersion = "0.0.0-SNAPSHOT"
val deps = Seq(
"org.jetbrains" % "annotations" % "20.1.0",
"org.projectlombok" % "lombok" % "1.18.20",
"org.jetbrains.skija" % "skija-shared" % skijaVersion,
"io.github.humbleui.jwm" % "jwm" % jwmVersion
) ++ platformDeps

private def platformDeps = System.getProperty("os.name").toLowerCase match {
case win if win.contains("win") =>
private def platformDeps = Utils.system match {
case OS.Windows =>
Seq("org.jetbrains.skija" % "skija-windows" % skijaVersion)
case linux if linux.contains("linux") =>
case OS.Linux =>
Seq("org.jetbrains.skija" % "skija-linux" % skijaVersion)
case macos if macos.contains("mac") =>
case OS.Mac =>
Seq(
"org.jetbrains.skija" % "skija-macos-x64" % skijaVersion,
"org.jetbrains.skija" % "skija-macos-arm64" % skijaVersion
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2ab911b

Please sign in to comment.