jspecify / jspecify

An artifact of fully-specified annotations to power static-analysis checks, beginning with nullness analysis.
http://jspecify.org
Apache License 2.0
561 stars 29 forks source link

The build vs. JDK versions #271

Open kevinb9n opened 2 years ago

kevinb9n commented 2 years ago

I don't understand build stuff, but I ?think? that currently:

But isn't the only thing that we really need to splay out to multiple JDKs for tests? More to the point: since we will only be releasing one artifact, shouldn't these should all test against the exact same single jar -- the one we will actually publish?

So I'm wondering if for purposes of compilation we can/should hardcode a JDK version? And if we do the same thing for the javadoc generation (setting it to say 17) it would fix the current issue that it's failing on JDK 11.

As for running tests though, I suppose it's okay to keep working as it has been? I don't know what the tradeoffs would be of moving to one distinct more-hermetic gradle target for each.

JakeWharton commented 2 years ago

Yes!

I meant to comment on the original PR but it landed before I had a chance. I wrote about this a bit here. Gradle makes this super easy. Set your toolchain to 18 (19 in a few weeks!) and create a test task for each JDK in your supported range.

kevinb9n commented 2 years ago

Whoa thanks, that's perfectly helpful!