From c6d415ec9f274c08a3c0f2ecb58ef568687e2cca Mon Sep 17 00:00:00 2001 From: Daniele Torelli Date: Wed, 8 May 2024 15:09:42 -0600 Subject: [PATCH] Add setting for WIT file name --- src/main/scala/cloud/golem/WasmComponentPlugin.scala | 5 +++++ .../scala/cloud/golem/WasmComponentPluginInternal.scala | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/scala/cloud/golem/WasmComponentPlugin.scala b/src/main/scala/cloud/golem/WasmComponentPlugin.scala index 9d632b5..ac8ea50 100644 --- a/src/main/scala/cloud/golem/WasmComponentPlugin.scala +++ b/src/main/scala/cloud/golem/WasmComponentPlugin.scala @@ -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 ) diff --git a/src/main/scala/cloud/golem/WasmComponentPluginInternal.scala b/src/main/scala/cloud/golem/WasmComponentPluginInternal.scala index c6680ce..07d5bfa 100644 --- a/src/main/scala/cloud/golem/WasmComponentPluginInternal.scala +++ b/src/main/scala/cloud/golem/WasmComponentPluginInternal.scala @@ -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"""