( ctx context.Context, modSource *dagger.ModuleSource, introspectionJSON *dagger.File, )
| 72 | } |
| 73 | |
| 74 | func (m *JavaSdk) Codegen( |
| 75 | ctx context.Context, |
| 76 | modSource *dagger.ModuleSource, |
| 77 | introspectionJSON *dagger.File, |
| 78 | ) (*dagger.GeneratedCode, error) { |
| 79 | if err := m.setModuleConfig(ctx, modSource); err != nil { |
| 80 | return nil, err |
| 81 | } |
| 82 | mvnCtr, err := m.codegenBase(ctx, modSource, introspectionJSON) |
| 83 | if err != nil { |
| 84 | return nil, err |
| 85 | } |
| 86 | |
| 87 | generatedCode, err := m.generateCode(ctx, mvnCtr, introspectionJSON) |
| 88 | if err != nil { |
| 89 | return nil, err |
| 90 | } |
| 91 | |
| 92 | return dag. |
| 93 | GeneratedCode(dag.Directory().WithDirectory("/", generatedCode)). |
| 94 | WithVCSGeneratedPaths([]string{ |
| 95 | "target/generated-sources/**", |
| 96 | }). |
| 97 | WithVCSIgnoredPaths([]string{ |
| 98 | "target", |
| 99 | }), nil |
| 100 | } |
| 101 | |
| 102 | // codegenBase takes the user module code, add the generated SDK dependencies |
| 103 | // if the user module code is empty, creates a default module content based on the template from the SDK |
nothing calls this directly
no test coverage detected