Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (b *Builder) Build() (*platform.BuildMetadata, error) {
if err != nil {
return nil, err
}
slices = append(slices, bpTOML.Slices...)

b.Logger.Debug("Finding plan")
inputs.Plan = filteredPlan.Find(buildpack.KindBuildpack, bp.ID)
Expand Down
8 changes: 7 additions & 1 deletion builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,12 @@ func testBuilder(t *testing.T, when spec.G, it spec.S) {

when("slices", func() {
it("aggregates slices from each buildpack", func() {
bpA := &buildpack.BpDescriptor{Buildpack: buildpack.BpInfo{BaseInfo: buildpack.BaseInfo{ID: "A", Version: "v1"}}}
bpA := &buildpack.BpDescriptor{
Buildpack: buildpack.BpInfo{BaseInfo: buildpack.BaseInfo{ID: "A", Version: "v1"}},
Slices: []layers.Slice{
{Paths: []string{"static-path-from-buildpack-toml"}},
},
}
dirStore.EXPECT().LookupBp("A", "v1").Return(bpA, nil)
executor.EXPECT().Build(*bpA, gomock.Any(), gomock.Any()).Return(buildpack.BuildOutputs{
Slices: []layers.Slice{
Expand All @@ -895,6 +900,7 @@ func testBuilder(t *testing.T, when spec.G, it spec.S) {
metadata, err := builder.Build()
h.AssertNil(t, err)
if s := cmp.Diff(metadata.Slices, []layers.Slice{
{Paths: []string{"static-path-from-buildpack-toml"}},
{Paths: []string{"some-bpA-path", "some-other-bpA-path"}},
{Paths: []string{"duplicate-path"}},
{Paths: []string{"extra-path"}},
Expand Down
4 changes: 3 additions & 1 deletion buildpack/bp_descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"os"
"path/filepath"

"github.com/buildpacks/lifecycle/layers"

"github.com/BurntSushi/toml"
)

Expand All @@ -17,7 +19,7 @@ type BpDescriptor struct {
WithRootDir string `toml:"-"`
Targets []TargetMetadata `toml:"targets"`
Stacks []StackMetadata `tome:"stacks"` // just for backwards compat so we can check if it's the bionic stack, which we translate to a target

Slices []layers.Slice `toml:"slices"`
}

type StackMetadata struct {
Expand Down