Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Bower is the module type for bower.io Bower = Type("bower") // Cocoapods is the module type for cocoapods Cocoapods = Type("cocoapods") // Composer is the module type for getcomposer.org Composer = Type("composer") // Maven is the module type for maven.apache.org Maven = Type("maven") // SBT is the module type for scala-sbt.org SBT = Type("sbt") // Gradle is the module type for gradle.org Gradle = Type("gradle") // NuGet is the module type for nuget.org NuGet = Type("nuget") // Pip is the module type for https://pip.pypa.io/en/stable/ Pip = Type("pip") // Ruby is the module type for Bundler (bundler.io) Ruby = Type("ruby") // Nodejs is the module type for NPM (npmjs.org) and Yarn (yarnpkg.com) Nodejs = Type("nodejs") // Golang is the module type for dep, glide, godep, govendor, vndr, and manual // gopath vendoring Golang = Type("golang") // VendoredArchives is a module type for archive formats (.tar, .rpm, .zip, etc...) VendoredArchives = Type("vendoredarchives") )
Variables ¶
View Source
var Types = []Type{Bower, Cocoapods, Composer, Maven, SBT, Gradle, NuGet, Pip, Ruby, Nodejs, Golang, VendoredArchives}
Types holds the list of all available module types for analysis
Functions ¶
func NormalizeGitURL ¶ added in v0.6.1
Types ¶
type Analyzed ¶ added in v0.6.1
type Analyzed struct {
Module Module
Builder Builder
Dependencies []Dependency
}
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, force bool) error
// Analyze returns the dependencies of a module.
Analyze(m Module, allowUnresolved bool) ([]Dependency, error)
// IsBuilt checks whether a module has been built.
IsBuilt(m Module, allowUnresolved bool) (bool, error)
// IsModule takes a string module type and returns whether it matches to use this Builder.
IsModule(key string) (bool, error)
// DiscoverModules finds what modules are available for analysis in a given directory.
DiscoverModules(dir string) ([]Config, error)
}
A Builder is an implementation of functionality for different build systems.
type Config ¶ added in v0.4.5
type Config struct {
Name string `yaml:"name"`
Path string `yaml:"path"` // this should really be renamed to Target (for e.g. Golang with gopaths or .NET or Maven with manifest files)
Type string `yaml:"type"`
Options Options `yaml:"options"`
}
Config defines a config for a builder's entry point
type Dependency ¶
type Dependency struct {
Locator
Via []ImportPath
}
Dependency represents a code library brought in by running a Build
type GradleOptions ¶ added in v0.6.1
type ImportPath ¶ added in v0.6.1
type ImportPath []Locator
func ReadImportPath ¶ added in v0.6.1
func ReadImportPath(s ImportPathString) ImportPath
func (ImportPath) String ¶ added in v0.6.1
func (p ImportPath) String() ImportPathString
type ImportPathString ¶ added in v0.6.1
type ImportPathString string
type Locator ¶
type Locator struct {
Fetcher string `json:"fetcher"`
Project string `json:"package"`
Revision string `json:"revision"`
}
func ReadLocator ¶ added in v0.6.1
func (Locator) IsResolved ¶ added in v0.6.1
type MavenOptions ¶ added in v0.6.1
type MavenOptions struct {
Settings string
}
type Module ¶
type Module struct {
Name string
Type Type
// Target is the entry point or manifest path for the build system. The exact
// meaning is Type-dependent.
Target string
// Dir is the absolute path to the module's working directory (the directory
// you would normally run the build command from).
Dir string
// Different modules in a monolith may correspond to different FOSSA projects
// or revisions.
// TODO: use these values.
Project string
Revision string
// A catch-all for builders to add metadata (a la Context.Value).
Context interface{}
}
A Module is a unit of buildable code within a project.
type NuGetOptions ¶ added in v0.6.1
type NuGetOptions struct {
TargetFramework string
}
type Options ¶
type Options struct {
Go GoOptions
Python PythonOptions
Gradle GradleOptions
Maven MavenOptions
NuGet NuGetOptions
}
type PythonOptions ¶ added in v0.6.1
type PythonOptions struct {
Strategy string
}
Click to show internal directories.
Click to hide internal directories.