2014-09-11 09:49:16 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SCRIPTDIR="$(dirname ${BASH_SOURCE[0]})"
|
|
|
|
BASEDIR=${SCRIPTDIR}/..
|
|
|
|
|
|
|
|
cd $BASEDIR
|
|
|
|
SUBPROJECTS=$(grep -oP "\'.*\'" settings.gradle | sed "s;';;g")
|
|
|
|
for p in $SUBPROJECTS; do
|
|
|
|
echo "Copyright notices for $p"
|
|
|
|
# Find all .java files in the project
|
|
|
|
find $p/src -type f -name "*.java" -print0 | \
|
|
|
|
# Get the project string
|
|
|
|
xargs -0 grep -ohP '^.*\* Copyright \K.*' | \
|
|
|
|
# Sort the output
|
|
|
|
sort | \
|
|
|
|
# Remove duplicates
|
|
|
|
uniq | \
|
2024-09-06 21:52:50 +02:00
|
|
|
# Split multi Copyright statements, e.g. "2001-2013 FooBar, 2014 Baz"
|
2014-09-11 09:49:16 +02:00
|
|
|
tr ',' '\n' | \
|
|
|
|
# Remove whitespaces resulting from the previous split
|
|
|
|
sed "s/^[ \t]*//" | \
|
|
|
|
# Remove dots at the end and '©' at the beginning
|
|
|
|
sed "s/^© //" | sed "s/\.$//" | sed "s/^(C) //"
|
|
|
|
echo -ne "\n"
|
|
|
|
done
|