Skip to content

Commit f46243e

Browse files
committed
Add support for Standard BOM 3.1.0 by adding scope accessors to BomEntry #4
1 parent 0388244 commit f46243e

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ext {
4747

4848
// The version of the spec we are currently implementing.
4949
// Must correspond to an existing tag, without the leading 'v', or validation may fail later!
50-
formatVersion = '3.0.0'
50+
formatVersion = '3.1.0'
5151
}
5252

5353
group = 'com.siemens.sbom.standardbom'

src/main/java/com/siemens/sbom/standardbom/model/BomEntry.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,21 @@ public void setCpe(@Nullable final String pCpeName)
401401

402402

403403

404+
@CheckForNull
405+
public Component.Scope getScope()
406+
{
407+
return cycloneDxComponent.getScope();
408+
}
409+
410+
411+
412+
public void setScope(@Nullable final Component.Scope pScope)
413+
{
414+
cycloneDxComponent.setScope(pScope);
415+
}
416+
417+
418+
404419
@CheckForNull
405420
public Boolean isInternal()
406421
{

src/test/java/com/siemens/sbom/standardbom/model/BomEntryTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public void testAccessors()
5252
underTest.addSources(sourceRef);
5353
underTest.setCopyright("statement1\nstatement2");
5454
underTest.setCpe("cpe:2.3:a:acme:component_framework:-:*:*:*:*:*:*:*");
55+
underTest.setScope(Component.Scope.REQUIRED);
5556
underTest.setThirdPartyNotices("notice1\nnotice2");
5657
underTest.setLegalRemark("Wait, that's illegal.");
5758
underTest.setMd5("b24f3a25bc033352f1c3ab2c683b926c");
@@ -79,6 +80,7 @@ public void testAccessors()
7980
Assert.assertNotNull(underTest.getSources());
8081
Assert.assertEquals("statement1\nstatement2", underTest.getCopyright());
8182
Assert.assertEquals("cpe:2.3:a:acme:component_framework:-:*:*:*:*:*:*:*", underTest.getCpe());
83+
Assert.assertEquals(Component.Scope.REQUIRED, underTest.getScope());
8284
Assert.assertEquals("notice1\nnotice2", underTest.getThirdPartyNotices());
8385
Assert.assertEquals("Wait, that's illegal.", underTest.getLegalRemark());
8486
Assert.assertEquals("b24f3a25bc033352f1c3ab2c683b926c", underTest.getMd5());

0 commit comments

Comments
 (0)