Skip to content

Build: Switch from -Xjvm-default=all-compatibility to -Xjvm-default=all#175

Merged
Johni0702 merged 1 commit intomasterfrom
feature/switch-to-jvm-default-all
Mar 12, 2026
Merged

Build: Switch from -Xjvm-default=all-compatibility to -Xjvm-default=all#175
Johni0702 merged 1 commit intomasterfrom
feature/switch-to-jvm-default-all

Conversation

@Johni0702
Copy link
Contributor

@Johni0702 Johni0702 commented Mar 10, 2026

So the Kotlin compiler no longer generates the (unnecessary) DefaultImpls classes for new interfaces.
Existing interfaces are annotated with JvmDefaultWithCompatibility to preserve backwards compatibility.

The bump to our Kotlin dependency was required because JvmDefaultWithCompatibility was only introduced with Kotlin 1.6. But since we were compiling with 1.6 as our target, we were implicitly depending on that already anyway.

…t=all`

So the Kotlin compiler longer generates the (unnecessary) DefaultImpls
classes for new interfaces.
Existing interfaces are annotated with JvmDefaultWithCompatibility to
preserve backwards compatibility.

The bump to our Kotlin dependency was required because
JvmDefaultWithCompatibility was only introduced with Kotlin 1.6. But
since we were compiling with 1.6 as our target, we were implicitly
depending on that already anyway.

Co-authored-by: Jonas Herzig <jonas@spark-squared.com>
Copy link

@Traben-0 Traben-0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, seems to tag all the interfaces it should be tagging, e.g ones with default impls

@Johni0702 Johni0702 merged commit dc1f3be into master Mar 12, 2026
1 check passed
@Johni0702 Johni0702 deleted the feature/switch-to-jvm-default-all branch March 12, 2026 11:26
Johni0702 added a commit that referenced this pull request Mar 12, 2026
…` to `all`

With #175, Elementa now
uses `-Xjvm-default=all`, so we no longer need to explicitly mark new
interfaces with `JvmDefaultWithoutCompatibility`.

We don't need to mark anything with `JvmDefaultWithCompatibility`
because both, `statev2` and `layoutdsl`, projects are still considered
unstable, so we don't care about their ABI changing.

Source-Commit: fb810b4ef95f641bd02d9493312c9743025b45b2
Johni0702 added a commit that referenced this pull request Mar 12, 2026
…` to `all`

With #175, Elementa now
uses `-Xjvm-default=all`, so we no longer need to explicitly mark new
interfaces with `JvmDefaultWithoutCompatibility`.

We don't need to mark anything with `JvmDefaultWithCompatibility`
because both, `statev2` and `layoutdsl`, projects are still considered
unstable, so we don't care about their ABI changing.

(We were already using `all` in Elementa's build script, just not in
Essential's version of these projects, hence why this doesn't actually
modify the build script.)

Source-Commit: fb810b4ef95f641bd02d9493312c9743025b45b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants