diff --git a/buildSrc/config/checkstyle/checkstyle.xml b/buildSrc/config/checkstyle/checkstyle.xml index c63f232e1e..4059713931 100644 --- a/buildSrc/config/checkstyle/checkstyle.xml +++ b/buildSrc/config/checkstyle/checkstyle.xml @@ -6,7 +6,7 @@ - + diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index 0115fddad2..315ddaea13 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -11,7 +11,7 @@ - + diff --git a/src/eclipse/org.eclipse.jdt.ui.prefs b/src/eclipse/org.eclipse.jdt.ui.prefs index c4e40f6c06..db86f88b4e 100644 --- a/src/eclipse/org.eclipse.jdt.ui.prefs +++ b/src/eclipse/org.eclipse.jdt.ui.prefs @@ -63,4 +63,4 @@ org.eclipse.jdt.ui.keywordthis=false org.eclipse.jdt.ui.ondemandthreshold=9999 org.eclipse.jdt.ui.overrideannotation=true org.eclipse.jdt.ui.staticondemandthreshold=9999 -org.eclipse.jdt.ui.text.custom_code_templates= +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/update_copyright_headers.sh b/update_copyright_headers.sh index 4cb8b08922..0abe394e94 100755 --- a/update_copyright_headers.sh +++ b/update_copyright_headers.sh @@ -1,21 +1,16 @@ #!/bin/sh # # This shell script updates the copyright headers in source code files -# in the current branch that have been added or modified during the -# current year (at least as much as the `git diff` command supports the -# date range in terms of log history). +# in the current branch so that the headers conform to the pattern: +# -present. +# +# For example, "Copyright 2002-2025" will be replaced with +# "Copyright 2002-current". # # This has only been tested on mac OS. -current_year=$(date +'%Y') -echo Updating copyright headers in Java, Kotlin, and Groovy source code for year $current_year +echo Updating copyright headers in Java, Kotlin, and Groovy source code -# Added/Modified this year and committed -for file in $(git --no-pager diff --name-only --diff-filter=AM @{$current_year-01-01}..@{$current_year-12-31} | egrep "^.+\.(java|kt|groovy)$" | uniq); do - sed -i '' -E "s/Copyright 2002-[0-9]{4}/Copyright 2002-$current_year/g" $file; -done - -# Added/Modified and staged but not yet committed -for file in $(git --no-pager diff --name-only --diff-filter=AM --cached | egrep "^.+\.(java|kt|groovy)$" | uniq); do - sed -i '' -E "s/Copyright 2002-[0-9]{4}/Copyright 2002-$current_year/g" $file; +for file in $(find -E . -type f -regex '.+\.(java|kt|groovy)$' | uniq); do + sed -i '' -E "s/Copyright ([0-9]{4})-[0-9]{4}/Copyright \1-present/g" $file; done