Upgrade buildscript for Kotlin 1.6.0, use Gradle 7.2

This commit is contained in:
Him188 2021-11-18 03:05:50 +00:00
parent 26c099798b
commit 5368e6b809
8 changed files with 18 additions and 21 deletions

View File

@ -51,8 +51,8 @@ dependencies {
api("com.github.jengelman.gradle.plugins", "shadow", version("shadow"))
api("org.jetbrains.kotlin", "kotlin-gradle-plugin", version("kotlinCompiler"))
api("org.jetbrains.kotlin", "kotlin-compiler-embeddable", version("kotlinCompiler"))
api(ktor("client-okhttp", "1.4.3"))
// api("org.jetbrains.kotlin", "kotlin-compiler-embeddable", version("kotlinCompiler"))
// api(ktor("client-okhttp", "1.4.3"))
api("com.android.tools.build", "gradle", version("androidGradlePlugin"))
api(asm("tree"))
api(asm("util"))

View File

@ -38,7 +38,7 @@ fun Project.configureRemoteRepos() {
// sonatype
val keys = SecretKeys.getCache(project)
repositories {
if (System.getenv("MIRAI_IS_SNAPSHOTS_PUBLISHING").toBoolean()) {
if (System.getenv("MIRAI_IS_SNAPSHOTS_PUBLISHING")?.toBoolean() == true) {
maven {
name = "MiraiRepo"
setUrl(System.getenv("SNAPSHOTS_PUBLISHING_URL"))

View File

@ -32,7 +32,7 @@ fun Project.configureJvmTarget() {
val defaultVer = JavaVersion.VERSION_1_8
tasks.withType(KotlinJvmCompile::class.java) {
kotlinOptions.languageVersion = "1.5"
kotlinOptions.languageVersion = "1.6"
kotlinOptions.jvmTarget = defaultVer.toString()
kotlinOptions.freeCompilerArgs += "-Xjvm-default=all"
}
@ -151,7 +151,7 @@ val experimentalAnnotations = arrayOf(
"net.mamoe.mirai.console.util.ConsoleInternalApi",
"net.mamoe.mirai.console.util.ConsoleExperimentalApi",
"kotlinx.io.core.internal.DangerousInternalIoApi",
"kotlinx.io.core.internal.DangerousInternalIoApi"
)
fun Project.configureKotlinExperimentalUsages() {

View File

@ -20,21 +20,21 @@ object Versions {
const val console = project
const val consoleTerminal = project
const val kotlinCompiler = "1.5.30"
const val kotlinStdlib = "1.5.30"
const val kotlinCompiler = "1.6.0"
const val kotlinStdlib = kotlinCompiler
const val dokka = "1.6.0"
const val coroutines = "1.5.1"
const val atomicFU = "0.16.3"
const val coroutines = "1.6.0"
const val atomicFU = "0.17.0"
const val serialization = "1.2.2"
const val ktor = "1.5.4"
const val ktor = "1.6.5"
const val binaryValidator = "0.4.0"
const val io = "0.1.16"
const val coroutinesIo = "0.1.16"
const val blockingBridge = "1.10.6-1530.2"
const val blockingBridge = "1.10.6-160.1"
const val androidGradlePlugin = "4.1.1"
const val android = "4.1.1.4"
@ -54,9 +54,9 @@ object Versions {
// If you the versions below, you need to sync changes to mirai-console/buildSrc/src/main/kotlin/Versions.kt
const val yamlkt = "0.10.2"
const val intellijGradlePlugin = "1.1"
const val kotlinIntellijPlugin = "211-1.5.20-release-284-IJ7442.40" // keep to newest as kotlinCompiler
const val intellij = "2021.1.3" // don't update easily unless you want your disk space -= 500MB
const val intellijGradlePlugin = "1.3.0"
// const val kotlinIntellijPlugin = "211-1.5.20-release-284-IJ7442.40" // keep to newest as kotlinCompiler
const val intellij = "2021.3" // don't update easily unless you want your disk space -= 500MB
}

View File

@ -6,13 +6,11 @@
#
# https://github.com/mamoe/mirai/blob/master/LICENSE
#
# style guide
kotlin.code.style=official
# config
kotlin.incremental.multiplatform=true
kotlin.parallel.tasks.in.project=true
org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 --illegal-access=permit -Dkotlin.daemon.jvm.options=--illegal-access=permit --add-opens java.base/java.util=ALL-UNNAMED
org.gradle.parallel=true
org.gradle.vfs.watch=true
kotlin.mpp.enableGranularSourceSetsMetadata=true
@ -22,5 +20,5 @@ systemProp.org.gradle.internal.publish.checksums.insecure=true
gnsp.disableApplyOnlyOnRootProjectEnforcement=true
# We may target 15 with Kotlin 1.5 IR
mirai.android.target.api.level=24
# Enable if you want to use mavenLocal for both Gradle plugin and project dependencies resolutions.
systemProp.use.maven.local=false

View File

@ -6,7 +6,7 @@
#
# https://github.com/mamoe/mirai/blob/master/LICENSE
#
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists

View File

@ -25,6 +25,6 @@ dependencies {
api(project(":mirai-core-utils"))
}
if (!System.getenv("MIRAI_IS_SNAPSHOTS_PUBLISHING").toBoolean()) {
if (System.getenv("MIRAI_IS_SNAPSHOTS_PUBLISHING")?.toBoolean() != true) {
configurePublishing("mirai-core-all")
}

View File

@ -12,7 +12,6 @@ pluginManagement {
if (System.getProperty("use.maven.local") == "true") {
mavenLocal()
}
// mavenLocal()
gradlePluginPortal()
mavenCentral()
google()