Skip to content

Commit

Permalink
chore(sdk/elixir): use introspection json schema from codegen (dagger…
Browse files Browse the repository at this point in the history
…#7146)

Similar to Python SDK, uses introspection from `t.Dagger.instrospection`
to generate schema file and mounting it to the container to generate
code.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
  • Loading branch information
wingyplus authored and vikram-dagger committed May 3, 2024
1 parent 5e463cb commit 75d7b11
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 106 deletions.
9 changes: 6 additions & 3 deletions ci/sdk_elixir.go
Expand Up @@ -70,14 +70,17 @@ func (t ElixirSDK) Generate(ctx context.Context) (*Directory, error) {
if err != nil {
return nil, err
}

introspection, err := t.Dagger.introspection(ctx, installer)
if err != nil {
return nil, err
}
gen := t.elixirBase(elixirVersions[0]).
With(installer).
WithExec([]string{"mix", "run", "scripts/fetch_introspection.exs"}).
WithWorkdir("dagger_codegen").
WithExec([]string{"mix", "deps.get"}).
WithExec([]string{"mix", "escript.build"}).
WithExec([]string{"./dagger_codegen", "generate", "--introspection", "../introspection.json", "--outdir", "gen"}).
WithMountedFile("/schema.json", introspection).
WithExec([]string{"./dagger_codegen", "generate", "--introspection", "/schema.json", "--outdir", "gen"}).
WithExec([]string{"mix", "format", "gen/*.ex"}).
Directory("gen")

Expand Down
99 changes: 0 additions & 99 deletions sdk/elixir/dagger_codegen/priv/introspection.graphql

This file was deleted.

4 changes: 0 additions & 4 deletions sdk/elixir/scripts/fetch_introspection.exs

This file was deleted.

0 comments on commit 75d7b11

Please sign in to comment.