Skip to content

Commit

Permalink
Merge pull request #8 from simple-robot/dev/update-simbot-and-KT
Browse files Browse the repository at this point in the history
更新simbot到4.0.0-RC3, Kotlin到2.0.0
  • Loading branch information
ForteScarlet authored Jun 9, 2024
2 parents 413f326 + c1c52d8 commit a18d429
Show file tree
Hide file tree
Showing 11 changed files with 211 additions and 247 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
gradle-version: 8.5
arguments: |
publishToSonatype
closeAndReleaseStagingRepository
closeAndReleaseStagingRepositories
--info
--warning-mode all
-x test
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
gradle-version: 8.5
arguments: |
publishToSonatype
closeAndReleaseStagingRepository
closeAndReleaseStagingRepositories
--info
--warning-mode all
-x test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- uses: gradle/actions/setup-gradle@v3

- name: Gradle test and publish snapshot
run: gradle allTests publishToSonatype closeAndReleaseStagingRepository --info --warning-mode all "-Porg.gradle.daemon=false" "-Porg.gradle.jvmargs='-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8'"
run: gradle allTests publishToSonatype closeAndReleaseStagingRepositories --info --warning-mode all "-Porg.gradle.daemon=false" "-Porg.gradle.jvmargs='-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8'"

- name: Upload test reports
uses: actions/upload-artifact@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,5 @@ fabric.properties
.idea/caches/build_file_checksums.ser

generated-docs

.kotlin
7 changes: 1 addition & 6 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies {
implementation(libs.bundles.dokka)

// see https://github.com/gradle-nexus/publish-plugin
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
implementation("io.github.gradle-nexus:publish-plugin:2.0.0")

// simbot suspend transform gradle common
implementation(libs.simbot.gradle)
Expand All @@ -46,8 +46,3 @@ dependencies {
implementation(libs.bundles.gradle.common)
}

//tasks.withType<KotlinCompile> {
// kotlinOptions {
// languageVersion = "2.0"
// }
//}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/JsConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ inline fun Project.configWasmJsTest(block: () -> Unit = {}) {
// see https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0
rootProject.the<NodeJsRootExtension>().apply {
// nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
version = "21.0.0-v8-canary202309143a48826a08"
downloadBaseUrl = "https://nodejs.org/download/v8-canary"
}

tasks.withType<org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask>().configureEach {
Expand Down
25 changes: 14 additions & 11 deletions buildSrc/src/main/kotlin/JvmConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,22 @@ import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.getByName
import org.gradle.kotlin.dsl.withType
import org.gradle.process.CommandLineArgumentProvider
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget


@OptIn(ExperimentalKotlinGradlePluginApi::class)
inline fun KotlinJvmTarget.configJava(crossinline block: KotlinJvmTarget.() -> Unit = {}) {
withJava()
compilations.all {
kotlinOptions {
javaParameters = true
freeCompilerArgs = freeCompilerArgs + listOf("-Xjvm-default=all")
}
compilerOptions {
javaParameters = true
freeCompilerArgs.addAll(
"-Xjvm-default=all"
)
}

testRuns["test"].executionTask.configure {
Expand Down Expand Up @@ -68,8 +70,7 @@ inline fun KotlinJvmProjectExtension.configKotlinJvm(
compilerOptions {
javaParameters = true
jvmTarget.set(JvmTarget.fromTarget(jdkVersion.toString()))
// freeCompilerArgs.addAll("-Xjvm-default=all", "-Xjsr305=strict")
freeCompilerArgs.set(freeCompilerArgs.getOrElse(emptyList()) + listOf("-Xjvm-default=all", "-Xjsr305=strict"))
freeCompilerArgs.addAll("-Xjvm-default=all", "-Xjsr305=strict")
}
block()
}
Expand All @@ -85,10 +86,12 @@ inline fun Project.configJavaCompileWithModule(
targetCompatibility = jvmVersion

if (moduleName != null) {
options.compilerArgumentProviders.add(CommandLineArgumentProvider {
// Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work
listOf("--patch-module", "$moduleName=${sourceSets["main"].output.asPath}")
})
options.compilerArgumentProviders.add(
CommandLineArgumentProvider {
// Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work
listOf("--patch-module", "$moduleName=${sourceSets["main"].output.asPath}")
}
)
}

block()
Expand Down
18 changes: 9 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[versions]
kotlin = "1.9.22"
kotlinx-coroutines = "1.8.0"
kotlinx-serialization = "1.6.2"
kotlin = "2.0.0"
kotlinx-coroutines = "1.8.1"
kotlinx-serialization = "1.6.3"
kotlinx-datetime = "0.5.0"
dokka = "1.9.20"
okio = "3.3.0"
ktor = "2.3.7"
ktor = "2.3.8"
openjdk-jmh = "1.35"
log4j = "2.20.0"
reactor = "3.6.2"
# simbot
simbot = "4.0.0-beta3"
suspendTransform = "0.6.0"
gradleCommon = "0.2.0"
simbot = "4.0.0-RC3"
suspendTransform = "0.8.0-beta1"
gradleCommon = "0.4.0"
# ksp
ksp = "1.9.22-1.0.17"
ksp = "2.0.0-1.0.22"
# https://square.github.io/kotlinpoet/
kotlinPoet = "1.16.0"
kotlinPoet = "1.17.0"
# https://mockk.io/
mockk = "1.13.10"
# https://detekt.dev/docs/intro
Expand Down
Loading

0 comments on commit a18d429

Please sign in to comment.