spotify / completable-futures

Utilities for working with futures in Java 8
Apache License 2.0
393 stars 51 forks source link

Provide a module descriptor for usage with JPMS #82

Closed A248 closed 3 years ago

A248 commented 3 years ago

completable-futures needs to at least declare an Automatic-Module-Name entry for stable use under JPMS.

Ideally, it would provide a full module descriptor, a.k.a a module-info file.

mattnworb commented 3 years ago

seems like a good idea, although I think it would also require increasing the target/release target from 8 to 9 or above

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/mattbrown/code/completable-futures/src/main/java/com/spotify/futures/module-info.java:[21,1] modules are not supported in -source 8
  (use -source 9 or higher to enable modules)
mattnworb commented 3 years ago

ah I suppose adding a Automatic-Module-Name attribute to the JAR wouldn't require any changes to the compiler target at all

A248 commented 3 years ago

seems like a good idea, although I think it would also require increasing the target/release target from 8 to 9 or above

It's entirely possible to keep the main sources strictly Java 8-compatible while compiling the module descriptor with JDK 9 or later. It will require some additional build logic, but nothing too complicated. Plenty of libraries have done so already.

mattnworb commented 3 years ago

It's entirely possible to keep the main sources strictly Java 8-compatible while compiling the module descriptor with JDK 9 or later. It will require some additional build logic, but nothing too complicated. Plenty of libraries have done so already.

Thats a fair point, and (adding a note to keep track of this for later) we have some prior art in https://github.com/spotify/futures-extra/pull/35 that can be used as a reference.

In #85 I added Automatic-Module-Name for now and can cut a release with that in it soon

mattnworb commented 3 years ago

0.3.5 should be in Maven Central shortly