6.7.0 - Alpha6 - 使用 Toolchain 替代 sourceCompatibility/targetCompatibility 以降低构建环境差异
This commit is contained in:
@@ -52,6 +52,14 @@ gradlePlugin {
|
||||
t.description = "Provides properties helpers."
|
||||
}
|
||||
})
|
||||
create("jvmConvention", object : Action<PluginDeclaration> {
|
||||
override fun execute(t: PluginDeclaration) {
|
||||
t.id = "org.autojs.build.jvm-convention"
|
||||
t.implementationClass = "org.autojs.build.JvmConventionPlugin"
|
||||
t.displayName = "AutoJs6 JVM Convention Plugin"
|
||||
t.description = "Configures Java/Kotlin targets for Android modules using central Versions."
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,3 +17,10 @@ dependencyResolutionManagement {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
// @Hint by SuperMonster003 on Sep 14, 2025.
|
||||
// ! Enable JDK auto-resolution/download capability for build modules.
|
||||
// ! zh-CN: 让构建模块具备 JDK 自动解析/下载能力.
|
||||
id("org.gradle.toolchains.foojay-resolver-convention")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
@file:Suppress("unused")
|
||||
|
||||
package org.autojs.build
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
|
||||
/**
|
||||
* Convention plugin: Unified Java/Kotlin target version configuration for Android modules.
|
||||
*
|
||||
* zh-CN: 约定插件: 为 Android 模块统一配置 Java/Kotlin 目标版本.
|
||||
*
|
||||
* - `id`: "org.autojs.build.jvm-convention"
|
||||
* - `implementationClass`: "org.autojs.build.JvmConventionPlugin"
|
||||
* - `displayName`: "AutoJs6 JVM Convention Plugin"
|
||||
* - `description`: "Configures Java/Kotlin targets for Android modules using central Versions."
|
||||
*
|
||||
* Apply this plugin to your Android module's `build.gradle.kts`:
|
||||
*
|
||||
* zh-CN: 在 Android 模块的 `build.gradle.kts` 中应用此插件:<br>
|
||||
*
|
||||
* ```kts
|
||||
* plugins {
|
||||
* id("org.autojs.build.jvm-convention")
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
class JvmConventionPlugin : Plugin<Project> {
|
||||
override fun apply(project: Project) {
|
||||
Utils.configureJvmForAndroidModule(project)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user