diff options
author | Ilia Motornyi <elmot@vaadin.com> | 2018-03-28 13:30:07 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-03-28 13:30:07 +0300 |
commit | f7279f7330a3673e88e97552bb623fc21c2971e9 (patch) | |
tree | b91672b72d33be65696588a9059096e4d63a7718 /scripts | |
parent | 002c188e2b8ba713d361d90ab5a0b7d26599465f (diff) | |
download | vaadin-framework-f7279f7330a3673e88e97552bb623fc21c2971e9.tar.gz vaadin-framework-f7279f7330a3673e88e97552bb623fc21c2971e9.zip |
Update Copyright headers for year 2018 (#10762)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/sed.sh | 15 | ||||
-rw-r--r-- | scripts/updateCopyrightYear.sh | 17 |
2 files changed, 32 insertions, 0 deletions
diff --git a/scripts/sed.sh b/scripts/sed.sh new file mode 100644 index 0000000000..99aa640b0f --- /dev/null +++ b/scripts/sed.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Must use gsed on Mac +if [[ "$OSTYPE" == "darwin"* ]] +then + export SED=`which gsed` +else + export SED=`which sed` +fi + +if [ ! -x "$SED" ] +then + echo "Sed not found, install gsed on Mac or sed on Linux" + exit 1 +fi diff --git a/scripts/updateCopyrightYear.sh b/scripts/updateCopyrightYear.sh new file mode 100644 index 0000000000..fee4d6aae8 --- /dev/null +++ b/scripts/updateCopyrightYear.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +. `dirname $0`/sed.sh + +rootdir=`dirname $0`/.. +year=$(date +%Y) +old=$(grep Copyright checkstyle/header|sed "s/^ . //") +new=$(echo $old|sed "s/2000-[^ ]* /2000-$year /") + +echo "Changing '$old' to '$new'" + +$SED -i "s/$old/$new/" checkstyle/header + +for javaFile in `find $rootdir -name "*.java"` +do + $SED -i "s/$old/$new/" $javaFile +done |