Skip to content

Commit

Permalink
Add setting for WIT file name
Browse files Browse the repository at this point in the history
  • Loading branch information
danieletorelli committed May 8, 2024
1 parent 680acf0 commit c6d415e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/main/scala/cloud/golem/WasmComponentPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ object WasmComponentPlugin extends AutoPlugin {
)
lazy val wasmComponentWitPath = SettingKey[File](
"wasmComponentWitPath",
"Path to the wit directory",
KeyRanks.Invisible
)
lazy val wasmComponentWitName = SettingKey[String](
"wasmComponentWitName",
"Path to the wit file",
KeyRanks.Invisible
)
Expand Down
9 changes: 4 additions & 5 deletions src/main/scala/cloud/golem/WasmComponentPluginInternal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ private[golem] object WasmComponentPluginInternal {
}

lazy val baseSettings: Seq[Setting[?]] = {
lazy val wasmComponentWitFullPath =
Def
.task(
wasmComponentWitPath.value / s"${wasmComponentPackageName.value}.wit"
)
lazy val wasmComponentWitFullPath = Def.task(
wasmComponentWitPath.value / s"${wasmComponentWitName.value}.wit"
)
Def.settings(
wasmComponentOutputDirectory := target.value / "dist",
wasmComponentWitPath := (ThisBuild / baseDirectory).value / "wit",
wasmComponentPackageName := moduleName.value,
wasmComponentWitName := wasmComponentPackageName.value,
wasmComponentWitBindgen := {
if (!wasmComponentWitFullPath.value.exists()) {
sys.error(s"""
Expand Down

0 comments on commit c6d415e

Please sign in to comment.