Documentation ¶
Index ¶
- func Locator(d Dependency) string
- type BowerContext
- type Build
- type BuildContext
- type CommonJSContext
- type CommonJSModule
- type ComposerContext
- type ComposerPackage
- type Dependency
- type GemContext
- type GolangContext
- type Gopkg
- type MavenArtifact
- type MavenContext
- type Module
- type NormalizedDependency
- type RubyGem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Locator ¶
func Locator(d Dependency) string
Locator transforms Dependencies into locator strings
Types ¶
type BowerContext ¶
type BowerContext struct { BowerCmd string BowerVersion string // contains filtered or unexported fields }
func (*BowerContext) Build ¶
func (ctx *BowerContext) Build(m *Module, opts map[string]interface{}) error
Build determines and executes a CommonJS build based off available tooling in the environment
func (*BowerContext) Initialize ¶
func (ctx *BowerContext) Initialize(m *Module, opts map[string]interface{})
Initialize collects environment data for CommonJS builds
type Build ¶
type Build struct { Artifact string // i.e. dev_server Context *BuildContext `json:",omitempty"` // build context Succeeded bool Error error `json:",omitempty"` RawDependencies []Dependency `json:"-"` Dependencies []NormalizedDependency }
Build represents a task that builds a single artifact and generates dependency lists
type BuildContext ¶
type BuildContext interface { Initialize(m *Module, opts map[string]interface{}) Verify(m *Module, opts map[string]interface{}) bool Build(m *Module, opts map[string]interface{}) error }
BuildContext describes instances that contain metadata and logic to run a build
type CommonJSContext ¶
type CommonJSContext struct { NodeCmd string NodeVersion string NpmCmd string NpmVersion string YarnCmd string YarnVersion string HasYarnLockFile bool // contains filtered or unexported fields }
CommonJSContext implements build context for node_module & package.json builds
func (*CommonJSContext) Build ¶
func (ctx *CommonJSContext) Build(m *Module, opts map[string]interface{}) error
Build determines and executes a CommonJS build based off available tooling in the environment
func (*CommonJSContext) Initialize ¶
func (ctx *CommonJSContext) Initialize(m *Module, opts map[string]interface{})
Initialize collects environment data for CommonJS builds
type CommonJSModule ¶
type CommonJSModule struct { Name string `json:"name"` Version string `json:"version"` // contains filtered or unexported fields }
CommonJSModule represents metadata from package.json files
func (CommonJSModule) Fetcher ¶
func (m CommonJSModule) Fetcher() string
Fetcher always returns npm for CommonJSModules
func (CommonJSModule) Package ¶
func (m CommonJSModule) Package() string
Package returns the package spec for CommonJSModules
func (CommonJSModule) Revision ¶
func (m CommonJSModule) Revision() string
Revision returns the version spec for CommonJSModules
type ComposerContext ¶
type ComposerContext struct { ComposerCmd string ComposerVersion string PhpCmd string PhpVersion string // contains filtered or unexported fields }
ComposerContext implements build context for Composer (composer.json) builds
func (*ComposerContext) Build ¶
func (ctx *ComposerContext) Build(m *Module, opts map[string]interface{}) error
Build runs Bundler and collect dep data
func (*ComposerContext) Initialize ¶
func (ctx *ComposerContext) Initialize(p *Module, opts map[string]interface{})
Initialize collects environment data for Bundler builds
type ComposerPackage ¶
type ComposerPackage struct { Name string `json:"name"` Version string `json:"version"` // contains filtered or unexported fields }
ComposerPackage represents metadata from Composer files
func (ComposerPackage) Fetcher ¶
func (m ComposerPackage) Fetcher() string
Fetcher always returns npm 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 Dependency ¶
Dependency represents a code library brought in by running a Build
func Dedupe ¶
func Dedupe(dependencies []Dependency) []Dependency
Dedupe removes duplicates from a []Dependency
type GemContext ¶
type GemContext struct { GemCmd string GemVersion string BundlerCmd string BundlerVersion string // contains filtered or unexported fields }
GemContext implements build context for Bundler (Gemfile and *.gemspec) builds
func (*GemContext) Build ¶
func (ctx *GemContext) Build(m *Module, opts map[string]interface{}) error
Build runs Bundler and collect dep data
func (*GemContext) Initialize ¶
func (ctx *GemContext) Initialize(p *Module, opts map[string]interface{})
Initialize collects environment data for Bundler builds
type GolangContext ¶
type GolangContext struct { GoCmd string GoVersion string // dep UsingDep bool DepCmd string DepVersion string // glide UsingGlide bool GlideCmd string GlideVersion string // godep UsingGodep bool GodepCmd string GodepVersion string // govendor UsingGovendor bool GovendorCmd string GovendorVersion string // vndr UsingVndr bool VndrCmd string VndrVersion string // contains filtered or unexported fields }
GolangContext implements BuildContext for Golang projects
func (*GolangContext) Build ¶
func (ctx *GolangContext) Build(m *Module, opts map[string]interface{}) error
Build scans for dependencies, building if necessary.
func (*GolangContext) Initialize ¶
func (ctx *GolangContext) Initialize(m *Module, opts map[string]interface{})
Initialize gathers environment context.
type Gopkg ¶
type Gopkg struct { ImportPath string Version string // This is actually the Git revision, but `.Revision()` is already taken. }
Gopkg implements Dependency for Golang projects.
type MavenArtifact ¶
MavenArtifact represents metadata from pom.xml files
func (MavenArtifact) Fetcher ¶
func (m MavenArtifact) Fetcher() string
Fetcher always returns npm 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 MavenContext ¶
type MavenContext struct { MvnCmd string MvnVersion string JavaCmd string JavaVersion string // contains filtered or unexported fields }
MavenContext implements build context for Apache Maven (*pom.xml) builds
func (*MavenContext) Build ¶
func (ctx *MavenContext) Build(m *Module, opts map[string]interface{}) error
Build runs Bundler and collect dep data
func (*MavenContext) Initialize ¶
func (ctx *MavenContext) Initialize(p *Module, opts map[string]interface{})
Initialize collects environment data for Bundler builds
type Module ¶
type Module struct { Name string Type string Manifest string // Required, path to an entry point for the Module _relative_ to repo root. Used for origin paths & ID. Dir string `json:",omitempty"` Data *json.RawMessage `json:",omitempty"` // TODO: add support for multiple builds via []Build Build Build `json:",omitempty"` }
Module represents a unit of buildable code within a codebase Each Module must have a single entry point / manifest where a build can initiate Currently only single build context is supported per module
type NormalizedDependency ¶
type NormalizedDependency struct { // Location Locator string `json:"locator"` // Metadata Data *json.RawMessage `json:"data,omitempty"` // Context Depth int `json:"depth,omitempty"` Parent string `json:"parent,omitempty"` UnresolvedLocators []string `json:"unresolved_locators,omitempty"` }
func Normalize ¶
func Normalize(d Dependency) NormalizedDependency
Normalize transforms a Dependency into a serializable struct