Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
working-directory: google-cloud-java
run: librarian generate secretmanager
- name: Run librarian generate all (integration test)
if: matrix.task == 'integration' && github.event_name == 'push' && github.ref == 'refs/heads/main'
if: matrix.task == 'integration'
working-directory: google-cloud-java
run: librarian generate --all
create-issue-on-failure:
Expand Down
14 changes: 11 additions & 3 deletions internal/librarian/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,18 @@ func generateLibraries(ctx context.Context, cfg *config.Config, libraries []*con
}
return g.Wait()
case config.LanguageJava:
g, gctx := errgroup.WithContext(ctx)
g.SetLimit(runtime.NumCPU())
for _, library := range libraries {
if err := java.Generate(ctx, cfg, library, src); err != nil {
return fmt.Errorf("generate library %q (%s): %w", library.Name, cfg.Language, err)
}
g.Go(func() error {
if err := java.Generate(gctx, cfg, library, src); err != nil {
return fmt.Errorf("generate library %q (%s): %w", library.Name, cfg.Language, err)
}
return nil
})
}
if err := g.Wait(); err != nil {
return err
}
if err := java.Format(ctx, libraries...); err != nil {
return fmt.Errorf("format java libraries (%s): %w", cfg.Language, err)
Expand Down
Loading