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 all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,528 changes: 1,528 additions & 0 deletions art/bigswig.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
131 changes: 131 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.
Binary file added art/nothing.xcf
Binary file not shown.
88 changes: 81 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,18 +1,92 @@
val scala3Version = "3.1.3"
import java.nio.file.Files

lazy val root = project
.in(file("."))
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",
libraryDependencies += "org.typelevel" %%% "cats-effect" % "3.4.8",
).jsSettings(
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,
libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test,
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 webTarget = settingKey[File]("webTarget")
val tearDownWeb = TaskKey[Unit]("tearDownWeb")
val linkJSDir = TaskKey[File]("linkJSDir")
val fastCopyWeb = TaskKey[Unit]("fastCopyWeb")
val fullCopyWeb = TaskKey[Unit]("fullCopyWeb")

val fastBuild = TaskKey[Unit]("fastBuild")
val fullBuild = TaskKey[Unit]("fullBuild")

def tearDownImpl(targetDir: File) = {
if (Files.exists(targetDir.toPath))
IO.delete(targetDir)
}
def copyImpl(linkDir: File, targetDir: File, baseDir: File) = {
if (!Files.exists(targetDir.toPath))
IO.createDirectory(targetDir)
IO.copyDirectory(linkDir, targetDir)
IO.copyDirectory(file("resources"), new File(targetDir, "resources"))
IO.copyDirectory(new File(baseDir, "web"), targetDir)
}
ThisBuild / resolvers +=
"Sonatype OSS Snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots"
lazy val web = project
.enablePlugins(ScalaJSPlugin)
.enablePlugins(ScalablyTypedConverterPlugin)
.in(file("web"))
.dependsOn(core.js)
.settings(
name := "splooge_web",
version := "0.1.0-SNAPSHOT",
libraryDependencies += "com.armanbilge" %%% "calico" % "0.2-1f61455-SNAPSHOT",
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.4.0",
scalaJSUseMainModuleInitializer := true,
webTarget := new File((Compile / target).value, "webpage"),

fastCopyWeb := copyImpl((Compile / fastLinkJSOutput).value, webTarget.value, baseDirectory.value),
fullCopyWeb := copyImpl((Compile / fullLinkJSOutput).value, webTarget.value, baseDirectory.value),
tearDownWeb := tearDownImpl(webTarget.value),
fastBuild := {
Def.sequential(
tearDownWeb,
Compile / fastLinkJS,
fastCopyWeb
).value
},
fullBuild := {
Def.sequential(
tearDownWeb,
Compile / fullLinkJS,
fullCopyWeb,

).value
}
)
lazy val root = project
.aggregate(core.jvm, swing)

Loading