layout

package
v0.0.0-...-452753e Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Application describes project that results in executable
	Application = iota
	// Library is a project that other can depend on (include)
	Library = iota
	// HeaderOnly is a library that does not require linking
	HeaderOnly = iota
	// Unknown means project could not be identified
	Unknown = iota
)

Variables

View Source
var AppFs = afero.NewOsFs()

AppFs is a interface to the filesystem, used for mocking tests

Functions

This section is empty.

Types

type DefaultProject

type DefaultProject struct{}

DefaultProject represents default assumptions gb makes while building projects. Gb entire idea is based on Convention-over-Configuration, and Gb infers as much as possible from project folder sturcture. Similar to Ruby or Java's Maven.

func (DefaultProject) Get

func (DefaultProject) Get(projectRoot string, buildRoot string) (ProjectInfo, error)

type ProjectInfo

type ProjectInfo struct {
	Type              int8
	Name              string
	PublicIncludes    string
	Sources           []SourceFile
	Tests             []SourceFile
	TestsIncludes     []string
	HasTests          bool
	HasPublicIncludes bool
	Path              struct {
		Includes string
		Sources  string
		Tests    string
	}
	Dependencies []string
}

ProjectInfo contains all information needed to build a project

type ProjectLayout

type ProjectLayout interface {
	Get(projectRoot string, buildRoot string) (ProjectInfo, error)
}

ProjectLayout provides set of functions for describing C++ project

func NewDefaultProjectLayout

func NewDefaultProjectLayout() ProjectLayout

NewDefaultProjectLayout returns implementation of ProjectLayout for Gb default layout

type SourceFile

type SourceFile struct {
	FullPath  string
	RelPath   string
	BaseName  string
	Extension string
}

SourceFile handles metainformation for file that can be compiled

func GetProjectFiles

func GetProjectFiles(root string, globPattern string, buildRoot string) ([]SourceFile, error)

Jump to

Keyboard shortcuts

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