Skip to content

Commit

Permalink
Fix several build warnings
Browse files Browse the repository at this point in the history
- Opt-in to expect-actual classes experimental feature
- Suppress default hierarchy template warning
- Remove obsolete kotlin.Experimental opt-in
  • Loading branch information
ilya-g committed Dec 1, 2023
1 parent 5def197 commit 2616a9d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import javax.xml.parsers.DocumentBuilderFactory
import java.io.ByteArrayOutputStream
import java.io.PrintWriter
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
kotlin("multiplatform")
Expand Down Expand Up @@ -116,6 +117,11 @@ kotlin {
}
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}

sourceSets.all {
val suffixIndex = name.indexOfLast { it.isUpperCase() }
val targetName = name.substring(0, suffixIndex)
Expand Down
1 change: 0 additions & 1 deletion core/native/src/Parser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ internal fun <T, S> Parser<T>.chainIgnoring(other: Parser<S>): Parser<T> =
internal fun <T, S> Parser<T>.chainSkipping(other: Parser<S>): Parser<S> =
chain(other).map { (_, s) -> s }

@SharedImmutable
internal val eofParser: Parser<Unit> = { str, pos ->
if (str.length > pos) {
throw parseException("extraneous input", pos)
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ java.modularToolchainVersion=11
kotlin.js.compiler=ir
kotlin.native.ignoreIncorrectDependencies=true
kotlin.native.ignoreDisabledTargets=true
kotlin.mpp.applyDefaultHierarchyTemplate=false

# Workaround for Bintray treating .sha512 files as artifacts
# https://github.com/gradle/gradle/issues/11412
Expand Down
3 changes: 0 additions & 3 deletions serialization/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ kotlin {
val suffix = name.substring(suffixIndex).toLowerCase(Locale.ROOT).takeIf { it != "main" }
kotlin.srcDir("$targetName/${suffix ?: "src"}")
resources.srcDir("$targetName/${suffix?.let { it + "Resources" } ?: "resources"}")
languageSettings {
optIn("kotlin.Experimental")
}
}

targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
Expand Down

0 comments on commit 2616a9d

Please sign in to comment.