Add mirai.enable.jvmtoolchain.special=false to disable jvmToolchain

This commit is contained in:
Karlatemp 2023-05-05 23:26:52 +08:00
parent bc8ff18b07
commit 96a772c5ca
No known key found for this signature in database
GPG Key ID: BA173CA2B9956C59
2 changed files with 10 additions and 2 deletions

View File

@ -156,6 +156,10 @@ private val POSSIBLE_NATIVE_TARGETS by lazy { setOf("mingwX64", "macosX64", "mac
const val JVM_TOOLCHAIN_VERSION = 8
val JVM_TOOLCHAIN_ENABLED by projectLazy {
rootProject.getLocalProperty("mirai.enable.jvmtoolchain.special", true)
}
/**
* ## Android Test 结构
*
@ -166,8 +170,10 @@ const val JVM_TOOLCHAIN_VERSION = 8
*/
fun Project.configureJvmTargetsHierarchical(androidNamespace: String) {
extensions.getByType(KotlinMultiplatformExtension::class.java).apply {
jvmToolchain(JVM_TOOLCHAIN_VERSION)
if (JVM_TOOLCHAIN_ENABLED) {
jvmToolchain(JVM_TOOLCHAIN_VERSION)
}
val commonMain by sourceSets.getting
val commonTest by sourceSets.getting

View File

@ -163,6 +163,8 @@ projects.module-path.enabled=false
projects.mirai-console.enabled=false
# 特殊配置,关闭 mirai-logging这会关闭所有日志转接模块
projects.mirai-logging.enabled=false
# 特殊配置,是否取消指定 jvmToolchain在本地 jvmTest 中需要访问 JDK 9+ 的内容时需要携带此配置
mirai.enable.jvmtoolchain.special=false
```
通常关闭 IDEA 插件和 Gradle 插件可以显著提高初始化速度IDEA 插件项目在初始化时需要下载 1G 左右编译依赖)。