Documentation
¶
Index ¶
Constants ¶
View Source
const ( Mix = ProjectID(iota + 10) Python Go Node Flutter Rust MaxProjectID )
Variables ¶
View Source
var RustVersionRE = regexp.MustCompile(`(?m)^\s*version\s*=\s*"(.+)"`)
Functions ¶
Types ¶
type FlutterProject ¶ added in v0.2.1
type FlutterProject struct {
// contains filtered or unexported fields
}
func (*FlutterProject) GetVersion ¶ added in v0.2.1
func (p *FlutterProject) GetVersion() (*version.Version, error)
func (*FlutterProject) ID ¶ added in v0.2.1
func (p *FlutterProject) ID() ProjectID
func (*FlutterProject) IsMe ¶ added in v0.2.1
func (p *FlutterProject) IsMe(workdir string) bool
func (*FlutterProject) SetVersion ¶ added in v0.2.1
func (p *FlutterProject) SetVersion(v *version.Version) error
func (*FlutterProject) WorkDir ¶ added in v0.2.1
func (p *FlutterProject) WorkDir() string
type GoProject ¶
type GoProject struct {
// contains filtered or unexported fields
}
GoProject represents a Go project with versioning capabilities Because Go projects do not have a standard version file, we flow the rules below:
- lookup the project by checking the existence of "version.txt"
- this file can be embedded to a go variable use `go:embed` directive
- the file content should be like `x.y.z`
type MixProject ¶ added in v0.2.1
type MixProject struct {
// contains filtered or unexported fields
}
func (*MixProject) GetVersion ¶ added in v0.2.1
func (p *MixProject) GetVersion() (*version.Version, error)
func (*MixProject) ID ¶ added in v0.2.1
func (p *MixProject) ID() ProjectID
func (*MixProject) IsMe ¶ added in v0.2.1
func (p *MixProject) IsMe(workdir string) bool
func (*MixProject) SetVersion ¶ added in v0.2.1
func (p *MixProject) SetVersion(v *version.Version) error
func (*MixProject) WorkDir ¶ added in v0.2.1
func (p *MixProject) WorkDir() string
type NodeProject ¶
type NodeProject struct {
// contains filtered or unexported fields
}
func (*NodeProject) GetVersion ¶
func (p *NodeProject) GetVersion() (*version.Version, error)
func (*NodeProject) ID ¶
func (p *NodeProject) ID() ProjectID
func (*NodeProject) IsMe ¶
func (p *NodeProject) IsMe(workdir string) bool
func (*NodeProject) SetVersion ¶
func (p *NodeProject) SetVersion(v *version.Version) error
func (*NodeProject) WorkDir ¶
func (p *NodeProject) WorkDir() string
type Project ¶
type Project interface {
// Test if the project is of the specified type
IsMe(workdir string) bool
// Get the project ID
ID() ProjectID
// Get the working directory of the project
WorkDir() string
// Get the current version of the project
GetVersion() (*version.Version, error)
// Set a new version for the project
SetVersion(v *version.Version) error
}
Project represents a generic project with versioning capabilities
type ProjectID ¶
type ProjectID int
func ParseProjectID ¶
type PythonProject ¶
type PythonProject struct {
// contains filtered or unexported fields
}
func (*PythonProject) GetVersion ¶
func (p *PythonProject) GetVersion() (*version.Version, error)
func (*PythonProject) ID ¶
func (p *PythonProject) ID() ProjectID
func (*PythonProject) IsMe ¶
func (p *PythonProject) IsMe(workdir string) bool
func (*PythonProject) SetVersion ¶
func (p *PythonProject) SetVersion(v *version.Version) error
func (*PythonProject) WorkDir ¶
func (p *PythonProject) WorkDir() string
type RustProject ¶
type RustProject struct {
// contains filtered or unexported fields
}
func (*RustProject) GetVersion ¶
func (p *RustProject) GetVersion() (*version.Version, error)
func (*RustProject) ID ¶
func (p *RustProject) ID() ProjectID
func (*RustProject) IsMe ¶
func (p *RustProject) IsMe(workdir string) bool
func (*RustProject) SetVersion ¶
func (p *RustProject) SetVersion(v *version.Version) error
func (*RustProject) WorkDir ¶
func (p *RustProject) WorkDir() string
Click to show internal directories.
Click to hide internal directories.