Skip to content

Commit

Permalink
Save
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejressel committed Mar 6, 2024
1 parent 0c477af commit 39726f2
Show file tree
Hide file tree
Showing 26 changed files with 1,697 additions and 341 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ devenv.local.nix
/my-file
/pulumi-language-wasm/language-host.exe

.idea/
.idea/

output.log
194 changes: 192 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tonic = "0.11.0"
object = "0.32.2"
prost-types = "0.12.3"
clap = { version = "4.5.1", features = ["derive"] }
log4rs.workspace = true

[workspace]

Expand Down Expand Up @@ -47,6 +48,6 @@ wasmtime-wasi = "18.0.2"
tonic-build = "0.11.0"
async-trait = "0.1.77"
tonic-web = "0.11.0"
log = { version = "0.4.20", features = [] }
log = { version = "0.4.21", features = [] }
tracing-subscriber = "0.3.18"

log4rs = "1.3.0"
2 changes: 1 addition & 1 deletion entrypoint.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.\run.bat && cargo run -- --wasm target/wasm32-wasi/debug/composed2.wasm
.\run.bat && cargo run -- --wasm target/wasm32-wasi/debug/composed2.wasm run
2 changes: 1 addition & 1 deletion pulumi-language-wasm/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ pulumi plugin rm language wasm -y

go build

pulumi plugin install language wasm 1.0 --file .\language-host.exe
pulumi plugin install language wasm 1.0 --file .\pulumi-language-wasm.exe

copy /y %userprofile%\.pulumi\plugins\language-wasm-v1.0.0\pulumi-language-wasm %userprofile%\.pulumi\plugins\language-wasm-v1.0.0\pulumi-language-wasm.exe
10 changes: 5 additions & 5 deletions pulumi-language-wasm/executors/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package executors
import (
"fmt"

"github.com/virtuslab/besom/language-host/fsys"
"github.com/andrzejressel/pulumi-wasm/pulumi-language-wasm/fsys"
)

// WasmExecutor abstracts interactions with a wasm project, ability to build, run
Expand All @@ -20,15 +20,15 @@ type WasmExecutor struct {
// Optional dir to run the command in.
Dir string

// Command to run the Scala code - the main entrypoint.
// Command to run the Wasm code - the main entrypoint.
RunArgs []string

// Command args to resolve dependencies and build; this will
// be called after `pulumi new` on Gradle templates. Optional.
BuildArgs []string

// Command to autodetect and print Pulumi plugins depended on
// by the Scala program.
// by the Wasm program.
PluginArgs []string

// Command to print the version of the command.
Expand Down Expand Up @@ -59,15 +59,15 @@ type wasmExecutorFactory interface {
NewWasmExecutor(WasmExecutorOptions) (*WasmExecutor, error)
}

func NewScalaExecutor(opts WasmExecutorOptions) (*WasmExecutor, error) {
func NewWasmExecutor(opts WasmExecutorOptions) (*WasmExecutor, error) {
e, err := combineWasmExecutorFactories(
&windows{},
).NewWasmExecutor(opts)
if err != nil {
return nil, err
}
if e == nil {
return nil, fmt.Errorf("failed to configure executor, tried: jar, sbt, scala-cli")
return nil, fmt.Errorf("failed to configure executor, tried: entrypoint.bat")
}
return e, nil
}
Expand Down
Loading

0 comments on commit 39726f2

Please sign in to comment.