diff --git a/pkg/project/project_test.go b/pkg/project/project_test.go index cef2c26613..f023dec26b 100644 --- a/pkg/project/project_test.go +++ b/pkg/project/project_test.go @@ -403,7 +403,6 @@ name = "licenses should have either a type or uri defined" it("should warn when unsupported keys, on tables the project owns, are declared with schema v0.1", func() { projectToml := ` -# try to use some schema 0.2 configuration with 0.1 version - warning message expected [project] authors = ["foo", "bar"] @@ -427,13 +426,15 @@ foo = "bar" _, err = ReadProjectDescriptor(tmpProjectToml.Name(), logger) h.AssertNil(t, err) - h.AssertContains(t, readStdout(), "Warning: The following keys declared in project.toml are not supported in schema version 0.1:\nWarning: - project.authors\nWarning: - io.buildpacks.build.env\nWarning: - io.buildpacks.build.env.name\nWarning: - io.buildpacks.build.env.value\nWarning: The above keys will be ignored. If this is not intentional, try updating your schema version.\n") + h.AssertContains(t, readStdout(), "Warning: The following keys declared in project.toml are not supported in schema version 0.1:\nWarning: - io.buildpacks.build.env\nWarning: - io.buildpacks.build.env.name\nWarning: - io.buildpacks.build.env.value\nWarning: The above keys will be ignored. If this is not intentional, try updating your schema version.\n") }) it("should warn when unsupported keys, on tables the project owns, are declared with schema v0.2", func() { projectToml := ` [_] schema-version = "0.2" +id = "foo" +version = "bar" # typo in a key under valid table - warning message expected versions = "0.1" diff --git a/pkg/project/types/types.go b/pkg/project/types/types.go index 3371d8d388..a9c73b7f78 100644 --- a/pkg/project/types/types.go +++ b/pkg/project/types/types.go @@ -33,10 +33,13 @@ type Build struct { } type Project struct { - Name string `toml:"name"` - Version string `toml:"version"` - SourceURL string `toml:"source-url"` - Licenses []License `toml:"licenses"` + ID string `toml:"id"` + Name string `toml:"name"` + Version string `toml:"version"` + Authors []string `toml:"authors"` + DocumentationURL string `toml:"documentation-url"` + SourceURL string `toml:"source-url"` + Licenses []License `toml:"licenses"` } type License struct { diff --git a/pkg/project/v02/project.go b/pkg/project/v02/project.go index 88aceb456d..67fc1270bb 100644 --- a/pkg/project/v02/project.go +++ b/pkg/project/v02/project.go @@ -28,10 +28,15 @@ type Env struct { } type Project struct { - Name string `toml:"name"` - Licenses []types.License `toml:"licenses"` - Metadata map[string]interface{} `toml:"metadata"` - SchemaVersion string `toml:"schema-version"` + SchemaVersion string `toml:"schema-version"` + ID string `toml:"id"` + Name string `toml:"name"` + Version string `toml:"version"` + Authors []string `toml:"authors"` + Licenses []types.License `toml:"licenses"` + DocumentationURL string `toml:"documentation-url"` + SourceURL string `toml:"source-url"` + Metadata map[string]interface{} `toml:"metadata"` } type IO struct {