gradle

package
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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

View Source
const (

	// MaxManifestSize limits manifest file size to prevent resource exhaustion.
	MaxManifestSize = 10 * 1024 * 1024 // 10 MB
)

Variables

View Source
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) Detect

func (g *Gradle) Detect(ctx context.Context, dir string) (bool, error)

Detect checks if Gradle manifest files exist in the directory.

func (*Gradle) GetAnalyzer

func (g *Gradle) GetAnalyzer() analyzer.Analyzer

GetAnalyzer returns the Gradle analyzer.

func (*Gradle) GetManifestFiles

func (g *Gradle) GetManifestFiles() []string

GetManifestFiles returns Gradle manifest files.

func (*Gradle) Name

func (g *Gradle) Name() string

Name returns the build tool identifier.

func (*Gradle) Update

func (g *Gradle) Update(ctx context.Context, cfg *languages.UpdateConfig) error

Update performs dependency updates on a Gradle project.

func (*Gradle) Validate

func (g *Gradle) Validate(ctx context.Context, cfg *languages.UpdateConfig) error

Validate checks if the updates were applied successfully. Re-parses build files and verifies that requested versions were actually updated.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL