Documentation
¶
Overview ¶
Package gradle implements Gradle build tool support for Java projects. Uses text-based parsing/updating to match real-world usage patterns.
Index ¶
- Constants
- Variables
- type Gradle
- func (g *Gradle) Detect(ctx context.Context, dir string) (bool, error)
- func (g *Gradle) GetAnalyzer() analyzer.Analyzer
- func (g *Gradle) GetManifestFiles() []string
- func (g *Gradle) Name() string
- func (g *Gradle) Update(ctx context.Context, cfg *languages.UpdateConfig) error
- func (g *Gradle) Validate(ctx context.Context, cfg *languages.UpdateConfig) error
- type GradleAnalyzer
- func (ga *GradleAnalyzer) Analyze(ctx context.Context, projectPath string) (*analyzer.AnalysisResult, error)
- func (ga *GradleAnalyzer) AnalyzeRemote(ctx context.Context, files map[string][]byte) (*analyzer.RemoteAnalysisResult, error)
- func (ga *GradleAnalyzer) RecommendStrategy(ctx context.Context, analysis *analyzer.AnalysisResult, ...) (*analyzer.Strategy, error)
Constants ¶
const ( // MaxManifestSize limits manifest file size to prevent resource exhaustion. MaxManifestSize = 10 * 1024 * 1024 // 10 MB )
Variables ¶
var ( // ErrInvalidVersion is returned when a version string fails validation. ErrInvalidVersion = errors.New("invalid version string: contains disallowed characters") // ErrRemoteAnalysisNotImplemented is returned when remote analysis is not implemented. ErrRemoteAnalysisNotImplemented = errors.New("remote analysis not yet implemented") // ErrNoBuildFiles is returned when no build.gradle files are found. ErrNoBuildFiles = errors.New("no build.gradle or build.gradle.kts files found") // ErrValidationFailed is returned when dependency validation fails. ErrValidationFailed = errors.New("validation failed") // ErrUnknownFileType is returned when an unknown Gradle file type is encountered. ErrUnknownFileType = errors.New("unknown Gradle file type") // ErrManifestTooLarge is returned when a manifest file exceeds size limits. ErrManifestTooLarge = errors.New("manifest file too large") )
Functions ¶
This section is empty.
Types ¶
type Gradle ¶
type Gradle struct{}
Gradle implements the BuildTool interface for Gradle projects.
func (*Gradle) GetAnalyzer ¶
GetAnalyzer returns the Gradle analyzer.
func (*Gradle) GetManifestFiles ¶
GetManifestFiles returns Gradle manifest files.
type GradleAnalyzer ¶
type GradleAnalyzer struct{}
GradleAnalyzer implements dependency analysis for Gradle projects.
func (*GradleAnalyzer) Analyze ¶
func (ga *GradleAnalyzer) Analyze(ctx context.Context, projectPath string) (*analyzer.AnalysisResult, error)
Analyze analyzes a Gradle project's dependencies.
func (*GradleAnalyzer) AnalyzeRemote ¶
func (ga *GradleAnalyzer) AnalyzeRemote(ctx context.Context, files map[string][]byte) (*analyzer.RemoteAnalysisResult, error)
AnalyzeRemote performs dependency analysis on remotely-fetched Gradle files. Not yet implemented for Gradle - returns error. TODO: Implement this function and use ctx for logging and files for analysis.
func (*GradleAnalyzer) RecommendStrategy ¶
func (ga *GradleAnalyzer) RecommendStrategy(ctx context.Context, analysis *analyzer.AnalysisResult, deps []analyzer.Dependency) (*analyzer.Strategy, error)
RecommendStrategy recommends an update strategy for given dependencies.