Skip to content

Commit

Permalink
Include mixins when packaging
Browse files Browse the repository at this point in the history
Resolves #80
  • Loading branch information
Ryan Moran authored and sophiewigmore committed Nov 2, 2020
1 parent 859d48c commit 221d9dd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cargo/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ type Config struct {
}

type ConfigStack struct {
ID string `toml:"id" json:"id,omitempty"`
ID string `toml:"id" json:"id,omitempty"`
Mixins []string `toml:"mixins" json:"mixins,omitempty"`
}

type ConfigBuildpack struct {
Expand Down
23 changes: 19 additions & 4 deletions cargo/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ func testConfig(t *testing.T, context spec.G, it spec.S) {
},
Stacks: []cargo.ConfigStack{
{
ID: "some-stack-id",
ID: "some-stack-id",
Mixins: []string{"some-mixin-id"},
},
{
ID: "other-stack-id",
},
},
Metadata: cargo.ConfigMetadata{
Expand Down Expand Up @@ -70,8 +74,7 @@ func testConfig(t *testing.T, context spec.G, it spec.S) {
Group: []cargo.ConfigOrderGroup{
{
ID: "some-dependency",
Version: "some-version",
},
Version: "some-version"},
{
ID: "other-dependency",
Version: "other-version",
Expand Down Expand Up @@ -110,6 +113,10 @@ some-dependency = "1.2.x"
[[stacks]]
id = "some-stack-id"
mixins = ["some-mixin-id"]
[[stacks]]
id = "other-stack-id"
[[order]]
[[order.group]]
Expand Down Expand Up @@ -169,6 +176,10 @@ some-dependency = "1.2.x"
[[stacks]]
id = "some-stack-id"
mixins = ["some-mixin-id"]
[[stacks]]
id = "other-stack-id"
[[order]]
[[order.group]]
Expand All @@ -193,7 +204,11 @@ some-dependency = "1.2.x"
},
Stacks: []cargo.ConfigStack{
{
ID: "some-stack-id",
ID: "some-stack-id",
Mixins: []string{"some-mixin-id"},
},
{
ID: "other-stack-id",
},
},
Metadata: cargo.ConfigMetadata{
Expand Down
6 changes: 4 additions & 2 deletions cargo/jam/pack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ func testPack(t *testing.T, context spec.G, it spec.S) {
version = "4.5.6"
[[stacks]]
id = "some-stack-id"`))
id = "some-stack-id"
mixins = ["some-mixin-id"]`))
Expect(hdr.Mode).To(Equal(int64(0644)))

contents, hdr, err = ExtractFile(file, "bin/build")
Expand Down Expand Up @@ -305,7 +306,8 @@ func testPack(t *testing.T, context spec.G, it spec.S) {
version = "1.2.3"
[[stacks]]
id = "some-stack-id"`))
id = "some-stack-id"
mixins = ["some-mixin-id"]`))
Expect(hdr.Mode).To(Equal(int64(0644)))

contents, hdr, err = ExtractFile(file, "bin/build")
Expand Down
1 change: 1 addition & 0 deletions cargo/jam/testdata/example-cnb/buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ api = "0.2"

[[stacks]]
id = "some-stack-id"
mixins = ["some-mixin-id"]

0 comments on commit 221d9dd

Please sign in to comment.