Merge "Add -Xjvm-defaults=all to kotlin compilations" am: 01365d5890
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2139092 Change-Id: I71d6538976170f0ac5ebf3e520f853a4fefad3f1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
d5ac017c49
1 changed files with 7 additions and 0 deletions
|
@ -1072,6 +1072,13 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
|||
kotlincFlags := j.properties.Kotlincflags
|
||||
CheckKotlincFlags(ctx, kotlincFlags)
|
||||
|
||||
// This is needed for code that depends on libraries that use @JvmDefault
|
||||
// -Xjvm-default=all will be the default in a future version of kotlin
|
||||
// according to https://blog.jetbrains.com/kotlin/2020/07/kotlin-1-4-m3-generating-default-methods-in-interfaces/
|
||||
if flags.javaVersion >= JAVA_VERSION_8 {
|
||||
kotlincFlags = append(kotlincFlags, "-Xjvm-default=all")
|
||||
}
|
||||
|
||||
// Workaround for KT-46512
|
||||
kotlincFlags = append(kotlincFlags, "-Xsam-conversions=class")
|
||||
|
||||
|
|
Loading…
Reference in a new issue