Hi Folks, It's been suggested I share the scripts I used to do this, so please find attached a ragbag of disordered undocumented scripts, which I mostly modified as I went along. Credit to @adk for the original
Once everything's merged in and we're happy with it, I'll get at least the .java script tidied up and put in ./usage/scripts for future use... Cheers M On 4 July 2014 14:16, Martin Harris <[email protected]> wrote: > Hi Folks, > > I've been adding the Apache headers to all of our source files[1] to bring > us in compliance with Apache rules. Any newly added files will also need to > include the Apache headers. Once [1] has been merged, you can simply look > for a file of the same extension in the existing code, but before then, you > can grab the headers from any of the files in my pull request > > I'll also be looking at adding Apache Rat to our build[2], so we'll know > if any files get missed... > > Cheers > > [1]: https://github.com/apache/incubator-brooklyn/pull/43 > [2]: https://issues.apache.org/jira/browse/BROOKLYN-20 > > -- > Martin Harris > Lead Software Engineer > Cloudsoft Corporation Ltd > www.cloudsoftcorp.com > > -- Martin Harris Lead Software Engineer Cloudsoft Corporation Ltd www.cloudsoftcorp.com Mobile: +44 (0)7989 047-855
find . -name '*.java' -a -exec grep --quiet 'Cloudsoft Corp' {} \; -print |
xargs -L 10 rmcopyright.sh
find . -name '*.java' -a -exec grep --quiet 'Cloudsoft Corp' {} \; -print
sed -i.bk '1s/^/,/package/d'
sed -n '/package/,$p' RendererHints.java > RendererHints.java.copybackup
rm RendererHints.java
mv RendererHints.java.copybackup RendererHints.java
sed -i '1,package/d' R
==============
find . -name '*.java' -a -exec grep --quiet 'Cloudsoft Corp' {} \; -print |
xargs -L 10 rmcopyright.sh
find . -name '*.java' -a -exec grep -v --quiet 'Licensed to the Apache Software
Foundation (ASF) under one' {} \; -print | xargs -L 10 copyright.sh
find . -name '*.sql' -a -exec grep -v --quiet 'Licensed to the Apache Software
Foundation (ASF) under one' {} \; -print | xargs -L 10 copyrightyaml.sh
find . -name '*.xml' -and -not -path './.idea/*' -and -not -path
'./.metadata/*' -a -exec grep --quiet '<?xml version=' {} \; -print | xargs -L
10 rmxmlcopyright.sh
find . -name '*.xml' -and -not -path './.idea/*' -and -not -path
'./.metadata/*' -print | xargs -L 10 copyrightxml.sh
find . -not -name '*.java' -and -not -type d -and -not -name '*.class' -and
-not -path './.git/*' -and -not -path './.idea/*' -and -not -path
'./.metadata/*' -and -not -name '*.jar' -and -not -name '*.groovy' -and -not
-name '*.yaml' -and -not -name '*.prefs' -and -not -name '*.classpath' -and
-not -name '*.project' -and -not -name '*.xml' -and -not -name '*.png' -and
-not -name '*.json' -and -not -name '*.ico' -and -not -name '*.gif' -and -not
-name '*.js' -and -not -name '*.md' -and -not -name '*.html' -and -not -name
'*.pem' -and -not -name '*.pub' -and -not -name '*.sh' -and -not -name
'*.properties' -and -not -name '*.ks' -and -not -name '*.ts' -and -not -name
'*.sql' -and -not -name '*.gitignore' -and -not -name '*.jpeg'
rmcopyright.sh
Description: Bourne shell script
copyright.sh
Description: Bourne shell script
rmxmlcopyright.sh
Description: Bourne shell script
copyrightyaml.sh
Description: Bourne shell script
