Documentation
¶
Overview ¶
Package languages provides a plugin architecture for supporting multiple programming language ecosystems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLanguageNotRegistered is returned when a language is not found in the registry. ErrLanguageNotRegistered = errors.New("language not registered") // ErrNoLanguageDetected is returned when no supported language is detected. ErrNoLanguageDetected = errors.New("no supported language detected") // ErrMultipleLanguagesDetected is returned when more than one language matches. ErrMultipleLanguagesDetected = errors.New("multiple languages detected") )
Functions ¶
func DetectLanguage ¶
DetectLanguage attempts to detect which language is present in the given directory. When multiple languages match, languages with a manifest file in the root directory are preferred over those detected only via recursive scanning. Among equals, selection is alphabetical for determinism. Callers should use --language to override.
func DetectLanguages ¶
DetectLanguages returns all languages detected in the given directory, sorted alphabetically for deterministic output. Useful for multi-language projects.
Types ¶
type Dependency ¶
type Dependency struct {
// Name is the primary package/module name
Name string
// OldName is used for module replacements (Go-specific)
OldName string
// Version is the target version to update to
Version string
// Scope is the dependency scope (Maven-specific: compile, test, runtime, etc.)
Scope string
// Type is the dependency type (Maven-specific: jar, pom, etc.)
Type string
// Replace indicates this is a replacement directive (Go-specific)
Replace bool
// Additional metadata can be stored here
Metadata map[string]any
}
Dependency represents a single dependency to be updated.
type Language ¶
type Language interface {
// Name returns the language identifier (e.g., "maven", "go", "rust")
Name() string
// Detect checks if this language is present in the given directory.
// Returns true if manifest files for this language are found.
Detect(ctx context.Context, dir string) (bool, error)
// Update performs the dependency update using the provided configuration.
Update(ctx context.Context, cfg *UpdateConfig) error
// Validate checks if the updates were applied successfully.
// Returns an error if any dependency wasn't updated to the expected version.
Validate(ctx context.Context, cfg *UpdateConfig) error
// GetManifestFiles returns the list of manifest files for this language
// (e.g., ["go.mod", "go.sum"] for Go, ["pom.xml"] for Maven)
GetManifestFiles() []string
// SupportsAnalysis returns true if this language supports dependency analysis.
SupportsAnalysis() bool
}
Language defines the interface that each language ecosystem must implement. This allows omnibump to support multiple languages (Rust, Go, Maven) with a unified interface.
type UpdateConfig ¶
type UpdateConfig struct {
// RootDir is the root directory of the project
RootDir string
// Dependencies is the list of dependencies to update
Dependencies []Dependency
// Properties contains property updates (for build systems that support them)
Properties map[string]string
// Tidy indicates whether to run the language's "tidy" command after updates
Tidy bool
// ShowDiff indicates whether to show a diff of changes
ShowDiff bool
// DryRun indicates whether to only simulate the update without making changes
DryRun bool
// ManifestFile overrides the default manifest file path (e.g. a specific pom.xml).
// When empty, each language falls back to its default filename within RootDir.
ManifestFile string
// Options contains language-specific options as a flexible map
Options map[string]any
}
UpdateConfig contains all configuration needed to perform a dependency update.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package golang implements omnibump support for Go projects.
|
Package golang implements omnibump support for Go projects. |
|
Package java implements omnibump support for Java projects.
|
Package java implements omnibump support for Java projects. |
|
gradle
Package gradle implements Gradle build tool support for Java projects.
|
Package gradle implements Gradle build tool support for Java projects. |
|
maven
Package maven implements Maven build tool support for Java projects.
|
Package maven implements Maven build tool support for Java projects. |
|
Package php implements omnibump support for PHP projects.
|
Package php implements omnibump support for PHP projects. |
|
composer
Package composer implements Composer build tool support for PHP projects within omnibump.
|
Package composer implements Composer build tool support for PHP projects within omnibump. |
|
Package rust implements omnibump support for Rust projects.
|
Package rust implements omnibump support for Rust projects. |