Migrate the documentation package to Java 11 (#729)

* Migrate the documentation package to Java 11

The old Doclet API is deprected and removed in Java 12. This commit
changes the documentation package to use the new recommended API.
However it is not a drop-in replacement and there are non-idiomatic
usages all over the place. I think it is eaiser to keep the current code
logic and kind of shoehorn in the new API than starting afresh as the
return on investment of a do-over is not great.

Also note that the docs package is disabled as of this commit because we
are still using Java 8 to compile which lacks the new API. Once we
switch our toolchains to Java 11 (but still compiling Java 8 bytecode)
we can re-enable this package.

TESTED=ran `./gradlew :docs:test` locally with the documentation package
enabled.
This commit is contained in:
Lai Jiang 2020-07-30 17:12:33 -04:00 committed by GitHub
parent a1f4e8b985
commit fba8af0485
11 changed files with 304 additions and 259 deletions

View file

@ -116,8 +116,12 @@ tasks.withType(JavaCompile).configureEach {
}
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
// TODO: Change source version to 11 after target version is changed to 11 and
// once we figure out what's wrong with Dagger compilation with source version
// >8.
sourceCompatibility = '8'
// TODO: Change target version to 11. Source version can stay at 8.
targetCompatibility = '8'
compileJava { options.encoding = "UTF-8" }
compileTestJava { options.encoding = "UTF-8" }