Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
add go as a required dependency to build plan
Browse files Browse the repository at this point in the history
[#167707118]

Co-authored-by: Forest Eckhardt <[email protected]>
  • Loading branch information
dwillist and ForestEckhardt committed Aug 16, 2019
1 parent 1516250 commit c25a129
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/detect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

const MissingGopkgErrorMsg = "no Gopkg.toml found at root level"
const EmptyTargetEnvVariableMsg = "BP_GO_TARGETS set but with empty value"
const GoDependency = "go"

type BuildpackYAML struct {
Config Config `yaml:"go"`
Expand Down Expand Up @@ -87,6 +88,8 @@ func runDetect(context detect.Detect) (int, error) {
Requires: []buildplan.Required{{
Name: dep.Dependency,
Metadata: metadata,
}, {
Name: GoDependency,
}},
})
}
Expand All @@ -98,6 +101,8 @@ func runDetect(context detect.Detect) (int, error) {
Requires: []buildplan.Required{{
Name: dep.Dependency,
Metadata: buildplan.Metadata{"build": true},
}, {
Name: GoDependency,
}},
})
}
8 changes: 8 additions & 0 deletions cmd/detect/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func testDetect(t *testing.T, when spec.G, it spec.S) {
Requires: []buildplan.Required{{
Name: dep.Dependency,
Metadata: buildplan.Metadata{"build": true},
}, {
Name: GoDependency,
}},
}))
})
Expand Down Expand Up @@ -89,6 +91,8 @@ go:
"import-path": "some/app",
"targets": []string{"./path/to/first", "./path/to/second"},
},
}, {
Name: GoDependency,
}},
}

Expand All @@ -112,6 +116,8 @@ go:
"build": true,
"import-path": "some/app",
"targets": []string{"./path/to/third", "./path/to/fourth"}},
},{
Name: GoDependency,
}},
}

Expand Down Expand Up @@ -151,6 +157,8 @@ go:
Requires: []buildplan.Required{{
Name: dep.Dependency,
Metadata: buildplan.Metadata{"build": true},
}, {
Name: GoDependency,
}},
}))
})
Expand Down

0 comments on commit c25a129

Please sign in to comment.