Skip to content
Closed
Changes from all commits
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
63 changes: 38 additions & 25 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lazy val commonSettings = Seq(
resolvers += Resolver.mavenLocal,
resolvers += "Sonatype OSS Snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots",
updateOptions := updateOptions.value.withLatestSnapshots(false),
libraryDependencies += "com.google.protobuf" % "protobuf-java" % "4.27.3",
libraryDependencies += "com.google.protobuf" % "protobuf-java" % "4.27.3",
libraryDependencies += "org.scala-lang" % "scala3-compiler_3" % scalaVersion.value exclude (
"org.scala-sbt",
"compiler-interface"
Expand Down Expand Up @@ -75,7 +75,7 @@ val copyPackageNoExports = taskKey[Unit]("Copy package file without exports to t
lazy val backends = (crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure) in file("backends"))
.dependsOn(core)
.settings(
.settings(
commonSettings,
name := "onnx-scala-backends",
mimaPreviousArtifacts := Set("org.emergent-order" %%% "onnx-scala-backends" % "0.17.0"),
Expand All @@ -102,35 +102,48 @@ lazy val backends = (crossProject(JSPlatform, JVMPlatform)
Compile / npmDependencies += "onnxruntime-common" -> "1.18.0",
Compile / npmDependencies += "typescript" -> "5.4.5",
copyIndexTs := {
import Path._

val src = new File(".")
import Path._

// get the files we want to copy
val htmlFiles: Seq[File] = Seq(new File("index.d.ts"))
val src = new File(".")

// use Path.rebase to pair source files with target destination in crossTarget
val pairs = htmlFiles pair rebase(src, (Compile / target).value / "scala-3.5.0-RC7/scalajs-bundler/main/node_modules/onnxruntime-node/dist/types.d.ts")
// get the files we want to copy
val htmlFiles: Seq[File] = Seq(new File("index.d.ts"))

// Copy files to source files to target
IO.copy(pairs, CopyOptions.apply(overwrite = true, preserveLastModified = true, preserveExecutable = false))
// use Path.rebase to pair source files with target destination in crossTarget
val pairs = htmlFiles pair rebase(
src,
(Compile / target).value / "scala-3.5.1-RC2/scalajs-bundler/main/node_modules/onnxruntime-node/dist/types.d.ts"
)

},
// Copy files to source files to target
IO.copy(
pairs,
CopyOptions
.apply(overwrite = true, preserveLastModified = true, preserveExecutable = false)
)

},
copyPackageNoExports := {
import Path._

val src = new File(".")

// get the files we want to copy
val htmlFiles: Seq[File] = Seq(new File("package.json"))

// use Path.rebase to pair source files with target destination in crossTarget
val pairs = htmlFiles pair rebase(src, (Compile / target).value / "scala-3.5.0-RC7/scalajs-bundler/test/node_modules/onnxruntime-common")

// Copy files to source files to target
IO.copy(pairs, CopyOptions.apply(overwrite = true, preserveLastModified = true, preserveExecutable = false))
},
import Path._

val src = new File(".")

// get the files we want to copy
val htmlFiles: Seq[File] = Seq(new File("package.json"))

// use Path.rebase to pair source files with target destination in crossTarget
val pairs = htmlFiles pair rebase(
src,
(Compile / target).value / "scala-3.5.1-RC2/scalajs-bundler/test/node_modules/onnxruntime-common"
)

// Copy files to source files to target
IO.copy(
pairs,
CopyOptions
.apply(overwrite = true, preserveLastModified = true, preserveExecutable = false)
)
},
Compile / compile := (Compile / compile dependsOn (copyIndexTs, copyPackageNoExports)).value,
libraryDependencies += "org.typelevel" %%% "cats-effect-testing-scalatest" % "1.5.0" % Test,
stOutputPackage := "org.emergentorder.onnx",
Expand Down