Build: NORELEASE is the same as norelease (#22006)

Changes the build to recognize `NORELEASE` as well as `NOCOMMIT` to
mean the same thing as `norelease` and `nocommit` respectively. This
is useful because people have been using them that way but haven't
realized that only the lowercase versions worked.

This also explicitly forbids silly things like `NoReLeAsE` and
`noCOMMIT`, failing the build and telling you to spell them properly.
This commit is contained in:
Nik Everett 2016-12-08 11:50:03 -05:00 committed by GitHub
parent 18a3d6b4f3
commit 0f7c20ae81
1 changed files with 7 additions and 2 deletions

View File

@ -59,11 +59,16 @@ public class ForbiddenPatternsTask extends DefaultTask {
filesFilter.exclude('**/*.png') filesFilter.exclude('**/*.png')
// add mandatory rules // add mandatory rules
patterns.put('nocommit', /nocommit/) patterns.put('nocommit', /nocommit|NOCOMMIT/)
patterns.put('nocommit should be all lowercase or all uppercase',
/((?i)nocommit)(?<!(nocommit|NOCOMMIT))/)
patterns.put('tab', /\t/) patterns.put('tab', /\t/)
if (System.getProperty('build.snapshot', 'true').equals('false')) { if (System.getProperty('build.snapshot', 'true').equals('false')) {
patterns.put('norelease', /norelease/) patterns.put('norelease', /norelease|NORELEASE/)
} }
patterns.put('norelease should be all lowercase or all uppercase',
/((?i)norelease)(?<!(norelease|NORELEASE))/)
inputs.property("excludes", filesFilter.excludes) inputs.property("excludes", filesFilter.excludes)
inputs.property("rules", patterns) inputs.property("rules", patterns)