gradle

package
v0.7.28 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: MPL-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd(command string, taskArgs ...string) (string, error)

Cmd executes the gradle shell command.

func Dependencies added in v0.7.24

func Dependencies(project string, i Input) (map[string]graph.Deps, error)

Dependencies returns the dependencies of a gradle project

func MergeProjectsDependencies added in v0.7.24

func MergeProjectsDependencies(i Input, projects []string) (map[string]graph.Deps, error)

MergeProjectsDependencies creates a complete configuration to dep graph map by looping through a given list of projects and merging their dependencies by configuration.

func NormalizeDependencies added in v0.7.17

func NormalizeDependencies(imports []Dependency, deps map[Dependency][]Dependency) graph.Deps

NormalizeDependencies turns a dependency map into a FOSSA recognized dependency graph.

func ValidBinary added in v0.7.24

func ValidBinary(dir string) (string, error)

ValidBinary finds the best possible gradle command to run for shell commands.

Types

type Dependency

type Dependency struct {
	Name             string
	RequestedVersion string
	ResolvedVersion  string
	IsProject        bool
}

Dependency models a gradle dependency.

func ParseDependencies

func ParseDependencies(stdout string) ([]Dependency, map[Dependency][]Dependency, error)

func ReadDependencyTree

func ReadDependencyTree(lines []string, parser LineParser) ([]Dependency, map[Dependency][]Dependency, error)

type Input added in v0.7.24

type Input interface {
	ProjectDependencies(...string) (map[string]graph.Deps, error)
	DependencyTasks() ([]string, error)
}

Input is an interface for any point where gradle analysis requires input from a file, shell command, or other source.

func NewShellInput added in v0.7.24

func NewShellInput(binary, dir string, online bool) Input

NewShellInput creates a new ShellCommand and returns it as an Input.

type LineParser

type LineParser func(line string) (level int, node Dependency, err error)

level is 1-indexed

type ShellCommand added in v0.7.24

type ShellCommand struct {
	Binary string
	Dir    string
	Online bool
	Cmd    func(string, ...string) (string, error)
}

ShellCommand controls the information needed to run a gradle command.

func (ShellCommand) DependencyTasks added in v0.7.24

func (s ShellCommand) DependencyTasks() ([]string, error)

DependencyTasks returns a list of gradle projects by analyzing a list of gradle tasks.

func (ShellCommand) ProjectDependencies added in v0.7.24

func (s ShellCommand) ProjectDependencies(taskArgs ...string) (map[string]graph.Deps, error)

ProjectDependencies returns the dependencies of a given gradle project

Jump to

Keyboard shortcuts

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