1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00
Smack/resources/getCopyright.sh
Guus der Kinderen c85bcadd81 Fixes spelling (includes one API change)
Mostly benign changes. Added one new method to replace a method with a spelling mistake in its name. Kept the old method, marked as 'deprecated'.
2024-09-11 20:03:43 +02:00

25 lines
738 B
Bash
Executable file

#!/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 | \
# Split multi Copyright statements, e.g. "2001-2013 FooBar, 2014 Baz"
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