Skip to content

Commit dac5995

Browse files
committed
feat: license expression text attachment
- tests: examples for licenses with text - tests: draft for expressiosn with text Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 88de88c commit dac5995

9 files changed

+79
-11
lines changed

tools/src/test/resources/1.7/valid-license-expression-1.7.json

+14-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,21 @@
3333
],
3434
"licenses": [
3535
{
36-
"expression": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
36+
"bom-ref": "my-license",
3737
"acknowledgement": "declared",
38-
"bom-ref": "my-license"
38+
"expression": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
39+
"expression-texts": [
40+
"license-identifier": "EPL-2.0",
41+
"text": {
42+
"content": "Eclipse Public License - v 2.0\n\n THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE\n PUBLIC LICENSE (\"AGREEMENT\"). ANY USE, REPRODUCTION OR DISTRIBUTION\n OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT..."
43+
},
44+
{
45+
"license-identifier": "GPL-2.0 WITH Classpath-exception-2.0",
46+
"text": {
47+
"content": " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed...\n\n...\n\nLinking this library statically or dynamically with other modules is making a combined work based on this library..."
48+
}
49+
}
50+
]
3951
}
4052
],
4153
"purl": "pkg:maven/com.acme/[email protected]?packaging=jar"

tools/src/test/resources/1.7/valid-license-expression-1.7.textproto

+14-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,21 @@ components {
2929
value: "e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282"
3030
}
3131
licenses {
32-
expression: "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0"
33-
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
3432
bom_ref: "my-license"
33+
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
34+
expression: "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0"
35+
expression_texts {
36+
license_identifier: "EPL-2.0"
37+
text {
38+
content: "Eclipse Public License - v 2.0\n\n THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE\n PUBLIC LICENSE (\"AGREEMENT\"). ANY USE, REPRODUCTION OR DISTRIBUTION\n OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT..."
39+
}
40+
}
41+
expression_texts {
42+
license_identifier: "GPL-2.0 WITH Classpath-exception-2.0",
43+
text: {
44+
content: " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed...\n\n...\n\nLinking this library statically or dynamically with other modules is making a combined work based on this library..."
45+
}
46+
}
3547
}
3648
purl: "pkg:maven/com.acme/[email protected]?packaging=jar"
3749
}

tools/src/test/resources/1.7/valid-license-expression-1.7.xml

+19-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,25 @@
1515
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
1616
</hashes>
1717
<licenses>
18-
<expression bom-ref="my-license" acknowledgement="declared">EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0</expression>
18+
<expression bom-ref="my-license" acknowledgement="declared">
19+
<value>EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0</value>
20+
<text license-identifier="EPL-2.0"><![CDATA[Eclipse Public License - v 2.0
21+
22+
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
23+
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
24+
OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT...]]]></text>
25+
<text license-identifier="GPL-2.0 WITH Classpath-exception-2.0"><![CDATA[ GNU GENERAL PUBLIC LICENSE
26+
Version 2, June 1991
27+
28+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
29+
<https://fsf.org/>
30+
Everyone is permitted to copy and distribute verbatim copies
31+
of this license document, but changing it is not allowed...
32+
33+
...
34+
35+
Linking this library statically or dynamically with other modules is making a combined work based on this library...]]></text>
36+
</expression>
1937
</licenses>
2038
<purl>pkg:maven/com.acme/[email protected]?packaging=jar</purl>
2139
</component>

tools/src/test/resources/1.7/valid-license-id-1.7.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
"license": {
3737
"id": "Apache-2.0",
3838
"acknowledgement": "declared",
39-
"bom-ref": "my-license"
39+
"bom-ref": "my-license",
40+
"text": {
41+
"content": "\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION..."
42+
}
4043
}
4144
}
4245
],

tools/src/test/resources/1.7/valid-license-id-1.7.textproto

+8
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ components {
3333
id: "Apache-2.0"
3434
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
3535
bom_ref: "my-license"
36+
text {
37+
value: """
38+
Apache License
39+
Version 2.0, January 2004
40+
http://www.apache.org/licenses/
41+
42+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION..."""
43+
}
3644
}
3745
}
3846
purl: "pkg:maven/com.acme/[email protected]?packaging=jar"

tools/src/test/resources/1.7/valid-license-id-1.7.xml

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
<licenses>
1818
<license bom-ref="my-license" acknowledgement="declared">
1919
<id>Apache-2.0</id>
20+
<text><![CDATA[
21+
Apache License
22+
Version 2.0, January 2004
23+
http://www.apache.org/licenses/
24+
25+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION...]]></text>
2026
</license>
2127
</licenses>
2228
<purl>pkg:maven/com.acme/[email protected]?packaging=jar</purl>

tools/src/test/resources/1.7/valid-license-name-1.7.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@
3434
"licenses": [
3535
{
3636
"license": {
37-
"name": "Apache License 2.0",
38-
"bom-ref": "my-license"
37+
"name": "My License",
38+
"bom-ref": "my-license",
39+
"acknowledgement": "declared",
40+
"text": {
41+
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nec turpis efficitur, ullamcorper lorem ac, fermentum nulla. Mauris a enim nunc. Aliquam diam tellus, porttitor venenatis leo in, mollis ultricies lacus. Sed sagittis hendrerit nulla, eget pulvinar diam..."
42+
}
3943
}
4044
}
4145
],

tools/src/test/resources/1.7/valid-license-name-1.7.textproto

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ components {
3030
}
3131
licenses {
3232
license {
33-
name: "Apache License 2.0"
33+
name: "My License"
3434
bom_ref: "my-license"
35+
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
36+
text {
37+
value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nec turpis efficitur, ullamcorper lorem ac, fermentum nulla. Mauris a enim nunc. Aliquam diam tellus, porttitor venenatis leo in, mollis ultricies lacus. Sed sagittis hendrerit nulla, eget pulvinar diam..."
38+
}
3539
}
3640
}
3741
purl: "pkg:maven/com.acme/[email protected]?packaging=jar"

tools/src/test/resources/1.7/valid-license-name-1.7.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
1616
</hashes>
1717
<licenses>
18-
<license bom-ref="my-license">
19-
<name>Apache License 2.0</name>
18+
<license bom-ref="my-license" acknowledgement="declared">
19+
<name>My License</name>
20+
<text><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nec turpis efficitur, ullamcorper lorem ac, fermentum nulla. Mauris a enim nunc. Aliquam diam tellus, porttitor venenatis leo in, mollis ultricies lacus. Sed sagittis hendrerit nulla, eget pulvinar diam...]]></text>
2021
</license>
2122
</licenses>
2223
<purl>pkg:maven/com.acme/[email protected]?packaging=jar</purl>

0 commit comments

Comments
 (0)