module

package
v0.6.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2018 License: MPL-2.0 Imports: 6 Imported by: 0

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

Types holds the list of all available module types for analysis

Functions

func NormalizeGitURL added in v0.6.1

func NormalizeGitURL(project string) string

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 GoOptions added in v0.6.1

type GoOptions struct {
	AllowUnresolved bool
}

type GradleOptions added in v0.6.1

type GradleOptions struct {
	Task          string
	Configuration string
}

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 ReadLocator(s string) Locator

func (Locator) IsResolved added in v0.6.1

func (l Locator) IsResolved() bool

func (Locator) String added in v0.6.1

func (l Locator) String() string

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.

func New added in v0.4.0

func New(moduleType Type, conf Config) (Module, error)

New instantiates and sets up a Module for a given ModuleType

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
}

type Type

type Type string

Type is an enumeration of supported build system types

func Parse added in v0.4.5

func Parse(key string) (Type, error)

Parse returns a module Type given a string

Jump to

Keyboard shortcuts

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