Documentation ¶
Index ¶
- type BowerBuilder
- func (builder *BowerBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
- func (builder *BowerBuilder) Build(m module.Module, force bool) error
- func (builder *BowerBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
- func (builder *BowerBuilder) Initialize() error
- func (builder *BowerBuilder) IsBuilt(m module.Module, allowUnresolved bool) (bool, error)
- func (builder *BowerBuilder) IsModule(target string) (bool, error)
- type BowerComponent
- type Builder
- type ComposerBuilder
- func (builder *ComposerBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
- func (builder *ComposerBuilder) Build(m module.Module, force bool) error
- func (builder *ComposerBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
- func (builder *ComposerBuilder) Initialize() error
- func (builder *ComposerBuilder) IsBuilt(m module.Module, allowUnresolved bool) (bool, error)
- func (builder *ComposerBuilder) IsModule(target string) (bool, error)
- type ComposerPackage
- type GoBuilder
- func (builder *GoBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
- func (builder *GoBuilder) Build(m module.Module, force bool) error
- func (builder *GoBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
- func (builder *GoBuilder) Initialize() error
- func (builder *GoBuilder) IsBuilt(m module.Module, allowUnresolved bool) (bool, error)
- func (builder *GoBuilder) IsModule(target string) (bool, error)
- type GoPkg
- type GradleBuilder
- func (builder *GradleBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
- func (builder *GradleBuilder) Build(m module.Module, force bool) error
- func (builder *GradleBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
- func (builder *GradleBuilder) Initialize() error
- func (builder *GradleBuilder) IsBuilt(m module.Module, allowUnresolved bool) (bool, error)
- func (builder *GradleBuilder) IsModule(target string) (bool, error)
- type MavenArtifact
- type MavenBuilder
- func (builder *MavenBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
- func (builder *MavenBuilder) Build(m module.Module, force bool) error
- func (builder *MavenBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
- func (builder *MavenBuilder) Initialize() error
- func (builder *MavenBuilder) IsBuilt(m module.Module, allowUnresolved bool) (bool, error)
- func (builder *MavenBuilder) IsModule(target string) (bool, error)
- type NodeJSBuilder
- func (builder *NodeJSBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
- func (builder *NodeJSBuilder) Build(m module.Module, force bool) error
- func (builder *NodeJSBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
- func (builder *NodeJSBuilder) Initialize() error
- func (builder *NodeJSBuilder) IsBuilt(m module.Module, allowUnresolved bool) (bool, error)
- func (builder *NodeJSBuilder) IsModule(target string) (bool, error)
- type NodeModule
- type POMFile
- type RubyBuilder
- func (builder *RubyBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
- func (builder *RubyBuilder) Build(m module.Module, force bool) error
- func (builder *RubyBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
- func (builder *RubyBuilder) Initialize() error
- func (builder *RubyBuilder) IsBuilt(m module.Module, allowUnresolved bool) (bool, error)
- func (builder *RubyBuilder) IsModule(target string) (bool, error)
- type RubyGem
- type SBTBuilder
- func (builder *SBTBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
- func (builder *SBTBuilder) Build(m module.Module, force bool) error
- func (builder *SBTBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
- func (builder *SBTBuilder) Initialize() error
- func (builder *SBTBuilder) IsBuilt(m module.Module, allowUnresolved bool) (bool, error)
- func (builder *SBTBuilder) IsModule(target string) (bool, error)
- type SBTLibrary
- type VendoredArchiveBuilder
- func (builder *VendoredArchiveBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
- func (builder *VendoredArchiveBuilder) Build(m module.Module, force bool) error
- func (builder *VendoredArchiveBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
- func (builder *VendoredArchiveBuilder) Initialize() error
- func (builder *VendoredArchiveBuilder) IsBuilt(m module.Module, allowUnresolved bool) (bool, error)
- func (builder *VendoredArchiveBuilder) IsModule(target string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BowerBuilder ¶
BowerBuilder implements Builder for Bower
func (*BowerBuilder) Analyze ¶
func (builder *BowerBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
Analyze reads dependency manifests at `$PROJECT/**/bower_components/*/.bower.json`
func (*BowerBuilder) Build ¶
func (builder *BowerBuilder) Build(m module.Module, force bool) error
Build runs `bower install --production` and cleans with `rm -rf bower_components`
func (*BowerBuilder) DiscoverModules ¶
func (builder *BowerBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
DiscoverModules finds any bower.json modules not in node_modules or bower_components folders
func (*BowerBuilder) Initialize ¶
func (builder *BowerBuilder) Initialize() error
Initialize collects metadata on Node and Bower binaries
type BowerComponent ¶
BowerComponent implements Dependency for BowerBuilder
func (BowerComponent) Fetcher ¶
func (m BowerComponent) Fetcher() string
Fetcher always returns bower for BowerComponent
func (BowerComponent) Package ¶
func (m BowerComponent) Package() string
Package returns the package name for BowerComponent
func (BowerComponent) Revision ¶
func (m BowerComponent) Revision() string
Revision returns the version for BowerComponent
type Builder ¶
type Builder interface { // Initialize gathers build environment information and does build setup. Initialize() error // Build runs a best-effort attempt at building the module. Build(m module.Module, force bool) error // Analyze returns the dependencies of a module. Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error) // IsBuilt checks whether a module has been built. IsBuilt(m module.Module, allowUnresolved bool) (bool, error) // IsModule takes a string like and returns whether it matches to elect this Builder. IsModule(configKey string) (bool, error) // DiscoverModules finds what modules are available for analysis in a given directory. DiscoverModules(dir string) ([]config.ModuleConfig, error) }
A Builder is an implementation of functionality for different build systems.
func New ¶
func New(moduleType config.ModuleType) Builder
New instantiates a Builder given a ModuleType
type ComposerBuilder ¶
type ComposerBuilder struct { PHPCmd string PHPVersion string ComposerCmd string ComposerVersion string }
ComposerBuilder implements Builder for Composer (composer.json) builds
func (*ComposerBuilder) Analyze ¶
func (builder *ComposerBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
Analyze parses the output of `composer show -f json --no-ansi`
func (*ComposerBuilder) Build ¶
func (builder *ComposerBuilder) Build(m module.Module, force bool) error
Build runs `composer install --prefer-dist --no-dev` and cleans with `rm -rf vendor`
func (*ComposerBuilder) DiscoverModules ¶
func (builder *ComposerBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
DiscoverModules finds composer.json modules not a /vendor/ folder
func (*ComposerBuilder) Initialize ¶
func (builder *ComposerBuilder) Initialize() error
Initialize collects metadata on PHP and Composer binaries
type ComposerPackage ¶
ComposerPackage implements Dependency for Composer
func (ComposerPackage) Fetcher ¶
func (m ComposerPackage) Fetcher() string
Fetcher always returns comp for ComposerPackage
func (ComposerPackage) Package ¶
func (m ComposerPackage) Package() string
Package returns the package spec for ComposerPackage
func (ComposerPackage) Revision ¶
func (m ComposerPackage) Revision() string
Revision returns the version spec for ComposerPackage
type GoBuilder ¶
type GoBuilder struct { GoCmd string GoVersion string // dep DepCmd string DepVersion string // glide GlideCmd string GlideVersion string // godep GodepCmd string GodepVersion string // govendor GovendorCmd string GovendorVersion string // vndr VndrCmd string VndrVersion string // gdm GdmCmd string GdmVersion string }
GoBuilder implements Builder for Golang projects
func (*GoBuilder) Analyze ¶
func (builder *GoBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
Analyze traces imports and then looks up revisions in lockfiles
func (*GoBuilder) DiscoverModules ¶
func (builder *GoBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
DiscoverModules walks subdirectories for a Go file with `package main`.
func (*GoBuilder) Initialize ¶
Initialize collects metadata on Go, Dep, Glide, Godep, Govendor, and Vndr binaries.
type GoPkg ¶
type GoPkg struct { ImportPath string `json:"name"` Version string `json:"version"` // This is actually the Git revision, but `.Revision()` is already taken by Dependency. // contains filtered or unexported fields }
GoPkg implements Dependency for Golang projects.
type GradleBuilder ¶ added in v0.4.1
GradleBuilder implements Builder for build.gradle builds
func (*GradleBuilder) Analyze ¶ added in v0.4.1
func (builder *GradleBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
Analyze parses the output of `gradle -q app:dependencies`
func (*GradleBuilder) Build ¶ added in v0.4.1
func (builder *GradleBuilder) Build(m module.Module, force bool) error
Build is not implemented
func (*GradleBuilder) DiscoverModules ¶ added in v0.4.1
func (builder *GradleBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
DiscoverModules finds either a root build.gradle file in the specified dir
func (*GradleBuilder) Initialize ¶ added in v0.4.1
func (builder *GradleBuilder) Initialize() error
Initialize collects metadata on Java and Maven binaries
type MavenArtifact ¶
MavenArtifact implements Dependency for Maven builds
func (MavenArtifact) Fetcher ¶
func (m MavenArtifact) Fetcher() string
Fetcher always returns mvn for MavenArtifact
func (MavenArtifact) Package ¶
func (m MavenArtifact) Package() string
Package returns the package spec for MavenArtifact
func (MavenArtifact) Revision ¶
func (m MavenArtifact) Revision() string
Revision returns the version spec for MavenArtifact
type MavenBuilder ¶
MavenBuilder implements Builder for Apache Maven (*.pom.xml) builds
func (*MavenBuilder) Analyze ¶
func (builder *MavenBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
Analyze parses the output of `mvn dependency:list`
func (*MavenBuilder) Build ¶
func (builder *MavenBuilder) Build(m module.Module, force bool) error
Build runs `mvn install -DskipTests -Drat.skip=trucould not removee` and cleans with `mvn clean`
func (*MavenBuilder) DiscoverModules ¶
func (builder *MavenBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
DiscoverModules finds either a root pom.xml file or all pom.xmls in the specified dir
func (*MavenBuilder) Initialize ¶
func (builder *MavenBuilder) Initialize() error
Initialize collects metadata on Java and Maven binaries
type NodeJSBuilder ¶
type NodeJSBuilder struct { NodeCmd string NodeVersion string NPMCmd string NPMVersion string YarnCmd string YarnVersion string }
NodeJSBuilder implements Builder for Nodejs. These properties are public for the sake of serialization.
func (*NodeJSBuilder) Analyze ¶
func (builder *NodeJSBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
Analyze reads dependency manifests at `$PROJECT/**/node_modules/*/package.json`
func (*NodeJSBuilder) Build ¶
func (builder *NodeJSBuilder) Build(m module.Module, force bool) error
Build runs either `yarn install --production --frozen-lockfile` or `npm install --production` and cleans with `rm -rf node_modules`
func (*NodeJSBuilder) DiscoverModules ¶
func (builder *NodeJSBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
DiscoverModules builds ModuleConfigs for any package.jsons that are not contained in a node_modules dir
func (*NodeJSBuilder) Initialize ¶
func (builder *NodeJSBuilder) Initialize() error
Initialize collects metadata on Node, NPM, and Yarn binaries
type NodeModule ¶
NodeModule implements Dependency for NodeJSBuilder.
func (NodeModule) Fetcher ¶
func (m NodeModule) Fetcher() string
Fetcher always returns npm for NodeModule. TODO: Support git and other dependency sources.
func (NodeModule) Package ¶
func (m NodeModule) Package() string
Package returns the package name for NodeModule
func (NodeModule) Revision ¶
func (m NodeModule) Revision() string
Revision returns the version for NodeModule
type POMFile ¶
type POMFile struct { XMLName xml.Name `xml:"project"` ArtifactID string `xml:"artifactId"` GroupID string `xml:"groupId"` Version string `xml:"version"` Description string `xml:"description"` Name string `xml:"name"` URL string `xml:"url"` }
POMFile represents the schema of a common pom.xml file
type RubyBuilder ¶
type RubyBuilder struct { BundlerCmd string BundlerVersion string GemCmd string GemVersion string RubyCmd string RubyVersion string }
RubyBuilder implements Builder for Bundler (Gemfile) builds
func (*RubyBuilder) Analyze ¶
func (builder *RubyBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
Analyze parses the output of `bundler list`
func (*RubyBuilder) Build ¶
func (builder *RubyBuilder) Build(m module.Module, force bool) error
Build runs `bundler install --deployment --frozen` and cleans with `rm Gemfile.lock`
func (*RubyBuilder) DiscoverModules ¶
func (builder *RubyBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
DiscoverModules returns ModuleConfigs that match Gemfiles in the directory
func (*RubyBuilder) Initialize ¶
func (builder *RubyBuilder) Initialize() error
Initialize collects metadata on Ruby, Gem, and Bundler binaries
type RubyGem ¶
RubyGem implements Dependency for Bundler and RubyGems.
type SBTBuilder ¶
SBTBuilder implements build context for SBT builds
func (*SBTBuilder) Analyze ¶
func (builder *SBTBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
Analyze parses the output of `sbt -no-colors dependencyList`
func (*SBTBuilder) Build ¶
func (builder *SBTBuilder) Build(m module.Module, force bool) error
Build runs `sbt compile` and cleans with `sbt clean`
func (*SBTBuilder) DiscoverModules ¶
func (builder *SBTBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
DiscoverModules returns a root build.sbt if found, and build configs for all sub-projects otherwise
func (*SBTBuilder) Initialize ¶
func (builder *SBTBuilder) Initialize() error
Initialize collects metadata on Java and SBT binaries
type SBTLibrary ¶
SBTLibrary implements Dependency for SBT library dependencies
func (SBTLibrary) Fetcher ¶
func (m SBTLibrary) Fetcher() string
Fetcher always returns mvn for SBTLibrary
func (SBTLibrary) Package ¶
func (m SBTLibrary) Package() string
Package returns the package spec for SBTLibrary
func (SBTLibrary) Revision ¶
func (m SBTLibrary) Revision() string
Revision returns the version spec for SBTLibrary
type VendoredArchiveBuilder ¶
VendoredArchiveBuilder implements Builder for projects that have archive-formatted rawDependencies encapsulating another supported build system
func (*VendoredArchiveBuilder) Analyze ¶
func (builder *VendoredArchiveBuilder) Analyze(m module.Module, allowUnresolved bool) ([]module.Dependency, error)
Analyze scans for archives and inspects them
func (*VendoredArchiveBuilder) Build ¶
func (builder *VendoredArchiveBuilder) Build(m module.Module, force bool) error
Build does nothing for VendoredArchives
func (*VendoredArchiveBuilder) DiscoverModules ¶
func (builder *VendoredArchiveBuilder) DiscoverModules(dir string) ([]config.ModuleConfig, error)
DiscoverModules is not implemented for VendoredArchiveBuilder, instead it must be explicitly configured
func (*VendoredArchiveBuilder) Initialize ¶
func (builder *VendoredArchiveBuilder) Initialize() error
Initialize gathers environment context.