Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Js #1

Merged
merged 4 commits into from
Feb 27, 2023
Merged

Js #1

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
web is half working
  • Loading branch information
TheDrawingCoder-Gamer committed Feb 26, 2023
commit b1e977aa8469ab3836d3c3cd8731ad834c311c7a
128 changes: 128 additions & 0 deletions art/melonslosher.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 31 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,45 +1,66 @@
val scala3Version = "3.1.3"
import java.nio.file.Files

val scala3Version = "3.2.0"

ThisBuild / scalaVersion := scala3Version
ThisBuild / scalacOptions += "-old-syntax"
ThisBuild / scalacOptions += "-no-indent"
lazy val core = crossProject(JVMPlatform, JSPlatform)
.in(file("core"))
.enablePlugins(ScalablyTypedConverterPlugin)
.settings(
name := "splooge_core",
version := "0.1.0-SNAPSHOT",
scalacOptions += "-old-syntax",
scalacOptions += "-no-indent",
scalaVersion := scala3Version,
libraryDependencies += "org.typelevel" %%% "cats-effect" % "3.4.8",
).jsSettings(
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.4.0"
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.4.0",
Compile / npmDependencies += "@types/css-font-loading-module" -> "0.0.8",
)
lazy val swing = project
.in(file("swing"))
.dependsOn(core.jvm)
.settings(
name := "splooge3",
version := "0.1.0-SNAPSHOT",
scalacOptions += "-old-syntax",
scalacOptions += "-no-indent",
scalaVersion := scala3Version,
Compile / run / fork := true,
Compile / resourceDirectory := file("resources"),
libraryDependencies += "org.scala-lang.modules" %% "scala-swing" % "3.0.0",
libraryDependencies += "org.apache.xmlgraphics" % "batik" % "1.15",
libraryDependencies += "org.apache.xmlgraphics" % "batik-swing" % "1.15",
libraryDependencies += "org.apache.xmlgraphics" % "batik-transcoder" % "1.15",
libraryDependencies += "com.google.jimfs" % "jimfs" % "1.2",
libraryDependencies += "org.typelevel" %% "cats-effect" % "3.4.8",

)
val copyToTarget = TaskKey[Unit]("copyToTarget")

val fastBuild = TaskKey[Unit]("fastBuild")
val fullBuild = TaskKey[Unit]("fullBuild")
val fastRemove = TaskKey[Unit]("fastRemove")
ThisBuild / fastRemove := IO.delete(new File((web / Compile / fastLinkJSOutput).value, "resources"))
lazy val web = project
.enablePlugins(ScalaJSPlugin)
.enablePlugins(ScalablyTypedConverterPlugin)
.in(file("web"))
.dependsOn(core.js)
.settings(
name := "splooge_web",
version := "0.1.0-SNAPSHOT",
scalacOptions += "-old-syntax",
scalacOptions += "-no-indent",
libraryDependencies += "com.armanbilge" %%% "calico" % "0.2.0-RC1",
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.4.0",
scalaJSUseMainModuleInitializer := true,
copyToTarget := {
(Compile / fastLinkJS).value
IO.copyDirectory(file("resources"), new File((Compile / fastLinkJSOutput).value, "resources"))
IO.copyFile(new File(baseDirectory.value, "index.html"), new File((Compile / fastLinkJSOutput).value, "index.html"))
}
)
lazy val root = project
.aggregate(core.jvm, swing)

ThisBuild / fastBuild := {
Def.sequential(
ThisBuild / fastRemove,
web / Compile / copyToTarget
).value
}
Loading