realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Use Java 11 API's for checking embedded properties in the annotation processor #7808

Closed cmelchior closed 1 year ago

cmelchior commented 1 year ago

The fix introduced in https://github.com/realm/realm-java/pull/7807 turned out to not be enough.

I was testing the previous approach by manually unzipping the jar, and modifying the MANIFEST.MF file and then re-zipping the jar. I'm not 100% sure what is going on, but doing that seemed to cause issues with the build so some variants would compile successfully. However, recreating the SNAPSHOT artifact using the publishToMavenLocal would always reproduce the error.

It looks like the problem might be the presence of Manifest-Version, but there doesn't appear to be a way to remove this using the Gradle API.

So I decided to instead refactor our annotation processor to APIs available in Java 11. This unfortunately broke Google's Compile Testing framework which still has not been updated, but that could luckily be worked around using the same approach that people have to use with Realm Java 10.15.0 right now.