Add GSP project manifest and design layout
This commit is contained in:
@@ -9,8 +9,15 @@ import (
|
||||
func (p *Project) Validate(stage string) Report {
|
||||
report := Report{OK: true}
|
||||
for _, issue := range p.LoadIssues {
|
||||
report.Errors = append(report.Errors, issue)
|
||||
report.OK = false
|
||||
switch issue.Level {
|
||||
case "error":
|
||||
report.Errors = append(report.Errors, issue)
|
||||
report.OK = false
|
||||
case "warning":
|
||||
report.Warnings = append(report.Warnings, issue)
|
||||
default:
|
||||
report.Notices = append(report.Notices, issue)
|
||||
}
|
||||
}
|
||||
for _, unit := range p.Units {
|
||||
if unit.ID == "" {
|
||||
@@ -81,15 +88,17 @@ func (p *Project) Index() []IndexEntry {
|
||||
return entries
|
||||
}
|
||||
|
||||
var defaultStageRules = map[string]string{
|
||||
"design": "L0",
|
||||
"integrate": "L2",
|
||||
"implement": "L3",
|
||||
"bind": "L4",
|
||||
"release": "L5",
|
||||
}
|
||||
|
||||
func (p *Project) StageCheck(stage string) Report {
|
||||
report := Report{OK: true}
|
||||
required, ok := map[string]string{
|
||||
"design": "L0",
|
||||
"integrate": "L2",
|
||||
"implement": "L3",
|
||||
"bind": "L4",
|
||||
"release": "L5",
|
||||
}[stage]
|
||||
required, ok := p.Manifest.minResolution(stage)
|
||||
if !ok {
|
||||
report.addError("unknown_stage", "", "", fmt.Sprintf("unknown stage %q", stage))
|
||||
return report
|
||||
|
||||
Reference in New Issue
Block a user