Skip to content
Permalink
Browse files
This closes #164
  • Loading branch information
ahgittin committed Jul 22, 2020
2 parents 5faaec0 + f4d638c commit c17db496dc95948dd69e077c22a9cbcdd8c55cbe
Showing 23 changed files with 2,937 additions and 976 deletions.
1,767 DEPENDENCIES

Large diffs are not rendered by default.

4 NOTICE
@@ -1,15 +1,15 @@
Notice: |

Apache Brooklyn
Copyright 2014-2018 The Apache Software Foundation
Copyright 2014-2020 The Apache Software Foundation

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


Bundled dependencies:

# This software includes the following bundled third-party components.
# This source code distribution includes the following bundled third-party components.
# Referenced licenses can be found in the accompanying LICENSE file.

# No such dependencies
@@ -28,21 +28,21 @@ First it is useful to know how these routines work.

It builds for various modes depending where the item is being used:

* The projects and JARs strictly speaking only require any 3rd party items
included therein. There usually aren't any (one exception is JS has been checked out
locally). Where these are required, they should be in a `license-inclusions-source-*` file.
This mode is called `binary-omitted`. (For projects where there are no such inclusions,
* The projects and JARs strictly NOTICE and LICENSE only require any 3rd party items included therein.
There usually aren't any, except for some JS and Go where some code is checked out locally).
Where these are required, they should be in a `license-inclusions-source-*` file.
This mode is called `source-only`. (For projects where there are no such inclusions,
the build adds a stock Apache LICENSE and Apache Brooklyn NOTICE.)

* Because people will usually build these and need the resulting information, and
because attribution is good, we include details of runtime dependencies in some places
(e.g. the root of projects) in a separate section in the NOTICE. These dependencies can
(e.g. the root of projects) in a separate DEPENDENCIES file. These dependencies can
be specified in files matching `license-inclusions-binary-*` (this is not needed for `mvn`
deps which are inferred automatically). This mode is called `binary-additional`.
deps which are inferred automatically). This mode is called `source-then-additional-binary`.

* The TGZ includes third-party dependencies and so needs LICENSE and NOTICE updates
for everything that is bundled, including all `license-inclusions-{source,binary}-*`.
This mode is called `binary-primary`.
This mode is called `binary`.

The generation then proceeds by collecting the relevant `license-inclusions-*` under the project
directory, giving a list of project `id` fields, and collecting `license-metadata-*` files containing
@@ -63,35 +63,37 @@ prefix_and_join_array() {
done
}

# takes root dir in first arg, then regex expression
# takes a base dir in first arg, then sub-project dir to build, then output, mode, then search root relative to output dir
make_for() {
PROJ=$(cd $1 ; pwd -P)
OUT=${PROJ}/$2
MODE=$3
SEARCH_ROOT=$4
ARGS=$5
if [ -z "$SEARCH_ROOT" ] ; then SEARCH_ROOT=$PROJ ; fi

echo Generating for $PROJ mode $MODE to $2...
BASE=$(cd $1 ; pwd -P)
PROJ=$(cd $BASE ; cd $2; pwd -P)
OUT=$(cd $BASE ; cd $3; pwd -P)
MODE=$4
SEARCH_ROOT=$5
if [ -z "$SEARCH_ROOT" ] ; then SEARCH_ROOT=. ; fi
SEARCH_ROOT=$(cd $BASE ; cd $SEARCH_ROOT; pwd -P)
ARGS=$6

echo Generating for $PROJ mode $MODE to $OUT...
echo ""

pushd $PROJ > /dev/null

if [ "$MODE" == "binary-additional" ] ; then
if [ "$MODE" == "source-then-additional-binary" ] ; then

$REF_DIR/generate-license-and-notice.sh \
-o $OUT \
--license $PARTS_DIR/license-top \
--license $PARTS_DIR/license-deps \
--notice $PARTS_DIR/notice-top --notice-compute-with-flags "
--license $PARTS_DIR/license-deps-with-additional-binary \
--notice $PARTS_DIR/notice-top-with-additional-binary --notice-compute-with-flags "
-DextrasFiles=$(prefix_and_join_array "" ":" "" $(find -L $SEARCH_ROOT -name "license-inclusions-source-*"))
-DonlyExtras=true" \
--notice $PARTS_DIR/notice-additional --notice-compute-with-flags "
--notice $PARTS_DIR/notice-additional-binary --notice-compute-with-flags "
-DextrasFiles=$(prefix_and_join_array "" ":" "" $(find -L $SEARCH_ROOT -name "license-inclusions-binary-*"))" \
$ARGS \
--libraries ${REF_DIR} ${SEARCH_ROOT}

elif [ "$MODE" == "binary-primary" ] ; then
elif [ "$MODE" == "binary" ] ; then

$REF_DIR/generate-license-and-notice.sh \
-o $OUT \
@@ -102,13 +104,13 @@ make_for() {
$ARGS \
--libraries ${REF_DIR} ${SEARCH_ROOT}

elif [ "$MODE" == "binary-omitted" ] ; then
elif [ "$MODE" == "source-only" ] ; then

$REF_DIR/generate-license-and-notice.sh \
-o $OUT \
--license $PARTS_DIR/license-top \
--license $PARTS_DIR/license-deps \
--notice $PARTS_DIR/notice-top --notice-compute-with-flags "
--license $PARTS_DIR/license-deps-source-dist \
--notice $PARTS_DIR/notice-top-source-dist --notice-compute-with-flags "
-DextrasFiles=$(prefix_and_join_array "" ":" "" $(find -L $SEARCH_ROOT -name "license-inclusions-source-*"))
-DonlyExtras=true" \
$ARGS \
@@ -123,6 +125,16 @@ make_for() {
popd > /dev/null
}

make_for_source() {
make_for "$1" "$2" "$3" source-then-additional-binary "$4" "$5"
# DEPENDENCIES
mv $OUT/NOTICE $OUT/DEPENDENCIES
echo "" >> $OUT/DEPENDENCIES
cat $OUT/LICENSE >> $OUT/DEPENDENCIES
rm $OUT/LICENSE

make_for "$1" "$2" "$3" source-only "$4" "$5"
}

# build licenses for all the projects

@@ -133,38 +145,36 @@ else


# include deps in files pulled in to Go CLI binary builds
make_for $ROOT_DIR/brooklyn-client/cli/ release/license/files binary-primary
make_for $ROOT_DIR/brooklyn-client/cli/ . binary-additional
make_for $ROOT_DIR/brooklyn-client/cli/ . release/license/files binary
make_for_source $ROOT_DIR/brooklyn-client/cli/ . .

# Server CLI has embedded JS; gets custom files in sub-project root, also included in JAR
make_for $ROOT_DIR/brooklyn-server/server-cli/ . binary-additional
make_for_source $ROOT_DIR/brooklyn-server/server-cli/ . .

# UI gets files at root
make_for $ROOT_DIR/brooklyn-ui/ . binary-additional
make_for_source $ROOT_DIR/brooklyn-ui/ features .
# for UI also do for each standalone module
for x in $(ls $ROOT_DIR/brooklyn-ui/ui-modules/*/package.json) ; do
make_for ${x%package.json} . binary-additional
make_for_source ${x%package.json} . .
# and in modules which make a WAR/JAR files we embed binaries
if [ -d ${x%package.json}/src/main/webapp ] ; then make_for ${x%package.json} src/main/webapp/WEB-INF/classes/META-INF/ binary-primary ; fi
if [ -d ${x%package.json}/src/main/webapp ] ; then make_for ${x%package.json} . src/main/webapp/WEB-INF/classes/META-INF/ binary ; fi
done

# main projects have their binaries included at root
make_for $ROOT_DIR/brooklyn-server/ . binary-additional
make_for $ROOT_DIR/brooklyn-client/ . binary-additional
make_for $ROOT_DIR/brooklyn-library/ . binary-additional
# dist is trickier, just don't mention binaries in the generated items
make_for $ROOT_DIR/brooklyn-dist/ . binary-omitted
make_for_source $ROOT_DIR/brooklyn-server/ karaf/features .
make_for_source $ROOT_DIR/brooklyn-client/ java .
make_for_source $ROOT_DIR/brooklyn-library karaf/features .
make_for_source $ROOT_DIR/brooklyn-dist karaf/features .


# brooklyn-docs skipped
# the docs don't make a build and don't include embedded code so no special license there

# and the binary dists; dist/ project which has biggest deps set, but search in all brooklyn projects
make_for $ROOT_DIR/brooklyn-dist/dist src/main/license/files/ binary-primary $ROOT_DIR
cp $OUT/{NOTICE,LICENSE} $PROJ/../karaf/apache-brooklyn/src/main/resources/

# finally in root project list everything
make_for $ROOT_DIR/brooklyn-dist/dist ../.. binary-additional $ROOT_DIR
# for the root source do as for dist but get the additional includes from all brooklyn projects
make_for_source $ROOT_DIR/brooklyn-dist karaf/features .. $ROOT_DIR

# and the binary dist is the same, stored in a couple places for inclusion in the binary builds
make_for $ROOT_DIR/brooklyn-dist karaf/features dist/src/main/license/files/ binary $ROOT_DIR
cp $OUT/{NOTICE,LICENSE} $PROJ/../apache-brooklyn/src/main/resources/

fi

@@ -64,6 +64,7 @@ Typical usage is to have one root --notice then one or more -notice ... --notice
EOF
}

PREFERRED_LICENSES="Apache-2.0,Apache,EPL-2.0,EPL-1.0,BSD-2-Clause,BSD-3-Clause,EDL-1.0,CDDL-1.1,CDDL-1.0,CDDL"
OUTPUT_DIR=.
SUFFIX=""
LICENSES=()
@@ -150,15 +151,15 @@ fi
process_dependencies() {
echo running mvn license-audit-maven-plugin:notices
echo mvn -X org.heneveld.maven:license-audit-maven-plugin:notices \
-DlicensesPreferred=Apache-2.0,Apache,EPL-1.0,BSD-2-Clause,BSD-3-Clause,CDDL-1.1,CDDL-1.0,CDDL \
-DlicensesPreferred="$PREFERRED_LICENSES" \
-DoverridesFile=$TEMP_METADATA_FILE \
-DoutputYaml=true \
-DoutputFile=$TEMP_NOTICE_DATA_FILE \
$@
echo writing to $TEMP_MVN_OUT

mvn -X org.heneveld.maven:license-audit-maven-plugin:notices \
-DlicensesPreferred=Apache-2.0,Apache,EPL-1.0,BSD-2-Clause,BSD-3-Clause,CDDL-1.1,CDDL-1.0,CDDL \
-DlicensesPreferred="$PREFERRED_LICENSES" \
-DoverridesFile=$TEMP_METADATA_FILE \
-DoutputYaml=true \
-DoutputFile=$TEMP_NOTICE_DATA_FILE \

This file was deleted.

@@ -32,13 +32,11 @@
notices:
- Copyright (c) 2016 Jeremy Saenz & Contributors

- id: github.com/NodePrime/jsonpath/cli/jsonpath
url: github.com/NodePrime/jsonpath/
name: github.com/NodePrime/jsonpath/cli/jsonpath
description: OpenSource JSON-Path
license: MIT
notices:
- Copyright (c) 2015 NodePrime Inc.
- id: github.com/kubernetes/client-go/util/jsonpath
url: github.com/kubernetes/client-go
name: Go client for Kubernetes
description: Only used for the JSON-Path library
license: Apache-2.0

- id: golang.org/x/crypto/ssh
url: https://godoc.org/golang.org/x/crypto/ssh
@@ -55,6 +55,7 @@
- javax.ws.rs.javax.ws.rs-api
- javax.servlet.javax.servlet-api
- org.jboss.spec.javax.xml.bind.jboss-jaxb-api_2.3_spec
- com.sun.activation.javax.activation
- ids:
- javax.annotation.jsr250-api
- org.jboss.spec.javax.annotation.jboss-annotations-api_1.2_spec:1.0.0.Final

0 comments on commit c17db49

Please sign in to comment.