MCPcopy Index your code
hub / github.com/dagger/dagger / ModuleRuntime

Method ModuleRuntime

sdk/java/runtime/main.go:296–326  ·  view source on GitHub ↗
(
	ctx context.Context,
	modSource *dagger.ModuleSource,
	introspectionJSON *dagger.File,
)

Source from the content-addressed store, hash-verified

294}
295
296func (m *JavaSdk) ModuleRuntime(
297 ctx context.Context,
298 modSource *dagger.ModuleSource,
299 introspectionJSON *dagger.File,
300) (*dagger.Container, error) {
301 if err := m.setModuleConfig(ctx, modSource); err != nil {
302 return nil, err
303 }
304
305 // Get a container with the user module sources and the SDK packages built and installed
306 mvnCtr, err := m.codegenBase(ctx, modSource, introspectionJSON)
307 if err != nil {
308 return nil, err
309 }
310 // Build the executable jar
311 jar, err := m.buildJar(ctx, mvnCtr)
312 if err != nil {
313 return nil, err
314 }
315
316 javaCtr, err := m.jreContainer(ctx)
317 if err != nil {
318 return nil, err
319 }
320 javaCtr = javaCtr.
321 WithFile(filepath.Join(ModDirPath, "module.jar"), jar).
322 WithWorkdir(ModDirPath).
323 WithEntrypoint([]string{"java", "-jar", filepath.Join(ModDirPath, "module.jar")})
324
325 return javaCtr, nil
326}
327
328// buildJar builds and returns the generated jar from the user module
329func (m *JavaSdk) buildJar(

Callers 1

invokeFunction · 0.45

Calls 7

setModuleConfigMethod · 0.95
codegenBaseMethod · 0.95
buildJarMethod · 0.95
jreContainerMethod · 0.95
WithEntrypointMethod · 0.45
WithWorkdirMethod · 0.45
WithFileMethod · 0.45

Tested by

no test coverage detected