From a4a6915f3118ac1717f7b728f6c52668458f2ebc Mon Sep 17 00:00:00 2001 From: Gregory Brail Date: Wed, 5 Jan 2022 10:00:42 -0800 Subject: [PATCH] Add a NOTICE-tools to cover third-party code in the "toolsrc" directory Fix a few other small build issues as well. --- .github/workflows/publish-github.yml | 4 +-- NOTICE-tools.txt | 37 ++++++++++++++++++++++++++++ build.gradle | 36 +++++++++++++-------------- 3 files changed, 57 insertions(+), 20 deletions(-) create mode 100644 NOTICE-tools.txt diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index 126ebef34..faebacac2 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -25,11 +25,11 @@ jobs: settings-path: ${{ github.workspace }} - name: Publish env: + ORG_GRADLE_PROJECT_mavenUser: ${{ github.actor }} + ORG_GRADLE_PROJECT_mavenPassword: ${{ secrets.GITHUB_TOKEN }} ORG_GRADLE_PROJECT_SIGNINGKEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} run: >- ./gradlew publish -PmavenReleaseRepo="https://maven.pkg.github.com/mozilla/rhino" -PmavenSnapshotRepo="https://maven.pkg.github.com/mozilla/rhino" - -PmavenUser=${{ github.actor }} - -PmavenPassword=${{ secrets.GITHUB_TOKEN }} diff --git a/NOTICE-tools.txt b/NOTICE-tools.txt new file mode 100644 index 000000000..8332dbaab --- /dev/null +++ b/NOTICE-tools.txt @@ -0,0 +1,37 @@ +Rhino is licensed subject to the terms of the Mozilla Public License, v. 2.0. +See "LICENSE.txt" for the text of the license. + +The files in toolsrc/org/mozilla/javascript/tools/debugger/treetable (runtime +package org.mozilla.javascript.tools.debugger.treetable) are available under +the following license: + +---- + +Copyright 1997, 1998 Sun Microsystems, Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + - Neither the name of Sun Microsystems nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/build.gradle b/build.gradle index fa8197fd4..49834315d 100644 --- a/build.gradle +++ b/build.gradle @@ -205,13 +205,17 @@ task engineJar(type: Jar) { } jar { - dependsOn runtimeJar, engineJar + dependsOn compileJava from ('LICENSE.txt') { into 'META-INF' } from ('NOTICE.txt') { into 'META-INF' } + from ('NOTICE-tools.txt') { + into 'META-INF' + } + from sourceSets.main.output excludes = ["org/mozilla/javascript/engine/**", "META-INF/services/**"] // Class ImplementationVersion uses 'Implementation-Title' manifest { @@ -255,12 +259,16 @@ task engineJavadocJar(type: Jar) { task sourceJar(type: Jar) { from sourceSets.main.allJava + archiveClassifier = 'sources' from ('LICENSE.txt') { into 'META-INF' } from ('NOTICE.txt') { into 'META-INF' } + from ('NOTICE-tools.txt') { + into 'META-INF' + } } task runtimeSourceJar(type: Jar) { @@ -289,6 +297,7 @@ publishing { rhino(MavenPublication) { groupId 'org.mozilla' artifactId 'rhino' + artifacts = [jar, sourceJar, javadocJar] pom.withXml { def root = asNode() @@ -319,13 +328,6 @@ publishing { o.appendNode("url", "http://www.mozilla.org") } - from components.java - artifact sourceJar { - classifier "sources" - } - artifact javadocJar { - classifier "javadoc" - } } rhinoruntime(MavenPublication) { @@ -358,7 +360,6 @@ publishing { def o = root.appendNode("organization") o.appendNode("name", "The Mozilla Foundation") o.appendNode("url", "http://www.mozilla.org") - } } @@ -421,16 +422,15 @@ publishing { signing { if (project.hasProperty('SIGNINGKEY')) { - // Check for ORG_GRADLE_PROJECT_SIGNINGKEY environment variable for use in CI system - def signingKey = getProperty('SIGNINGKEY') - def signingPassword = getProperty('SIGNINGPASSWORD') - useInMemoryPgpKeys(signingKey, signingPassword) - } else { - useGpgCmd() + // Check for ORG_GRADLE_PROJECT_SIGNINGKEY environment variable for use in CI system. + // Otherwise, do not sign. + def signingKey = getProperty('SIGNINGKEY') + def signingPassword = getProperty('SIGNINGPASSWORD') + useInMemoryPgpKeys(signingKey, signingPassword) + sign publishing.publications.rhino + sign publishing.publications.rhinoengine + sign publishing.publications.rhinoruntime } - sign publishing.publications.rhino - sign publishing.publications.rhinoengine - sign publishing.publications.rhinoruntime } spotbugs {