diff --git a/schema/spdx.schema.json b/schema/spdx.schema.json
index 552c631f..1e49a6d9 100644
--- a/schema/spdx.schema.json
+++ b/schema/spdx.schema.json
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://cyclonedx.org/schema/spdx.schema.json",
- "$comment": "v1.0-3.26.0",
+ "$comment": "v1.0-3.27.0",
"type": "string",
"enum": [
"0BSD",
@@ -51,6 +51,8 @@
"Artistic-1.0-cl8",
"Artistic-1.0-Perl",
"Artistic-2.0",
+ "Artistic-dist",
+ "Aspell-RU",
"ASWF-Digital-Assets-1.0",
"ASWF-Digital-Assets-1.1",
"Baekmuk",
@@ -76,6 +78,7 @@
"BSD-2-Clause-FreeBSD",
"BSD-2-Clause-NetBSD",
"BSD-2-Clause-Patent",
+ "BSD-2-Clause-pkgconf-disclaimer",
"BSD-2-Clause-Views",
"BSD-3-Clause",
"BSD-3-Clause-acpica",
@@ -208,6 +211,7 @@
"CPOL-1.02",
"Cronyx",
"Crossword",
+ "CryptoSwift",
"CrystalStacker",
"CUA-OPL-1.0",
"Cube",
@@ -219,6 +223,7 @@
"DL-DE-BY-2.0",
"DL-DE-ZERO-2.0",
"DOC",
+ "DocBook-DTD",
"DocBook-Schema",
"DocBook-Stylesheet",
"DocBook-XML",
@@ -257,10 +262,14 @@
"FSFAP-no-warranty-disclaimer",
"FSFUL",
"FSFULLR",
+ "FSFULLRSD",
"FSFULLRWD",
+ "FSL-1.1-ALv2",
+ "FSL-1.1-MIT",
"FTL",
"Furuseth",
"fwlw",
+ "Game-Programming-Gems",
"GCR-docs",
"GD",
"generic-xts",
@@ -315,6 +324,7 @@
"gtkbook",
"Gutmann",
"HaskellReport",
+ "HDF5",
"hdparm",
"HIDAPI",
"Hippocratic-2.1",
@@ -365,6 +375,7 @@
"ISC-Veillard",
"Jam",
"JasPer-2.0",
+ "jove",
"JPL-image",
"JPNIC",
"JSON",
@@ -390,6 +401,7 @@
"LGPL-3.0-or-later",
"LGPLLR",
"Libpng",
+ "libpng-1.6.35",
"libpng-2.0",
"libselinux-1.0",
"libtiff",
@@ -420,6 +432,7 @@
"magaz",
"mailprio",
"MakeIndex",
+ "man2html",
"Martin-Birgmeier",
"McPhee-slideshow",
"metamail",
@@ -470,6 +483,7 @@
"NetCDF",
"Newsletr",
"NGPL",
+ "ngrep",
"NICTA-1.0",
"NIST-PD",
"NIST-PD-fallback",
@@ -484,6 +498,7 @@
"NPL-1.1",
"NPOSL-3.0",
"NRL",
+ "NTIA-PD",
"NTP",
"NTP-0",
"Nunit",
@@ -596,6 +611,7 @@
"SMPPL",
"SNIA",
"snprintf",
+ "SOFA",
"softSurfer",
"Soundex",
"Spencer-86",
@@ -609,6 +625,7 @@
"SSPL-1.0",
"StandardML-NJ",
"SugarCRM-1.1.3",
+ "SUL-1.0",
"Sun-PPP",
"Sun-PPP-2000",
"SunPro",
@@ -643,6 +660,8 @@
"Unicode-TOU",
"UnixCrypt",
"Unlicense",
+ "Unlicense-libtelnet",
+ "Unlicense-libwhirlpool",
"UPL-1.0",
"URT-RLE",
"Vim",
@@ -699,6 +718,7 @@
"Classpath-exception-2.0",
"CLISP-exception-2.0",
"cryptsetup-OpenSSL-exception",
+ "Digia-Qt-LGPL-exception-1.1",
"DigiRule-FOSS-exception",
"eCos-exception-2.0",
"erlang-otp-linking-exception",
@@ -741,6 +761,7 @@
"OpenJDK-assembly-exception-1.0",
"openvpn-openssl-exception",
"PCRE2-exception",
+ "polyparse-exception",
"PS-or-PDF-font-exception-20170817",
"QPL-1.0-INRIA-2004-exception",
"Qt-GPL-exception-1.0",
diff --git a/schema/spdx.xsd b/schema/spdx.xsd
index 6e90a9e4..41a27b02 100644
--- a/schema/spdx.xsd
+++ b/schema/spdx.xsd
@@ -2,7 +2,7 @@
+ version="1.0-3.27.0">
@@ -242,6 +242,16 @@
Artistic License 2.0
+
+
+ Artistic License 1.0 (dist)
+
+
+
+
+ Aspell Russian License
+
+
ASWF Digital Assets License version 1.0
@@ -367,6 +377,11 @@
BSD-2-Clause Plus Patent License
+
+
+ BSD 2-Clause pkgconf disclaimer variant
+
+
BSD 2-Clause with views sentence
@@ -1027,6 +1042,11 @@
Crossword License
+
+
+ CryptoSwift License
+
+
CrystalStacker License
@@ -1082,6 +1102,11 @@
DOC License
+
+
+ DocBook DTD License
+
+
DocBook Schema License
@@ -1272,11 +1297,26 @@
FSF Unlimited License (with License Retention)
+
+
+ FSF Unlimited License (with License Retention and Short Disclaimer)
+
+
FSF Unlimited License (With License Retention and Warranty Disclaimer)
+
+
+ Functional Source License, Version 1.1, ALv2 Future License
+
+
+
+
+ Functional Source License, Version 1.1, MIT Future License
+
+
Freetype Project License
@@ -1292,6 +1332,11 @@
fwlw License
+
+
+ Game Programming Gems License
+
+
Gnome GCR Documentation License
@@ -1562,6 +1607,11 @@
Haskell Language Report License
+
+
+ HDF5 License
+
+
hdparm License
@@ -1812,6 +1862,11 @@
JasPer License
+
+
+ Jove License
+
+
JPL Image Use Policy
@@ -1937,6 +1992,11 @@
libpng License
+
+
+ PNG Reference Library License v1 (for libpng 0.5 through 1.6.35)
+
+
PNG Reference Library version 2
@@ -2087,6 +2147,11 @@
MakeIndex License
+
+
+ man2html License
+
+
Martin Birgmeier License
@@ -2337,6 +2402,11 @@
Nethack General Public License
+
+
+ ngrep License
+
+
NICTA Public Software License, Version 1.0
@@ -2407,6 +2477,11 @@
NRL License
+
+
+ NTIA Public Domain Notice
+
+
NTP License
@@ -2967,6 +3042,11 @@
snprintf License
+
+
+ SOFA Software License
+
+
softSurfer License
@@ -3032,6 +3112,11 @@
SugarCRM Public License v1.1.3
+
+
+ Sustainable Use License v1.0
+
+
Sun PPP License
@@ -3202,6 +3287,16 @@
The Unlicense
+
+
+ Unlicense - libtelnet variant
+
+
+
+
+ Unlicense - libwhirlpool variant
+
+
Universal Permissive License v1.0
@@ -3483,6 +3578,11 @@
cryptsetup OpenSSL exception
+
+
+ Digia Qt LGPL Exception version 1.1
+
+
DigiRule FOSS License Exception
@@ -3693,6 +3793,11 @@
PCRE2 exception
+
+
+ Polyparse Exception
+
+
PS/PDF font exception (2017-08-17)
diff --git a/tools/src/main/java/org/cyclonedx/tools/SpdxXsdGenerator.java b/tools/src/main/java/org/cyclonedx/tools/SpdxXsdGenerator.java
index 9a1c3d9c..4c2ffa04 100644
--- a/tools/src/main/java/org/cyclonedx/tools/SpdxXsdGenerator.java
+++ b/tools/src/main/java/org/cyclonedx/tools/SpdxXsdGenerator.java
@@ -30,12 +30,11 @@
public class SpdxXsdGenerator {
- private static final String SPDX_VERSION = "3.24.0";
+ //todo : automatically obtain latest release from: https://api.github.com/repos/spdx/license-list-data/releases
+ //todo : make configurable
+ private static final String SPDX_VERSION = "3.27.0";
public static void main(String args[]) throws Exception {
-
- //todo : automatically obtain latest release from: https://api.github.com/repos/spdx/license-list-data/releases
- //todo : make configurable
String licenseUrl = "https://raw.githubusercontent.com/spdx/license-list-data/v" + SPDX_VERSION + "/json/licenses.json";
String exceptionsUrl = "https://raw.githubusercontent.com/spdx/license-list-data/v" + SPDX_VERSION + "/json/exceptions.json";
@@ -61,8 +60,6 @@ public static void main(String args[]) throws Exception {
createXmlSchema(licenseMap, exceptionMap);
createJsonSchema(licenseMap, exceptionMap);
- createLicenseListJson(licenseMap, exceptionMap);
- mirrorLicenses(licenseRoot);
}
@@ -87,8 +84,9 @@ private static void createXmlSchema(Map licenses, Map").append("\n").append("\n")
.append("");
- //todo : make configurable
- File file = new File("/Users/steve/Development/CycloneDX/specification/schema/spdx.xsd");
+ String filePath = System.getProperty("cdx.schema.dir") + "/spdx.xsd";
+ System.out.println("Write SPDX xml schema to: " + filePath);
+ File file = new File(filePath);
FileUtils.writeStringToFile(file, sb.toString(), StandardCharsets.UTF_8);
}
@@ -110,25 +108,9 @@ private static void createJsonSchema(Map licenses, Map licenses, Map exceptions) throws IOException {
- StringBuilder sb = new StringBuilder();
- sb.append("[").append("\n");
- for (Map.Entry license : licenses.entrySet()) {
- sb.append("\"").append(license.getKey()).append("\"").append(",").append("\n");
- }
- for (Map.Entry license : exceptions.entrySet()) {
- sb.append("\"").append(license.getKey()).append("\"").append(",").append("\n");
- }
- sb.delete(sb.length() - 2, sb.length());
- sb.append("\n").append("]").append("\n");
-
- //todo : make configurable
- File file = new File("/Users/steve/Development/CycloneDX/cyclonedx-node-module/spdx-licenses.json");
+ String filePath = System.getProperty("cdx.schema.dir") + "/spdx.schema.json";
+ System.out.println("Write SPDX json schema to: " + filePath);
+ File file = new File(filePath);
FileUtils.writeStringToFile(file, sb.toString(), StandardCharsets.UTF_8);
}
@@ -162,19 +144,4 @@ private static String indent(int spaces) {
return sb.toString();
}
- private static void mirrorLicenses(final JSONObject licenseRoot) throws IOException, UnirestException {
- File file = new File("/Users/steve/Development/CycloneDX/cyclonedx-core-java/src/main/resources/licenses/licenses.json");
- FileUtils.writeStringToFile(file, licenseRoot.toString(2), StandardCharsets.UTF_8);
-
- JSONArray licenses = licenseRoot.getJSONArray("licenses");
- for (int i = 0; i < licenses.length(); i++) {
- JSONObject license = licenses.getJSONObject(i);
- String licenseId = license.getString("licenseId");
- String url = "https://raw.githubusercontent.com/spdx/license-list-data/v" + SPDX_VERSION + "/text/" + licenseId + ".txt";
- String text = Unirest.get(url).asString().getBody();
- File textFile = new File("/Users/steve/Development/CycloneDX/cyclonedx-core-java/src/main/resources/licenses/" + licenseId + ".txt");
- FileUtils.writeStringToFile(textFile, text, StandardCharsets.UTF_8);
- }
- }
-
}
diff --git a/tools/updateSpdx.sh b/tools/updateSpdx.sh
new file mode 100755
index 00000000..7a973a5c
--- /dev/null
+++ b/tools/updateSpdx.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+set -exu
+
+this="$(realpath "$0")"
+this_dir="$(dirname "$this")"
+project_root="$(dirname "$this_dir")"
+schema_dir="$project_root/schema"
+
+mvn clean \
+ compile \
+ exec:java -Dexec.mainClass='org.cyclonedx.tools.SpdxXsdGenerator' \
+ -Dcdx.schema.dir="$schema_dir"