google / gson

A Java serialization/deserialization library to convert Java Objects into JSON and back
Apache License 2.0
23.13k stars 4.27k forks source link

Run japicmp against last release instead of previous commit #2692

Closed Marcono1234 closed 1 month ago

Marcono1234 commented 1 month ago

Purpose

Run japicmp against last release instead of previous commit

Description

This will also fix the recent build failures, e.g. in #2690, which are caused by the currently used JAPICMP-OLD version which seems to cause issues when the new JPMS module test (#2685) tries to use it as version for the module-info.class:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project jpms-test: Fatal error compiling: error: bad value for --module-version option: 'JAPICMP-OLD'

Advantages:

Disadvantages:

Here is also a small demo showing that this still works (performs incompatible change of JsonArray#add return type): https://github.com/Marcono1234/gson/actions/runs/9310443366

Marcono1234 commented 1 month ago

Note that this is most likely not the only solution to the current build failures (it just happens to solve them as well). Another alternative would be to replace JAPICMP-OLD with a different dummy version number, for example something like 0.0.0-JAPICMP-OLD might work.

Marcono1234 commented 1 month ago

Have marked this as Draft now again because I am not really sure whether the current or this approach here is better.

Marcono1234 commented 1 month ago

I am going to close this. Originally when I started creating this pull request, I thought the advantages outweighed the disadvantages. But afterwards I became aware of more potential disadvantages (which I added to the description of this pull request), and I am not sure anymore now if one approach is really better than the other.

Therefore it might be better to keep the current approach for now.