Documentation
¶
Overview ¶
Package java provides Java specific functionality for librarian.
Index ¶
- Variables
- func Add(lib *config.Library, addedAPI *config.API) (*config.Library, error)
- func ApplyMoveActionsToLibrary(actions []moveAction, destRoot string, keepSet map[string]bool) error
- func Clean(library *config.Library) error
- func DefaultLibraryName(api string) string
- func DefaultOutput(name, defaultOutput string) string
- func Fill(library *config.Library) (*config.Library, error)
- func FillDefaultJava(lib *config.Library, d *config.Default) *config.Library
- func Format(ctx context.Context, library *config.Library) error
- func Generate(ctx context.Context, cfg *config.Config, library *config.Library, ...) error
- func IdentifyMissingModules(library *config.Library, libraryDir string) ([]string, error)
- func Install(ctx context.Context, tools *config.Tools) error
- func InstallDir() (string, error)
- func PostGenerate(ctx context.Context, repoPath string, cfg *config.Config) error
- func ResolveMixinDependencies(cfg *config.Config, lib *config.Library, srcs *sources.Sources) (*config.Config, error)
- func Tidy(library *config.Library) (*config.Library, error)
- func Validate(cfg *config.Config) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrOmitCommonResourcesConflict is returned when OmitCommonResources is true // but common_resources.proto is also explicitly listed in AdditionalProtos. ErrOmitCommonResourcesConflict = errors.New("conflict: OmitCommonResources is true but google/cloud/common_resources.proto is explicitly listed in AdditionalProtos") // ErrCannotDeriveReleasedVersion is returned when released_version cannot be derived. ErrCannotDeriveReleasedVersion = errors.New("cannot derive released version") )
Functions ¶
func Add ¶ added in v0.11.0
Add initializes a new Java library with default values, or extends an existing library with a new API path, and registers the appropriate modules in versions.txt.
func ApplyMoveActionsToLibrary ¶ added in v0.26.0
func ApplyMoveActionsToLibrary(actions []moveAction, destRoot string, keepSet map[string]bool) error
ApplyMoveActionsToLibrary moves generated code to the repository directory structure, merging directories and preserving files matching the keepSet.
func Clean ¶
Clean removes files in the library's output directory that are not in the keep list. It targets patterns like proto-*, grpc-*, and the main GAPIC module.
func DefaultLibraryName ¶ added in v0.11.0
DefaultLibraryName derives a default library name from an API path by stripping known prefixes (e.g., "google/cloud/", "google/api/") and returning all segments except the last one, joined by dashes.
func DefaultOutput ¶ added in v0.26.0
DefaultOutput derives the default output directory name for a Java library.
func Fill ¶
Fill populates Java-specific default values for the library from derived or documented defaults.
func FillDefaultJava ¶ added in v0.26.0
FillDefaultJava populates empty Java-specific fields in lib from the config.Default, specifically from config.JavaDefault. This is typically called in sequence with Fill, which populates the derived default values.
func Generate ¶
func Generate(ctx context.Context, cfg *config.Config, library *config.Library, srcs *sources.Sources) error
Generate generates a Java client library.
func IdentifyMissingModules ¶ added in v0.13.0
IdentifyMissingModules identifies all expected proto-*, grpc-*, client, BOM and Parent modules for the given library based on its configuration and checks for pom.xml presence on the filesystem. It returns a list of artifact IDs for the missing modules.
func Install ¶ added in v0.15.0
Install installs Java tool dependencies. It creates two sibling directories: - bin/ ($LIBRARIAN_BIN/java_tools/bin) stores the generated executable wrapper scripts. - lib/ ($LIBRARIAN_BIN/java_tools/lib) isolates the downloaded compiled .jar/.exe files.
func InstallDir ¶ added in v0.24.0
InstallDir returns the absolute path of the installation directory for Java tools.
func PostGenerate ¶
PostGenerate performs repository-level actions after all individual Java libraries have been generated.
func ResolveMixinDependencies ¶ added in v0.14.0
func ResolveMixinDependencies(cfg *config.Config, lib *config.Library, srcs *sources.Sources) (*config.Config, error)
ResolveMixinDependencies automatically resolves mixin dependencies for a Java library.
Types ¶
This section is empty.