gradle

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MPL-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package gradle implements analyzers for Gradle.

A `BuildTarget` in Gradle is `$PROJECT:$CONFIGURATION`, where the Gradle module would list its dependencies by running `gradle $PROJECT:dependencies --configuration=$CONFIGURATION`. The directory of the `build.gradle` file is specified by `Dir`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discover

func Discover(dir string, options map[string]interface{}) ([]module.Module, error)

Discover searches for `build.gradle` files and creates a module for each `*:dependencies` task in the output of `gradle tasks`.

TODO: use the output of `gradle projects` and try `gradle <project>:dependencies` for each project?

func DiscoverWithCommand added in v0.7.24

func DiscoverWithCommand(dir string, userOptions map[string]interface{}, command func(string, string, int, ...string) (string, error)) ([]module.Module, error)

Types

type Analyzer

type Analyzer struct {
	Module  module.Module
	Options Options
	Input   gradle.Input
}

func New

func New(m module.Module) (*Analyzer, error)

func (*Analyzer) Analyze

func (a *Analyzer) Analyze() (graph.Deps, error)

func (*Analyzer) Build

func (a *Analyzer) Build() error

func (*Analyzer) Clean

func (a *Analyzer) Clean() error

func (*Analyzer) IsBuilt

func (a *Analyzer) IsBuilt() (bool, error)

type Options

type Options struct {
	Cmd               string `mapstructure:"cmd"`
	Task              string `mapstructure:"task"`
	Online            bool   `mapstructure:"online"`
	AllSubmodules     bool   `mapstructure:"all-submodules"`
	AllConfigurations bool   `mapstructure:"all-configurations"`
	Timeout           string `mapstructure:"timeout"`
	Retries           int    `mapstructure:"retries"`
	// TODO: These are temporary until v2 configuration files (with proper BuildTarget) are implemented.
	Project       string `mapstructure:"project"`
	Configuration string `mapstructure:"configuration"`
}

Jump to

Keyboard shortcuts

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