Skip to content

Commit

Permalink
chore: fix compileJava7 and compileJava6
Browse files Browse the repository at this point in the history
Removal of LibPQFactory annotations was not done right
  • Loading branch information
vlsi committed Aug 28, 2020
1 parent c745f4e commit 0308ffc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pgjdbc/build.gradle.kts
Expand Up @@ -256,16 +256,17 @@ val hiddenAnnotation = Regex(
"GuardedBy|UnderInitialization|" +
"DefaultQualifier)(?:\\([^)]*\\))?")
val hiddenImports = Regex("import org.checkerframework")
val thisReferences = Regex("\\w+\\s+this\\s+,?")
val thisReferences = Regex("""\*/\s+(\w+\s+this\b,?)""")

val removeTypeAnnotations by tasks.registering(Sync::class) {
destinationDir = withoutAnnotations
inputs.property("regexpsUpdatedOn", "2020-08-29")
from(projectDir) {
filteringCharset = `java.nio.charset`.StandardCharsets.UTF_8.name()
filter { x: String ->
x.replace(hiddenAnnotation, "/* $0 */")
.replace(hiddenImports, "// $0")
.replace(thisReferences, "/* $0 */")
.replace(thisReferences, "*/ /* $1 */")
}
include("src/**")
}
Expand Down

0 comments on commit 0308ffc

Please sign in to comment.