Skip to content

Commit 930ae87

Browse files
authored
fix(gradle-plugin): allow new targets to be installed (#429)
* Update * Update * Update * Update * Update CHANGELOG.md
1 parent 02d3dc8 commit 930ae87

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Gradle Plugin: allow new supported targets to be installed ([#429](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/429))
8+
39
## 0.17.0
410

511
### Features

sentry-kotlin-multiplatform-gradle-plugin/src/main/java/io/sentry/kotlin/multiplatform/gradle/SentryPlugin.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ internal fun Project.installSentryForKmp(
149149
return
150150
}
151151

152-
val unsupportedTargets = listOf("wasm", "js", "mingw", "linux", "androidNative")
152+
val unsupportedTargets = listOf("androidNative")
153153
kmpExtension.targets.forEach { target ->
154154
if (unsupportedTargets.any { unsupported -> target.name.contains(unsupported) }) {
155155
throw GradleException(
156156
"Unsupported target: ${target.name}. " +
157157
"Cannot auto install in commonMain. " +
158158
"Please create an intermediate sourceSet with targets that the Sentry SDK " +
159-
"supports (apple, jvm, android) and add the dependency manually."
159+
"supports and add the dependency manually."
160160
)
161161
}
162162
}

sentry-kotlin-multiplatform-gradle-plugin/src/test/java/io/sentry/kotlin/multiplatform/gradle/SentryPluginTest.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import org.gradle.api.plugins.ExtensionAware
66
import org.gradle.testfixtures.ProjectBuilder
77
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
88
import org.jetbrains.kotlin.gradle.plugin.cocoapods.CocoapodsExtension
9-
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
109
import org.junit.jupiter.api.Assertions.assertEquals
1110
import org.junit.jupiter.api.Assertions.assertNotNull
1211
import org.junit.jupiter.api.Assertions.assertNull
@@ -154,9 +153,8 @@ class SentryPluginTest {
154153
assertTrue(commonMainConfiguration!!.dependencies.contains(sentryDependency))
155154
}
156155

157-
@OptIn(ExperimentalWasmDsl::class)
158156
@ParameterizedTest(name = "installSentryForKmp throws if build contains unsupported target {0}")
159-
@ValueSource(strings = ["wasm", "js", "mingw", "linux", "androidNative"])
157+
@ValueSource(strings = ["androidNative"])
160158
fun `installSentryForKmp throws if build contains any unsupported target`(unsupportedTarget: String) {
161159
val project = ProjectBuilder.builder().build()
162160
project.pluginManager.apply("org.jetbrains.kotlin.multiplatform")
@@ -165,10 +163,6 @@ class SentryPluginTest {
165163
val kmpExtension = project.extensions.getByType(KotlinMultiplatformExtension::class.java)
166164
kmpExtension.apply {
167165
when (unsupportedTarget) {
168-
"wasm" -> wasmJs()
169-
"js" -> js()
170-
"mingw" -> mingwX64()
171-
"linux" -> linuxX64()
172166
"androidNative" -> androidNativeArm64()
173167
}
174168
}

0 commit comments

Comments
 (0)