Skip to content

Commit

Permalink
feat: add support for targets to cargo
Browse files Browse the repository at this point in the history
Add support for targets in buildpack.toml which
are used for multi-arch support.

Signed-off-by: Michael Dawson <mdawson@devrus.com>
  • Loading branch information
mhdawson authored and ForestEckhardt committed Oct 9, 2024
1 parent 1ab5b00 commit fc95594
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cargo/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ type Config struct {
Metadata ConfigMetadata `toml:"metadata" json:"metadata,omitempty"`
Stacks []ConfigStack `toml:"stacks" json:"stacks,omitempty"`
Order []ConfigOrder `toml:"order" json:"order,omitempty"`
Targets []ConfigTarget `toml:"targets" json:"targets,omitempty"`
}

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

type ConfigTarget struct {
OS string `toml:"os" json:"os,omitempty"`
Arch string `toml:"arch" json:"arch,omitempty"`
}

type ConfigBuildpack struct {
ID string `toml:"id" json:"id,omitempty"`
Name string `toml:"name" json:"name,omitempty"`
Expand Down
10 changes: 10 additions & 0 deletions cargo/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ func testConfig(t *testing.T, context spec.G, it spec.S) {
ID: "other-stack-id",
},
},
Targets: []cargo.ConfigTarget{
{
OS: "linux",
Arch: "arm64",
},
},
Metadata: cargo.ConfigMetadata{
IncludeFiles: []string{
"some-include-file",
Expand Down Expand Up @@ -166,6 +172,10 @@ api = "0.6"
[[stacks]]
id = "other-stack-id"
[[targets]]
os = "linux"
arch = "arm64"
[[order]]
[[order.group]]
id = "some-dependency"
Expand Down

0 comments on commit fc95594

Please sign in to comment.