-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added buildpack.toml entries for CPEs, bump API, libpak, libcnb, libbs
- Loading branch information
1 parent
37c4635
commit 4f64840
Showing
5 changed files
with
88 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
api = "0.6" | ||
api = "0.7" | ||
|
||
[buildpack] | ||
description = "A Cloud Native Buildpack that builds SBT-based applications from source" | ||
|
@@ -21,6 +21,7 @@ api = "0.6" | |
keywords = ["java", "sbt", "scala", "build-system"] | ||
name = "Paketo SBT Buildpack" | ||
version = "{{.version}}" | ||
sbom-formats = ["application/vnd.cyclonedx+json", "application/vnd.syft+json"] | ||
|
||
[[buildpack.licenses]] | ||
type = "Apache-2.0" | ||
|
@@ -54,6 +55,10 @@ api = "0.6" | |
stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"] | ||
uri = "https://github.com/sbt/sbt/releases/download/v1.5.5/sbt-1.5.5.tgz" | ||
version = "1.5.5" | ||
purl = "pkg:generic/[email protected]" | ||
cpes = [ | ||
"cpe:2.3:a:lightbend:sbt:1.5.5:*:*:*:*:*:*:*" | ||
] | ||
|
||
[[metadata.dependencies.licenses]] | ||
type = "Apache-2.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,8 @@ import ( | |
"path/filepath" | ||
"testing" | ||
|
||
"github.com/paketo-buildpacks/libpak/sbom" | ||
|
||
"github.com/buildpacks/libcnb" | ||
. "github.com/onsi/gomega" | ||
"github.com/paketo-buildpacks/libbs" | ||
|
@@ -71,17 +73,41 @@ func testBuild(t *testing.T, context spec.G, it spec.S) { | |
Expect(result.Layers[1].(libbs.Application).Command).To(Equal(filepath.Join(ctx.Application.Path, "sbt"))) | ||
}) | ||
|
||
it("contributes distribution", func() { | ||
it("contributes distribution for API 0.7+", func() { | ||
ctx.Buildpack.Metadata = map[string]interface{}{ | ||
"dependencies": []map[string]interface{}{ | ||
{ | ||
"id": "sbt", | ||
"version": "1.1.1", | ||
"stacks": []interface{}{"test-stack-id"}, | ||
"cpes": []string{"cpe:2.3:a:lightbend:sbt:1.5.5:*:*:*:*:*:*:*"}, | ||
"purl": "pkg:generic/[email protected]", | ||
}, | ||
}, | ||
} | ||
ctx.StackID = "test-stack-id" | ||
result, err := sbtBuild.Build(ctx) | ||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(result.Layers).To(HaveLen(3)) | ||
Expect(result.Layers[0].Name()).To(Equal("sbt")) | ||
Expect(result.Layers[1].Name()).To(Equal("cache")) | ||
Expect(result.Layers[2].Name()).To(Equal("application")) | ||
Expect(result.Layers[2].(libbs.Application).Command).To(Equal(filepath.Join(ctx.Layers.Path, "sbt", "bin", "sbt"))) | ||
|
||
Expect(result.BOM.Entries).To(HaveLen(0)) | ||
}) | ||
it("contributes distribution for API <=0.6", func() { | ||
ctx.Buildpack.Metadata = map[string]interface{}{ | ||
"dependencies": []map[string]interface{}{ | ||
{ | ||
"id": "sbt", | ||
"version": "1.1.1", | ||
"stacks": []interface{}{"test-stack-id"}, | ||
}, | ||
}, | ||
} | ||
ctx.StackID = "test-stack-id" | ||
ctx.Buildpack.API = "0.6" | ||
|
||
result, err := sbtBuild.Build(ctx) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
@@ -109,6 +135,8 @@ func (f *FakeApplicationFactory) NewApplication( | |
command string, | ||
_ *libcnb.BOM, | ||
_ string, | ||
_ sbom.SBOMScanner, | ||
_ string, | ||
) (libbs.Application, error) { | ||
return libbs.Application{ | ||
Command: command, | ||
|