Skip to content

Commit

Permalink
Improve SKIE Kotlin incompatibility warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipDolnik committed May 28, 2024
1 parent 90cd574 commit 3f00c95
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package co.touchlab.skie.plugin
import co.touchlab.skie.plugin.configuration.skieExtension
import co.touchlab.skie.plugin.shim.KgpShim
import co.touchlab.skie.plugin.shim.KgpShimLoader
import co.touchlab.skie.plugin.util.SkieKotlinVariantResolver
import co.touchlab.skie.plugin.shim.SkieKotlinVariantResolver
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@file:Suppress("UnstableApiUsage")

package co.touchlab.skie.plugin.shim

import co.touchlab.skie.gradle.KotlinCompilerVersion
import co.touchlab.skie.gradle_plugin_impl.BuildConfig
import co.touchlab.skie.plugin.util.exclude
import co.touchlab.skie.plugin.util.named
import co.touchlab.skie.plugin.util.reportSkieLoaderError
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.attributes.Category
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.touchlab.skie.plugin.util
package co.touchlab.skie.plugin.shim

import co.touchlab.skie.gradle_plugin_impl.BuildConfig
import org.gradle.api.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package co.touchlab.skie.plugin.shim

import co.touchlab.skie.plugin.configuration.skieExtension
import org.gradle.api.Project

fun Project.reportSkieLoaderError(error: String) {
afterEvaluate {
// Intentionally not checking for the macOS platform
val isSkieSupposedToBeEnabled = skieExtension.isEnabled.get()

if (isSkieSupposedToBeEnabled) {
val errorMessage = """
|Error: ${error.replace("\n", "\n|")}
|SKIE cannot not be used until this error is resolved.
|To proceed with the compilation, please remove or explicitly disable SKIE by adding 'skie { isEnabled = false }' to your Gradle configuration.
""".trimMargin()

error(errorMessage)
}
}
}

This file was deleted.

0 comments on commit 3f00c95

Please sign in to comment.