buck

package
v0.7.23 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package buck implements the analyzer for Buck. https://buckbuild.com

A `BuildTarget` in Buck is defined as a Build Target by Buck which is in in the format of `//src/build:target`. Buck defines this as a string used to identify a Build Rule.

This package is implemented by externally calling the `buck` build tool.

FAQ

1. Why is analyzing manifest files not a supported strategy as it is for other tools?

`.buckconfig` can be used to discover cells but the `repository` field which defines cells is not required . `BUCK` files are written in Skylark (a dialect of Python) and are impossible to statically analyze. `buck audit` provides json formatted data for dependency and input information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discover

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

Discover is used to operate Discovery with a custom `buck` command.

func DiscoverWithCommand

func DiscoverWithCommand(dir string, opts map[string]interface{}, buckCommand func(string, ...string) (string, error)) ([]module.Module, error)

DiscoverWithCommand finds a Buck project by first looking for a ".buckconfig" file and then a "BUCK" file.

  1. ".buckconfig" file is found and we know that that we are at the root of a Buck cell. a. Attempt to find user defined aliases in .buckconfig. b. No aliases, run `buck targets //` to find all local targets.
  2. "BUCK" file is found. a. Run `buck targets <directory>:` to find all local targets.

Types

type Analyzer

type Analyzer struct {
	Module module.Module
	Upload bool
	Setup  buck.Buck
}

Analyzer defines a Buck analyzer.

func New

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

New constructs a new Buck analyzer from a module.

func (*Analyzer) Analyze

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

Analyze analyzes a buck build target and its dependencies.

func (*Analyzer) Build

func (a *Analyzer) Build() error

Build is not implemented.

func (*Analyzer) Clean

func (a *Analyzer) Clean() error

Clean is not implemented.

func (*Analyzer) IsBuilt

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

IsBuilt is not implemented.

Jump to

Keyboard shortcuts

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