Skip to content

Commit

Permalink
Update packaging to match scala-2.13 upgrade; make copy operations id…
Browse files Browse the repository at this point in the history
…empotent
  • Loading branch information
GreyCat committed Feb 29, 2024
1 parent cdf8b13 commit 66ad703
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import java.io.File
import java.nio.charset.Charset
import java.nio.file.Files

import java.nio.file.{Files, StandardCopyOption}
import com.typesafe.sbt.packager.linux.{LinuxPackageMapping, LinuxSymlink}
import sbt.Keys._
import sbt.Keys.*

resolvers ++= Resolver.sonatypeOssRepos("public")

Expand Down Expand Up @@ -217,7 +216,7 @@ lazy val generateVersionTask = Def.task {
*/
lazy val buildNpmJsFile = taskKey[Seq[File]]("buildNpmJsFile")
lazy val buildNpmJsFileTask = Def.task {
val compiledFile = target.value / "scala-2.12" / s"${name.value}-fastopt.js"
val compiledFile = target.value / "scala-2.13" / s"${name.value}-fastopt.js"
println(s"buildNpmJsFile: reading $compiledFile")
val compiledFileContents = IO.read(compiledFile, UTF8)

Expand Down Expand Up @@ -249,8 +248,8 @@ lazy val buildNpmPackageTask = Def.task {
val readMeFile = new File("js/npm/README.md")
val packageJsonFile = new File("js/npm/package.json")

Files.copy(new File("LICENSE").toPath, licenseFile.toPath)
Files.copy(new File("js/README.md").toPath, readMeFile.toPath)
Files.copy(new File("LICENSE").toPath, licenseFile.toPath, StandardCopyOption.REPLACE_EXISTING)
Files.copy(new File("js/README.md").toPath, readMeFile.toPath, StandardCopyOption.REPLACE_EXISTING)

val packageJsonTmpl = IO.read(new File("js/package.json"), UTF8)
val packageJsonContents = packageJsonTmpl.replaceFirst(
Expand Down
4 changes: 2 additions & 2 deletions jvm/src/main/scala/io/kaitai/struct/JavaMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ object JavaMain {
// we need to decode it as well.
//
// Linux, from IDE:
// $HOME/git/kaitai_struct/compiler/jvm/target/scala-2.12/classes/
// $HOME/git/kaitai_struct/compiler/jvm/target/scala-2.13/classes/
//
// Linux, from stage:
// $HOME/git/kaitai_struct/compiler/jvm/target/universal/stage/lib/io.kaitai.kaitai-struct-compiler-0.10-SNAPSHOT.jar
//
// Linux, from "sbt compilerJVM/run"
// $HOME/git/kaitai_struct/compiler/jvm/target/scala-2.12/classes/
// $HOME/git/kaitai_struct/compiler/jvm/target/scala-2.13/classes/
//
// Linux, from universal, custom install path:
// /tmp/a%20b/kaitai-struct-compiler-0.10-SNAPSHOT/lib/io.kaitai.kaitai-struct-compiler-0.10-SNAPSHOT.jar
Expand Down

0 comments on commit 66ad703

Please sign in to comment.