Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/user-apps
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Sep 25, 2024
2 parents 7182288 + 59630f2 commit 17ec83f
Show file tree
Hide file tree
Showing 120 changed files with 5,325 additions and 580 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deployment-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
java-version: 21
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
run: ./gradlew --stacktrace --info build
release:
Expand All @@ -54,9 +54,9 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
java-version: 21
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
run: ./gradlew --stacktrace --info build
- name: Publish with Gradle
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
java-version: 21
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
- name: Build docs with Gradle
run: ./gradlew --stacktrace --info dokkaHtmlMultiModule
- name: Deploy docs to GitHub Pages
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

16 changes: 11 additions & 5 deletions buildSrc/src/main/kotlin/Compiler.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import org.gradle.api.NamedDomainObjectSet
import org.gradle.kotlin.dsl.assign
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet

val kordOptIns = listOf(
Expand All @@ -12,16 +14,20 @@ val kordOptIns = listOf(
"dev.kord.common.annotation.KordVoice",
)

object Jvm {
const val target = 8
}

fun KotlinCommonCompilerOptions.applyKordCompilerOptions() {
internal fun KotlinCommonCompilerOptions.applyKordCommonCompilerOptions() {
allWarningsAsErrors = true
progressiveMode = true
freeCompilerArgs.add("-Xexpect-actual-classes")
}

internal const val KORD_JVM_TARGET = 8

internal fun KotlinJvmCompilerOptions.applyKordJvmCompilerOptions() {
applyKordCommonCompilerOptions()
jvmTarget = JVM_1_8
freeCompilerArgs.add("-Xjdk-release=1.8")
}

internal fun NamedDomainObjectSet<KotlinSourceSet>.applyKordTestOptIns() {
named { it.contains("test", ignoreCase = true) }.configureEach {
// allow `ExperimentalCoroutinesApi` for `TestScope.currentTime`
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Documentation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fun AbstractDokkaLeafTask.applyKordDokkaOptions() {

dokkaSourceSets.configureEach {

jdkVersion = Jvm.target
jdkVersion = 23

suppressGeneratedFiles = false

Expand Down
9 changes: 7 additions & 2 deletions buildSrc/src/main/kotlin/kord-internal-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ repositories {
}

kotlin {
jvmToolchain(Jvm.target)
compilerOptions {
applyKordCompilerOptions()
applyKordJvmCompilerOptions()
}
}

tasks {
withType<JavaCompile>().configureEach {
options.release = KORD_JVM_TARGET
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ repositories {
mavenCentral()
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
kotlin {
jvm()
compilerOptions {
applyKordCommonCompilerOptions()
}

jvm {
compilerOptions {
applyKordJvmCompilerOptions()
}
}
js {
nodejs()
useCommonJs()
}
jvmToolchain(Jvm.target)

@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
applyKordCompilerOptions()
}
}

tasks {
Expand Down
9 changes: 5 additions & 4 deletions buildSrc/src/main/kotlin/kord-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ apiValidation {

kotlin {
explicitApi()

jvmToolchain(Jvm.target)

compilerOptions {
applyKordCompilerOptions()
applyKordJvmCompilerOptions()
optIn.addAll(kordOptIns)
}

Expand All @@ -45,6 +42,10 @@ tasks {
withType<AbstractDokkaLeafTask>().configureEach {
applyKordDokkaOptions()
}

withType<JavaCompile>().configureEach {
options.release = KORD_JVM_TARGET
}
}

publishing {
Expand Down
18 changes: 10 additions & 8 deletions buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,19 @@ apiValidation {
applyKordBCVOptions()
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
kotlin {
explicitApi()
compilerOptions {
applyKordCommonCompilerOptions()
optIn.addAll(kordOptIns)
}

jvm()
jvm {
compilerOptions {
applyKordJvmCompilerOptions()
}
}
js {
nodejs {
testTask {
Expand All @@ -39,13 +48,6 @@ kotlin {
}
useCommonJs()
}
jvmToolchain(Jvm.target)

@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
applyKordCompilerOptions()
optIn.addAll(kordOptIns)
}

applyDefaultHierarchyTemplate()

Expand Down
Loading

0 comments on commit 17ec83f

Please sign in to comment.