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

Method Generate

toolchains/engine-dev/main.go:377–399  ·  view source on GitHub ↗

Generate any engine-related files Note: this is codegen of the 'go generate' variety, not 'dagger develop' +generate

(_ context.Context)

Source from the content-addressed store, hash-verified

375// Note: this is codegen of the 'go generate' variety, not 'dagger develop'
376// +generate
377func (dev *EngineDev) Generate(_ context.Context) (*dagger.Changeset, error) {
378 base := dev.Source
379 withGoGenerate := dag.Go(dagger.GoOpts{
380 Source: dev.Source,
381 ExtraPackages: []string{
382 "clang",
383 "lld",
384 "libbpf-dev",
385 },
386 }).Env().
387 WithExec([]string{"go", "install", "google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2"}).
388 WithExec([]string{"go", "install", "github.com/gogo/protobuf/protoc-gen-gogo@v1.3.2"}).
389 WithExec([]string{"go", "install", "github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.2"}).
390 WithExec([]string{"go", "install", "github.com/gogo/protobuf/protoc-gen-gogofaster@v1.3.2"}).
391 WithExec([]string{"go", "install", "google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0"}).
392 WithMountedDirectory("./github.com/gogo/googleapis", dag.Git("https://github.com/gogo/googleapis.git").Tag("v1.4.1").Tree()).
393 WithMountedDirectory("./github.com/gogo/protobuf", dag.Git("https://github.com/gogo/protobuf.git").Tag("v1.3.2").Tree()).
394 WithExec([]string{"go", "generate", "-v", "./..."}).
395 WithExec([]string{"go", "test", "./dagql", "-update"}).
396 Directory(".")
397 changes := changes(base, withGoGenerate, []string{"github.com"})
398 return changes, nil
399}
400
401// Return the changes between two directory, excluding the specified path patterns from the comparison
402// FIXME: had to copy-paste across modules

Callers 1

invokeFunction · 0.45

Calls 9

changesFunction · 0.70
DirectoryMethod · 0.65
TreeMethod · 0.65
WithExecMethod · 0.45
WithMountedDirectoryMethod · 0.45
EnvMethod · 0.45
GoMethod · 0.45
TagMethod · 0.45
GitMethod · 0.45

Tested by

no test coverage detected