Skip to content

Commit 0d8bcf9

Browse files
committed
fix(text-templates): Re-align the notice templates with changes ORT
Replace the file contents with the ones from [^1] and [^2], except for the copyright statements, which brings in the ORT commits af2a476, 4a7d58a, d0bce72 and 60316b7. This fixes the following error when executing the template: ``` FreeMarker template error: The following has evaluated to null or missing: ==> licenseTextProvider ``` [^1]: https://github.com/oss-review-toolkit/ort/blob/800c14f246b9326a6e221f7c0f55dcf8257e2f64/plugins/reporters/freemarker/src/main/resources/templates/plain-text/NOTICE_DEFAULT.ftl [^2]: https://github.com/oss-review-toolkit/ort/blob/800c14f246b9326a6e221f7c0f55dcf8257e2f64/plugins/reporters/freemarker/src/main/resources/templates/plain-text/NOTICE_SUMMARY.ftl Signed-off-by: Frank Viernau <frank.viernau@gmail.com>
1 parent 608c2e4 commit 0d8bcf9

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

text-templates/NOTICE_BY_PACKAGE.ftl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
https://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,7 +36,7 @@
3636
[#assign filteredLicenses = helper.filterForCategory(mergedLicenses, noticeCategoryName)]
3737
[#list filteredLicenses as resolvedLicense]
3838
[#assign licenseName = resolvedLicense.license.simpleLicense()]
39-
[#assign licenseText = licenseTextProvider.getLicenseText(licenseName)!]
39+
[#assign licenseText = licenseFactProvider.getLicenseText(licenseName)!]
4040
[#if !licenseText?has_content][#continue][/#if]
4141
[#if !hasNoticeProjectLicenses]
4242
This software includes external packages and source code.
@@ -54,7 +54,7 @@ The applicable license information is listed below:
5454
${copyrights?join("\n", "", "\n")}
5555
${licenseText}
5656
[#assign exceptionName = resolvedLicense.license.exception()!]
57-
[#assign exceptionText = licenseTextProvider.getLicenseText(exceptionName)!]
57+
[#assign exceptionText = licenseFactProvider.getLicenseText(exceptionName)!]
5858
[#if exceptionText?has_content]
5959
${exceptionText}
6060
[/#if]
@@ -97,15 +97,15 @@ ${copyrights?join("\n", "")}
9797
are configured not to be included in notice files, and filter all licenses that are contained in the license
9898
files already printed above.
9999
--]
100-
[#assign licensesFilteredBySource = LicenseView.CONCLUDED_OR_DECLARED_AND_DETECTED.filter(package.license.licenses)]
100+
[#assign resolvedLicenseInfo = LicenseView.CONCLUDED_OR_DECLARED_AND_DETECTED.filter(package.license, package.licenseChoices)]
101101
[#assign resolvedLicenses = helper.filterForCategory(
102-
package.licensesNotInLicenseFiles(licensesFilteredBySource),
102+
package.licensesNotInLicenseFiles(resolvedLicenseInfo.licenses),
103103
noticeCategoryName
104104
)]
105105
[#assign isFirst = true]
106106
[#list resolvedLicenses as resolvedLicense]
107107
[#assign licenseName = resolvedLicense.license.simpleLicense()]
108-
[#assign licenseText = licenseTextProvider.getLicenseText(licenseName)!]
108+
[#assign licenseText = licenseFactProvider.getLicenseText(licenseName)!]
109109
[#if !licenseText?has_content][#continue][/#if]
110110
[#if isFirst]
111111
[#if !hasNoticePackageLicenses]
@@ -127,7 +127,7 @@ The following copyrights and licenses were found in the source code of this pack
127127
${copyrights?join("\n", "", "\n")}
128128
${licenseText}
129129
[#assign exceptionName = resolvedLicense.license.exception()!]
130-
[#assign exceptionText = licenseTextProvider.getLicenseText(exceptionName)!]
130+
[#assign exceptionText = licenseFactProvider.getLicenseText(exceptionName)!]
131131
[#if exceptionText?has_content]
132132
${exceptionText}
133133
[/#if]

text-templates/NOTICE_SUMMARY.ftl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
http://www.apache.org/licenses/LICENSE-2.0
8+
https://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
@@ -44,7 +44,7 @@ This project contains or depends on third-party software components pursuant to
4444
)]
4545
[#list mergedLicenses as resolvedLicense]
4646
[#assign licenseName = resolvedLicense.license.simpleLicense()]
47-
[#assign licenseText = licenseTextProvider.getLicenseText(licenseName)!]
47+
[#assign licenseText = licenseFactProvider.getLicenseText(licenseName)!]
4848
[#if !licenseText?has_content][#continue][/#if]
4949
[#if isFirst]
5050
[#assign isFirst = false]
@@ -58,7 +58,7 @@ This project contains or depends on third-party software components pursuant to
5858
${copyrights?join("\n", "", "\n")}
5959
${licenseText}
6060
[#assign exceptionName = resolvedLicense.license.exception()!]
61-
[#assign exceptionText = licenseTextProvider.getLicenseText(exceptionName)!]
61+
[#assign exceptionText = licenseFactProvider.getLicenseText(exceptionName)!]
6262
[#if exceptionText?has_content]
6363
${exceptionText}
6464
[/#if]

0 commit comments

Comments
 (0)