Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourceCompatibility 1.7 and targetCompatibility 1.7 are obsolete, use 1.8 by default #2942

Merged

Conversation

misl6
Copy link
Member

@misl6 misl6 commented Dec 16, 2023

While upgrading to the new SDL2 (in fact the CI is failing), which uses lambdas in Java, I noticed we still have set both sourceCompatibility and targetCompatibility to 1.7 by default, unless androidx is enabled.

This PR makes 1.8 the default, even if androidx is disabled.

Some additional info about Java API on Android (and support for old APIs):

From #2927 CI run:

> Task :compileDebugJavaWithJavac FAILED

warning: [options] source value 7 is obsolete and will be removed in a future release

warning: [options] target value 7 is obsolete and will be removed in a future release

warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.

/Users/admin/.python-for-android/dists/bdist_unit_tests_app/src/main/java/org/libsdl/app/SDLAudioManager.java:37: error: lambda expressions are not supported in -source 7

                    Arrays.stream(addedDevices).forEach(deviceInfo -> addAudioDevice(deviceInfo.isSink(), deviceInfo.getId()));

                                                                   ^

  (use -source 8 or higher to enable lambda expressions)

/Users/admin/.python-for-android/dists/bdist_unit_tests_app/src/main/java/org/libsdl/app/SDLAudioManager.java:329: error: method references are not supported in -source 7

            return Arrays.stream(audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS)).mapToInt(AudioDeviceInfo::getId).toArray();

                                                                                                                      ^

  (use -source 8 or higher to enable method references)

2 errors

3 warnings

@misl6 misl6 changed the title sourceCompatibility 1.7 and targetCompatibility 1.7 are obsolete, use 1.8 by default sourceCompatibility 1.7 and targetCompatibility 1.7 are obsolete, use 1.8 by default Dec 16, 2023
Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

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

LGTM

@misl6 misl6 merged commit d35c70a into kivy:develop Dec 17, 2023
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.

2 participants