-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kotlin to 1.8.0 and JDK Toolchain to 11 (#37220)
Summary: Pull Request resolved: #37220 I'm bumping Kotlin to 1.8.0 to align to the version used internally. On top of this, I had to configure the JDK toolchain to 11 as Kotlin 1.8 was changing the default version of the stdlib it ships with by default. This also shields us against problems once we'll bump to AGP 8 which requires JDK 17 but still allows to produce libraries that are JDK 11 compatible. Changelog: [Android] [Changed] - Kotlin to 1.8.0 and JDK Toolchain to 11 Reviewed By: cipolleschi Differential Revision: D45524689 fbshipit-source-id: 2558b5b6727b5d6e0e1e3cc58f0c6a85ddcefc4d
- Loading branch information
1 parent
9e893a9
commit 74987b6
Showing
8 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...act-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/JdkConfiguratorUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.react.utils | ||
|
||
import com.android.build.api.variant.AndroidComponentsExtension | ||
import org.gradle.api.JavaVersion | ||
import org.gradle.api.Project | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension | ||
|
||
internal object JdkConfiguratorUtils { | ||
/** | ||
* Function that takes care of configuring the JDK toolchain for Application projects. As we do | ||
* decide the JDK version based on the AGP version that RNGP brings over, here we can safely | ||
* configure the toolchain to 11. | ||
*/ | ||
fun configureJavaToolChains(project: Project) { | ||
project.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext -> | ||
ext.compileOptions.sourceCompatibility = JavaVersion.VERSION_11 | ||
ext.compileOptions.targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
project.pluginManager.withPlugin("org.jetbrains.kotlin.android") { | ||
project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(11) | ||
} | ||
project.pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { | ||
project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(11) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters