forked from paketo-buildpacks/python-start
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetect.go
35 lines (31 loc) · 966 Bytes
/
detect.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package pythonstart
import "github.com/paketo-buildpacks/packit"
// BuildPlanMetadata is the buildpack specific data included in build plan
// requirements.
type BuildPlanMetadata struct {
// Launch flag requests the given requirement be made available during the
// launch phase of the buildpack lifecycle.
Launch bool `toml:"launch"`
}
// Detect will return a packit.DetectFunc that will be invoked during the
// detect phase of the buildpack lifecycle.
//
// This buildpack will always pass detection.
// It will require "cpython" as launch-time build plan requirements.
func Detect() packit.DetectFunc {
return func(context packit.DetectContext) (packit.DetectResult, error) {
return packit.DetectResult{
Plan: packit.BuildPlan{
Provides: []packit.BuildPlanProvision{},
Requires: []packit.BuildPlanRequirement{
{
Name: "cpython",
Metadata: BuildPlanMetadata{
Launch: true,
},
},
},
},
}, nil
}
}