LUCENE-10240: gradle regenerate fails on java 17 (#449)

This commit is contained in:
Dawid Weiss 2021-11-17 18:36:34 +01:00 committed by GitHub
parent 0eeba8d37c
commit bae095ae48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -97,7 +97,7 @@ configurations {
dependencies {
// Use a newer groovy that doesn't have illegal reflective accesses.
groovy "org.codehaus.groovy:groovy-all:3.0.7"
groovy "org.codehaus.groovy:groovy-all:3.0.9"
}
apply from: file('buildSrc/scriptDepVersions.gradle')

View File

@ -71,10 +71,11 @@ configure(rootProject) {
*/
modifyFile = { File path, Function<String, String> modify ->
Function<String, String> normalizeEols = { text -> text.replace("\r\n", "\n") }
modify = normalizeEols.andThen(modify).andThen(normalizeEols)
String original = path.getText("UTF-8")
String modified = modify.apply(original)
String modified = normalizeEols.apply(original)
modified = modify.apply(modified)
modified = normalizeEols.apply(modified)
if (!original.equals(modified)) {
path.write(modified, "UTF-8")
}