Skip to content

Commit

Permalink
enable semi-automated NOTICE files
Browse files Browse the repository at this point in the history
  • Loading branch information
paulk-asert committed Jul 19, 2015
1 parent 673e8b2 commit 833098c
Show file tree
Hide file tree
Showing 17 changed files with 190 additions and 75 deletions.
20 changes: 12 additions & 8 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ Copyright 2003-2015 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

This product includes/uses source files adapted from the JSR-223 reference
implementation which has the following notice
Copyright 2006 Sun Microsystems, Inc. All rights reserved.

This product includes/uses a source file adapted from the JLine project
which is distributable under the BSD license and has the following notice
Copyright (c) 2002-2012, the original author or authors.

This product includes/uses software/assets from asciidoctor.org
use is granted under the terms of the MIT License
Copyright (c) 2012-2014 Dan Allen, Ryan Waldron and the Asciidoctor Project

This product includes/uses a source file from Jline2 (https://github.com/jline/jline2)
Distributed under the BSD license
Copyright (c) 2002-2012, the original author or authors. All rights reserved.

This product includes/uses software/assets from jquery.org
use is granted under the terms of the MIT License
Copyright jQuery Foundation and other contributors, https://jquery.org/

This product includes/uses source files adapted from the JSR-223 reference
implementation which has the following notice
Copyright 2006 Sun Microsystems, Inc. All rights reserved.

This product includes/uses the git.io/normalize.css stylesheet
which is distributed under the MIT license
Copyright (c) Nicolas Gallagher and Jonathan Neal
84 changes: 66 additions & 18 deletions gradle/assemble.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,10 @@ allprojects {
ant {
taskdef name: 'jarjar', classname: 'com.tonicsystems.jarjar.JarJarTask', classpath: rootProject.configurations.tools.asPath
jarjar(jarfile: target) {
zipfileset(src: jarjar.archivePath)
zipfileset(dir: "$rootProject.projectDir/notices/", includes: isRootProject ? 'NOTICE-GROOIDJARJAR' : 'NOTICE-GROOID', fullpath: 'META-INF/NOTICE')
zipfileset(src: jarjar.archivePath, excludes: 'META-INF/NOTICE')
if (isRootProject) {
zipfileset(src: rootProject.configurations.runtime.files.find { it.name.startsWith('openbeans') })
zipfileset(src: rootProject.configurations.runtime.files.find { it.name.startsWith('openbeans') }, excludes: 'META-INF/*')
}
rule pattern: 'com.googlecode.openbeans.**', result: 'groovyjarjaropenbeans.@1'
rule pattern: 'org.apache.harmony.beans.**', result: 'groovyjarjarharmonybeans.@1'
Expand Down Expand Up @@ -570,7 +571,7 @@ task dist(type: Zip, dependsOn: [distBin, distSrc, distDoc, syncDoc]) {
}
}

task updateLicense {
task updateLicenses {
description = 'Updates the LICENSE (SRC), LICENSE-ALLJARJAR, LICENSE-BINZIP, LICENSE-DOC and LICENSE-JARJAR files'
ext.licensesDir = "${projectDir}/licenses"
ext.licenseBaseFile = "${licensesDir}/LICENSE-BASE"
Expand All @@ -580,35 +581,82 @@ task updateLicense {
ext.licenseBinZipFile = "${licensesDir}/LICENSE-BINZIP"
ext.licenseDocFile = "${licensesDir}/LICENSE-DOC"
ext.licenseJarJarFile = "${licensesDir}/LICENSE-JARJAR"
ext.licenseSrcFile = "${licensesDir}/LICENSE-SRC"
inputs.files(licenseBaseFile, fileTree(licensesDir).include('*.txt'))
outputs.files(licenseAllJarJarFile, licenseBinZipFile, licenseDocFile, licenseJarJarFile, licenseSrcFile)

doLast {
def srcFiles = [file(licenseBaseFile)] + fileTree(licensesDir).include('*-SRC*.txt').sort{ it.name }
def docFiles = [file(licenseBaseFile)] + fileTree(licensesDir).include('*-DOC*.txt').sort{ it.name }
def jarjarFiles = [file(licenseBaseFile)] + fileTree(licensesDir).include('*-JARJAR*.txt').sort{ it.name }
def srcFiles = [file(licenseBaseFile)] + fileTree(licensesDir).include('*-SRC*.txt').sort { it.name }
def docFiles = [file(licenseBaseFile)] + fileTree(licensesDir).include('*-DOC*.txt').sort { it.name }
def jarjarFiles = [file(licenseBaseFile)] + fileTree(licensesDir).include('*-JARJAR*.txt').sort { it.name }
def allJarjarFiles = [file(licenseBaseFile)] + fileTree(licensesDir) {
include '*-SRC*.txt'
include '*-JARJAR*.txt'
include '*-ALLJARJAR*.txt'
}.sort{ it.name }
}.sort { it.name }
def binzipFiles = [file(licenseBaseFile)] + fileTree(licensesDir) {
include '*-SRC*.txt'
include '*-JARJAR*.txt'
include '*-ALLJARJAR*.txt'
include '*-BINZIP*.txt'
}.sort{ it.name }
[(licenseAllJarJarFile):allJarjarFiles,
(licenseBinZipFile):binzipFiles,
(licenseDocFile):docFiles,
(licenseJarJarFile):jarjarFiles,
(licenseSrcFile):srcFiles].each { outFile, inFiles ->
}.sort { it.name }
[(licenseAllJarJarFile): allJarjarFiles,
(licenseBinZipFile) : binzipFiles,
(licenseDocFile) : docFiles,
(licenseJarJarFile) : jarjarFiles,
(licenseSrcFile) : srcFiles].each { outFile, inFiles ->
file(outFile).withWriter('utf-8') { writer ->
inFiles.each {
writer << "${it.text}\n"
writer << '---------------------------------------------------------------------\n'
}
writer << inFiles.collect {
it.text.trim()
}.join('\n\n--------------------------------------------------------------------\n\n')
}
}
}
}

task updateNotices {
description = 'Updates the NOTICE (SRC), NOTICE-ALLJARJAR, NOTICE-BINZIP, NOTICE-DOC and NOTICE-JARJAR files'
ext.noticesDir = "${projectDir}/notices"
ext.noticeBaseFile = "${noticesDir}/NOTICE-BASE"

ext.noticeSrcFile = "${projectDir}/NOTICE"
ext.noticeAllJarJarFile = "${noticesDir}/NOTICE-ALLJARJAR"
ext.noticeBinZipFile = "${noticesDir}/NOTICE-BINZIP"
ext.noticeDocFile = "${noticesDir}/NOTICE-DOC"
ext.noticeGrooidFile = "${noticesDir}/NOTICE-GROOID"
ext.noticeGrooidJarJarFile = "${noticesDir}/NOTICE-GROOIDJARJAR"
ext.noticeJarJarFile = "${noticesDir}/NOTICE-JARJAR"
inputs.files(noticeBaseFile, fileTree(noticesDir).include('*.txt'))
outputs.files(noticeAllJarJarFile, noticeBinZipFile, noticeDocFile, noticeGrooidFile, noticeGrooidJarJarFile, noticeJarJarFile, noticeSrcFile)

doLast {
def srcFiles = [file(noticeBaseFile)] + fileTree(noticesDir).include('*-SRC*.txt').sort { it.name }
def docFiles = [file(noticeBaseFile)] + fileTree(noticesDir).include('*-DOC*.txt').sort { it.name }
def grooidFiles = [file(noticeBaseFile)] + fileTree(noticesDir).include('*-GROOID*.txt').sort { it.name }
def jarjarFiles = [file(noticeBaseFile)] + fileTree(noticesDir).include('*-JARJAR*.txt').sort { it.name }
def grooidJarjarFiles = [file(noticeBaseFile)] + fileTree(noticesDir) {
include '*-JARJAR*.txt'
include '*-GROOID*.txt'
}.sort { it.name }
def allJarjarFiles = [file(noticeBaseFile)] + fileTree(noticesDir) {
include '*-SRC*.txt'
include '*-JARJAR*.txt'
include '*-ALLJARJAR*.txt'
}.sort { it.name }
def binzipFiles = [file(noticeBaseFile)] + fileTree(noticesDir) {
include '*-SRC*.txt'
include '*-JARJAR*.txt'
include '*-ALLJARJAR*.txt'
include '*-BINZIP*.txt'
}.sort { it.name }
[(noticeAllJarJarFile) : allJarjarFiles,
(noticeBinZipFile) : binzipFiles,
(noticeDocFile) : docFiles,
(noticeGrooidFile) : grooidFiles,
(noticeGrooidJarJarFile): grooidJarjarFiles,
(noticeJarJarFile) : jarjarFiles,
(noticeSrcFile) : srcFiles].each { outFile, inFiles ->
file(outFile).withWriter('utf-8') { writer ->
writer << inFiles.collect { it.text.trim() }.join('\n\n')
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion licenses/readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This directory contains generated LICENSE files and snippets used to generate those files.
See the assemble.gradle file for details on how this is done.
See the assemble.gradle file (updateLicenses task) for details on how this is done.
Snippets have predefined suffix values in their name to determine which files they go into.
LICENSE (the one for source), LICENSE-DOC and LICENSE-JARJAR
get snippets containing SRC, DOC and JARJAR respectively.
Expand Down
21 changes: 14 additions & 7 deletions notices/NOTICE-ALLJARJAR
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,25 @@ The Apache Software Foundation (http://www.apache.org/).
This product includes/uses ANTLR (http://www.antlr2.org/)
Developed by Terence Parr 1989-2006

This product includes/uses software/assets from asciidoctor.org
use is granted under the terms of the MIT License
Copyright (c) 2012-2014 Dan Allen, Ryan Waldron and the Asciidoctor Project

This product includes/uses ASM (http://asm.ow2.org/)
Copyright (c) 2000-2011 INRIA, France Telecom
All rights reserved.
Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved.

This product includes/uses a source file from Jline2 (https://github.com/jline/jline2)
Distributed under the BSD license
Copyright (c) 2002-2012, the original author or authors. All rights reserved.

This product includes/uses software/assets from jquery.org
use is granted under the terms of the MIT License
Copyright jQuery Foundation and other contributors, https://jquery.org/

This product includes/uses source files adapted from the JSR-223 reference
implementation which has the following notice
Copyright 2006 Sun Microsystems, Inc. All rights reserved.

This product includes/uses a source file from Jline (http://jline.sourceforge.net)
Distributed under the BSD license
Copyright (c) 2002-2006, Marc Prud'hommeaux <[email protected]>

This product includes/uses the git.io/normalize.css stylesheet
which is distributed under the MIT license
Copyright (c) Nicolas Gallagher and Jonathan Neal
Copyright (c) Nicolas Gallagher and Jonathan Neal
60 changes: 37 additions & 23 deletions notices/NOTICE-BINZIP
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,59 @@ Copyright 2003-2015 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

This product includes/uses ANTLR (www.antlr2.org)
This product includes/uses ANTLR (http://www.antlr2.org/)
Developed by Terence Parr 1989-2006

This product includes/uses ASM (asm.ow2.org)
Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved.

This product includes/uses XStream (https://x-stream.github.io)
Made available under a BSD license. Copyright (c) 2003-2006, Joe Walnes
Copyright (c) 2006-2009, 2011 XStream Committers. All rights reserved.
This product includes/uses software/assets from asciidoctor.org
use is granted under the terms of the MIT License
Copyright (c) 2012-2014 Dan Allen, Ryan Waldron and the Asciidoctor Project

This product includes/uses JUnit (junit.org)
Under the terms of the Eclipse Public License - v1.0
This product includes/uses ASM (http://asm.ow2.org/)
Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved.

This product includes/uses Hamcrest (www.hamcrest.org)
Made available under a BSD License.
This product bundles the Hamcrest jar (www.hamcrest.org)
which is made available under a BSD License.
Copyright (c) 2000-2015. All rights reserved.

This product includes/uses Jline (http://jline.sourceforge.net)
This product bundles the Jline2 jar (https://github.com/jline/jline2)
which is distributed under the BSD license
Copyright (c) 2002-2012, the original author or authors. All rights reserved.

This product includes/uses a source file from Jline2 (https://github.com/jline/jline2)
Distributed under the BSD license
Copyright (c) 2002-2006, Marc Prud'hommeaux <[email protected]>
Copyright (c) 2002-2012, the original author or authors. All rights reserved.

This product includes/uses QDox (https://github.com/paul-hammant/qdox)
Copyright 2002-2009 Joe Walnes and QDox Project Team
This product includes/uses software/assets from jquery.org
use is granted under the terms of the MIT License
Copyright jQuery Foundation and other contributors, https://jquery.org/

This product includes/uses source files adapted from the JSR-223 reference
implementation which has the following notice
Copyright 2006 Sun Microsystems, Inc. All rights reserved.

This product includes/uses Multiverse (https://github.com/pveentjer/Multiverse)
This product bundles the JUnit jar (junit.org)
which is available under the terms of the Eclipse Public License v1.0

This product bundles the Multiverse jar (https://github.com/pveentjer/Multiverse)
Copyright (c) 2011, The Multiverse Team. All rights reserved.

This product includes/uses git/io/stylesheet.css
This product includes/uses the git.io/normalize.css stylesheet
which is distributed under the MIT license
Copyright (c) Nicolas Gallagher and Jonathan Neal

This product includes/uses software/assets from asciidoctor.org
use is granted under the terms of the MIT License
Copyright (c) 2012-2014 Dan Allen, Ryan Waldron and the Asciidoctor Project
This product embeds the OpenBeans jar within its grooid jar artifacts
OpenBeans includes/uses files from Apache Harmony and the following notice applies
Copyright 2006, 2010 The Apache Software Foundation.
Portions of Apache Harmony were originally developed by Intel Corporation and are
licensed to the Apache Software Foundation under the "Software Grant and Corporate
Contribution License Agreement" and for which the following copyright notices apply
(C) Copyright 2005 Intel Corporation
(C) Copyright 2005-2006 Intel Corporation
(C) Copyright 2006 Intel Corporation

This product bundles the QDox jar (https://github.com/paul-hammant/qdox)
Copyright 2002-2009 Joe Walnes and QDox Project Team

This product includes/uses software/assets from jquery.org
use is granted under the terms of the MIT License
Copyright jQuery Foundation and other contributors, https://jquery.org/
This product bundles the XStream jar (https://x-stream.github.io)
which is made available under a BSD license. Copyright (c) 2003-2006, Joe Walnes.
Copyright (c) 2006-2009, 2011 XStream Committers. All rights reserved.
8 changes: 4 additions & 4 deletions notices/NOTICE-DOC
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Copyright 2003-2015 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

This product includes/uses the git.io/normalize.css stylesheet
which is distributed under the MIT license
Copyright (c) Nicolas Gallagher and Jonathan Neal

This product includes/uses software/assets from asciidoctor.org
use is granted under the terms of the MIT License
Copyright (c) 2012-2014 Dan Allen, Ryan Waldron and the Asciidoctor Project

This product includes/uses software/assets from jquery.org
use is granted under the terms of the MIT License
Copyright jQuery Foundation and other contributors, https://jquery.org/

This product includes/uses the git.io/normalize.css stylesheet
which is distributed under the MIT license
Copyright (c) Nicolas Gallagher and Jonathan Neal
15 changes: 15 additions & 0 deletions notices/NOTICE-GROOID
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Apache Groovy
Copyright 2003-2015 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

This product embeds the OpenBeans jar within its grooid jar artifacts
OpenBeans includes/uses files from Apache Harmony and the following notice applies
Copyright 2006, 2010 The Apache Software Foundation.
Portions of Apache Harmony were originally developed by Intel Corporation and are
licensed to the Apache Software Foundation under the "Software Grant and Corporate
Contribution License Agreement" and for which the following copyright notices apply
(C) Copyright 2005 Intel Corporation
(C) Copyright 2005-2006 Intel Corporation
(C) Copyright 2006 Intel Corporation
21 changes: 21 additions & 0 deletions notices/NOTICE-GROOIDJARJAR
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Apache Groovy
Copyright 2003-2015 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

This product includes/uses ANTLR (http://www.antlr2.org/)
Developed by Terence Parr 1989-2006

This product includes/uses ASM (http://asm.ow2.org/)
Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved.

This product embeds the OpenBeans jar within its grooid jar artifacts
OpenBeans includes/uses files from Apache Harmony and the following notice applies
Copyright 2006, 2010 The Apache Software Foundation.
Portions of Apache Harmony were originally developed by Intel Corporation and are
licensed to the Apache Software Foundation under the "Software Grant and Corporate
Contribution License Agreement" and for which the following copyright notices apply
(C) Copyright 2005 Intel Corporation
(C) Copyright 2005-2006 Intel Corporation
(C) Copyright 2006 Intel Corporation
3 changes: 1 addition & 2 deletions notices/NOTICE-JARJAR
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ This product includes/uses ANTLR (http://www.antlr2.org/)
Developed by Terence Parr 1989-2006

This product includes/uses ASM (http://asm.ow2.org/)
Copyright (c) 2000-2011 INRIA, France Telecom
All rights reserved.
Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved.
3 changes: 1 addition & 2 deletions notices/asm-JARJAR.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
This product includes/uses ASM (http://asm.ow2.org/)
Copyright (c) 2000-2011 INRIA, France Telecom
All rights reserved.
Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved.
4 changes: 2 additions & 2 deletions notices/hamcrest-BINZIP.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This product includes/uses Hamcrest (www.hamcrest.org)
Made available under a BSD License.
This product bundles the Hamcrest jar (www.hamcrest.org)
which is made available under a BSD License.
Copyright (c) 2000-2015. All rights reserved.
4 changes: 2 additions & 2 deletions notices/jline-BINZIP.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This product includes/uses Jline2 (https://github.com/jline/jline2)
Distributed under the BSD license
This product bundles the Jline2 jar (https://github.com/jline/jline2)
which is distributed under the BSD license
Copyright (c) 2002-2012, the original author or authors. All rights reserved.
4 changes: 2 additions & 2 deletions notices/junit-BINZIP.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This product includes/uses JUnit (junit.org)
Under the terms of the Eclipse Public License - v1.0
This product bundles the JUnit jar (junit.org)
which is available under the terms of the Eclipse Public License v1.0
2 changes: 1 addition & 1 deletion notices/multiverse-BINZIP.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This product includes/uses Multiverse (https://github.com/pveentjer/Multiverse)
This product bundles the Multiverse jar (https://github.com/pveentjer/Multiverse)
Copyright (c) 2011, The Multiverse Team. All rights reserved.
2 changes: 1 addition & 1 deletion notices/qdox-BINZIP.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This product includes/uses QDox (https://github.com/paul-hammant/qdox)
This product bundles the QDox jar (https://github.com/paul-hammant/qdox)
Copyright 2002-2009 Joe Walnes and QDox Project Team
8 changes: 8 additions & 0 deletions notices/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This directory contains generated NOTICE files and snippets used to generate those files.
See the assemble.gradle file (updateNotices task) for details on how this is done.
Snippets have predefined suffix values in their name to determine which files they go into.
NOTICE (the one for source), NOTICE-DOC, NOTICE-GROOID and NOTICE-JARJAR
get snippets containing SRC, DOC, GROOID and JARJAR respectively.
NOTICE-GROOIDJARJAR gets JARJAR and GROOID snippets.
NOTICE-ALLJARJAR gets SRC, JARJAR and ALLJARJAR snippets.
NOTICE-BINZIP gets SRC, JARJAR, ALLJARJAR and BINZIP snippets.
4 changes: 2 additions & 2 deletions notices/xstream-BINZIP.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This product includes/uses XStream (https://x-stream.github.io)
Made available under a BSD license. Copyright (c) 2003-2006, Joe Walnes
This product bundles the XStream jar (https://x-stream.github.io)
which is made available under a BSD license. Copyright (c) 2003-2006, Joe Walnes.
Copyright (c) 2006-2009, 2011 XStream Committers. All rights reserved.

0 comments on commit 833098c

Please sign in to comment.