-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Project Descriptor 0.2 #1241
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package common | ||
|
||
import ( | ||
"github.com/buildpacks/lifecycle/api" | ||
|
||
"github.com/buildpacks/pack/internal/dist" | ||
) | ||
|
||
type Script struct { | ||
API string `toml:"api"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are internal only representations right? Meaning these won't be If so, then these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are meant to be primarily internal representations. However, currently v01/package.go and v02/package.go reference these structs for Unmarshalling some of the unchanged attributes (ex: v02 uses common.Buildpack). I'm not sure whether we should just copy over the structs and remove struct tags from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm comfortable straddling both sides and treating |
||
Inline string `toml:"inline"` | ||
Shell string `toml:"shell"` | ||
} | ||
type Buildpack struct { | ||
ID string `toml:"id"` | ||
Version string `toml:"version"` | ||
URI string `toml:"uri"` | ||
Script Script `toml:"script"` | ||
} | ||
|
||
type EnvVar struct { | ||
Name string `toml:"name"` | ||
Value string `toml:"value"` | ||
} | ||
|
||
type Build struct { | ||
Include []string `toml:"include"` | ||
Exclude []string `toml:"exclude"` | ||
Buildpacks []Buildpack `toml:"buildpacks"` | ||
Env []EnvVar `toml:"env"` | ||
Builder string `toml:"builder"` | ||
} | ||
|
||
type Project struct { | ||
Name string `toml:"name"` | ||
Licenses []dist.License `toml:"licenses"` | ||
} | ||
|
||
type Descriptor struct { | ||
Project Project `toml:"project"` | ||
Build Build `toml:"build"` | ||
Metadata map[string]interface{} `toml:"metadata"` | ||
SchemaVersion *api.Version | ||
} | ||
|
||
type ProjectDescriptorSchema interface { | ||
DescriptorFromToml(projectTomlContents string) (Descriptor, error) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's a better name for this 🤷 , maybe just
common
? thoughts?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong feeling over here!