Skip to content

Commit f738c20

Browse files
committed
Merge branch 'main' into release/0.10.0
2 parents 2aa98e3 + abf8a8e commit f738c20

File tree

11 files changed

+119
-21
lines changed

11 files changed

+119
-21
lines changed

.craft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ targets:
1010
mavenRepoUrl: https://oss.sonatype.org/service/local/staging/deploy/maven2/
1111
android:
1212
distDirRegex: /^(sentry-android-|.*-android).*$/
13-
fileReplaceeRegex: /\d\.\d\.\d(-\w+(\.\d)?)?(-SNAPSHOT)?/
13+
fileReplaceeRegex: /\d+\.\d+\.\d+(-\w+(\.\d+)?)?(-SNAPSHOT)?/
1414
fileReplacerStr: release.aar
1515
kmp:
1616
rootDistDirRegex: /^(?!.*(?:jvm|android|ios|watchos|tvos|macos)).*$/

.github/workflows/upload-artifacts.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ jobs:
3333
cd sentry-kotlin-multiplatform-gradle-plugin
3434
./gradlew distZip sentryPluginMarkerDistZip
3535
36+
- name: Validate distributions
37+
run: |
38+
./gradlew validateDistributions
39+
3640
- name: Archive packages
3741
uses: actions/upload-artifact@v4
3842
with:

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Sentry.init { options ->
1717

1818
### Dependencies
1919

20-
- Bump Cocoa SDK from v8.36.0 to v8.37.0 ([#279](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/279))
21-
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8370)
22-
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.36.0...8.37.0)
20+
- Bump Cocoa SDK from v8.36.0 to v8.38.0 ([#279](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/279), [#285](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/285))
21+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8380)
22+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.36.0...8.38.0)
2323
- Bump Java SDK from v7.14.0 to v7.15.0 ([#284](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/284))
2424
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7150)
2525
- [diff](https://github.com/getsentry/sentry-java/compare/7.14.0...7.15.0)

build.gradle.kts

Lines changed: 97 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import com.diffplug.spotless.LineEnding
22
import com.vanniktech.maven.publish.MavenPublishPlugin
33
import com.vanniktech.maven.publish.MavenPublishPluginExtension
44
import io.gitlab.arturbosch.detekt.Detekt
5+
import java.util.zip.ZipFile
56

67
plugins {
78
id(Config.gradleMavenPublishPlugin).version(Config.gradleMavenPublishPluginVersion)
@@ -15,7 +16,8 @@ plugins {
1516
id(Config.BuildPlugins.buildConfig).version(Config.BuildPlugins.buildConfigVersion).apply(false)
1617
kotlin(Config.kotlinSerializationPlugin).version(Config.kotlinVersion).apply(false)
1718
id(Config.QualityPlugins.kover).version(Config.QualityPlugins.koverVersion).apply(false)
18-
id(Config.QualityPlugins.binaryCompatibility).version(Config.QualityPlugins.binaryCompatibilityVersion).apply(false)
19+
id(Config.QualityPlugins.binaryCompatibility).version(Config.QualityPlugins.binaryCompatibilityVersion)
20+
.apply(false)
1921
}
2022

2123
allprojects {
@@ -39,8 +41,8 @@ subprojects {
3941
val distributionFilePath =
4042
"${this.project.buildDir}${sep}distributions${sep}${this.project.name}-${this.project.version}.zip"
4143
val file = File(distributionFilePath)
42-
if (!file.exists()) throw IllegalStateException("Distribution file: $distributionFilePath does not exist")
43-
if (file.length() == 0L) throw IllegalStateException("Distribution file: $distributionFilePath is empty")
44+
if (!file.exists()) throw GradleException("Distribution file: $distributionFilePath does not exist")
45+
if (file.length() == 0L) throw GradleException("Distribution file: $distributionFilePath is empty")
4446
}
4547
}
4648

@@ -61,6 +63,98 @@ subprojects {
6163
}
6264
}
6365

66+
tasks.register("validateDistributions") {
67+
subprojects {
68+
val subproject = this@subprojects
69+
if (subproject.name == "sentry-kotlin-multiplatform") {
70+
subproject.validateKotlinMultiplatformCoreArtifacts()
71+
}
72+
}
73+
}
74+
75+
private fun Project.validateKotlinMultiplatformCoreArtifacts() {
76+
val distributionDir = project.layout.buildDirectory.dir("distributions").get().asFile
77+
val expectedNumOfFiles = 15
78+
val filesList = distributionDir.listFiles()
79+
val actualNumOfFiles = filesList?.size ?: 0
80+
81+
if (actualNumOfFiles == expectedNumOfFiles) {
82+
println("✅ Found $actualNumOfFiles distribution files as expected.")
83+
} else {
84+
throw GradleException("❌ Expected $expectedNumOfFiles distribution files, but found $actualNumOfFiles")
85+
}
86+
87+
val baseFileName = "sentry-kotlin-multiplatform"
88+
val platforms = listOf(
89+
"watchosx64", "watchossimulatorarm64", "watchosarm64", "watchosarm32",
90+
"tvosx64", "tvossimulatorarm64", "tvosarm64",
91+
"macosx64", "macosarm64",
92+
"jvm",
93+
"iosx64", "iossimulatorarm64", "iosarm64",
94+
"android"
95+
)
96+
97+
val artifactPaths = buildList {
98+
add(distributionDir.resolve("$baseFileName-$version.zip"))
99+
addAll(
100+
platforms.map { platform ->
101+
distributionDir.resolve("$baseFileName-$platform-$version.zip")
102+
}
103+
)
104+
}
105+
106+
val commonRequiredEntries = listOf(
107+
"javadoc",
108+
"sources",
109+
"module",
110+
"pom-default.xml"
111+
)
112+
113+
artifactPaths.forEach { artifactFile ->
114+
if (!artifactFile.exists()) {
115+
throw GradleException("❌ Artifact file: ${artifactFile.path} does not exist")
116+
}
117+
if (artifactFile.length() == 0L) {
118+
throw GradleException("❌ Artifact file: ${artifactFile.path} is empty")
119+
}
120+
121+
ZipFile(artifactFile).use { zip ->
122+
val entries = zip.entries().asSequence().map { it.name }.toList()
123+
124+
commonRequiredEntries.forEach { requiredEntry ->
125+
if (entries.none { it.contains(requiredEntry) }) {
126+
throw GradleException("$requiredEntry not found in ${artifactFile.name}")
127+
} else {
128+
println("✅ Found $requiredEntry in ${artifactFile.name}")
129+
}
130+
}
131+
132+
when {
133+
artifactFile.name.contains("ios", ignoreCase = true) ||
134+
artifactFile.name.contains("macos", ignoreCase = true) ||
135+
artifactFile.name.contains("watchos", ignoreCase = true) ||
136+
artifactFile.name.contains("tvos", ignoreCase = true) -> {
137+
val expectedNumOfKlibFiles = 3
138+
val actualKlibFiles = entries.count { it.contains("klib") }
139+
if (actualKlibFiles != expectedNumOfKlibFiles) {
140+
throw GradleException("❌ Expected $expectedNumOfKlibFiles klib files in ${artifactFile.name}, but found $actualKlibFiles")
141+
} else {
142+
println("✅ Found $expectedNumOfKlibFiles klib files in ${artifactFile.name}")
143+
}
144+
}
145+
146+
artifactFile.name.contains("android", ignoreCase = true) -> {
147+
if (entries.none { it.contains("aar") }) {
148+
throw GradleException("❌ aar file not found in ${artifactFile.name}")
149+
} else {
150+
println("✅ Found aar file in ${artifactFile.name}")
151+
}
152+
}
153+
}
154+
}
155+
}
156+
}
157+
64158
subprojects {
65159
if (project.name.contains("sentry-kotlin-multiplatform")) {
66160
apply(plugin = Config.dokka)

buildSrc/src/main/java/Config.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object Config {
3636
val sentryAndroid = "io.sentry:sentry-android:$sentryJavaVersion"
3737
val sentryJava = "io.sentry:sentry:$sentryJavaVersion"
3838

39-
val sentryCocoaVersion = "8.37.0"
39+
val sentryCocoaVersion = "8.38.0"
4040
val sentryCocoa = "Sentry"
4141

4242
object Samples {

sentry-kotlin-multiplatform-gradle-plugin/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ id=io.sentry.kotlin.multiplatform.gradle
22
implementationClass=io.sentry.kotlin.multiplatform.gradle.SentryPlugin
33
versionName=0.10.0
44
group=io.sentry
5-
sentryCocoaVersion=8.37.0
5+
sentryCocoaVersion=8.38.0
66

77
# publication pom properties
88
POM_NAME=Sentry Kotlin Multiplatform Gradle Plugin

sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Pod::Spec.new do |spec|
1212
spec.osx.deployment_target = '10.13'
1313
spec.tvos.deployment_target = '11.0'
1414
spec.watchos.deployment_target = '4.0'
15-
spec.dependency 'Sentry', '8.37.0'
15+
spec.dependency 'Sentry', '8.38.0'
1616

1717
if !Dir.exist?('build/cocoapods/framework/sentry_kotlin_multiplatform.framework') || Dir.empty?('build/cocoapods/framework/sentry_kotlin_multiplatform.framework')
1818
raise "

sentry-kotlin-multiplatform/src/iosMain/kotlin/io/sentry/kotlin/multiplatform/extensions/SentryOptionsExtensions.ios.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ internal fun SentryOptions.toIosOptionsConfiguration(): (CocoaSentryOptions?) ->
2323
"errorSampleRate" to kmpOptions.experimental.sessionReplay.onErrorSampleRate?.toFloat()
2424
)
2525
).apply {
26-
setRedactAllText(kmpOptions.experimental.sessionReplay.maskAllText)
27-
setRedactAllImages(kmpOptions.experimental.sessionReplay.maskAllImages)
26+
setMaskAllText(kmpOptions.experimental.sessionReplay.maskAllText)
27+
setMaskAllImages(kmpOptions.experimental.sessionReplay.maskAllImages)
2828
kmpOptions.experimental.sessionReplay.sessionSampleRate?.let { setSessionSampleRate(it.toFloat()) }
2929
setQuality(kmpOptions.experimental.sessionReplay.quality.ordinal.toLong())
3030
}

sentry-kotlin-multiplatform/src/iosTest/kotlin/io/sentry/kotlin/multiplatform/PlatformOptions.ios.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ actual fun ApplePlatformOptions.assertApplePlatformSpecificOptions(options: Sent
4040
assertEquals(attachViewHierarchy, options.attachViewHierarchy)
4141
assertEquals(enableAppHangTracking, options.enableAppHangTracking)
4242
assertEquals(appHangTimeoutIntervalMillis, options.appHangTimeoutIntervalMillis)
43-
assertEquals(sessionReplay.redactAllText(), options.experimental.sessionReplay.maskAllText)
44-
assertEquals(sessionReplay.redactAllImages(), options.experimental.sessionReplay.maskAllImages)
43+
assertEquals(sessionReplay.maskAllText(), options.experimental.sessionReplay.maskAllText)
44+
assertEquals(sessionReplay.maskAllImages(), options.experimental.sessionReplay.maskAllImages)
4545
assertEquals(sessionReplay.onErrorSampleRate().toDouble(), options.experimental.sessionReplay.onErrorSampleRate)
4646
assertEquals(sessionReplay.sessionSampleRate().toDouble(), options.experimental.sessionReplay.sessionSampleRate)
4747
assertEquals(sessionReplay.quality(), options.experimental.sessionReplay.quality.ordinal.toLong())

sentry-samples/kmp-app-cocoapods/iosApp/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PODS:
2-
- Sentry (8.37.0):
3-
- Sentry/Core (= 8.37.0)
4-
- Sentry/Core (8.37.0)
2+
- Sentry (8.38.0):
3+
- Sentry/Core (= 8.38.0)
4+
- Sentry/Core (8.38.0)
55
- shared (1.0):
6-
- Sentry (= 8.37.0)
6+
- Sentry (= 8.38.0)
77

88
DEPENDENCIES:
99
- shared (from `../shared`)
@@ -17,8 +17,8 @@ EXTERNAL SOURCES:
1717
:path: "../shared"
1818

1919
SPEC CHECKSUMS:
20-
Sentry: ee060c09b2f7ec1240e95c766ab44c04c7bdb052
21-
shared: 4717ae7bad4e94adc1177508d0519ab174142885
20+
Sentry: 205813e7e758b53df157cedb8c55b31a14300645
21+
shared: 29ad91c0e6392887a08175041ce5c1ff1cb63ee7
2222

2323
PODFILE CHECKSUM: f282da88f39e69507b0a255187c8a6b644477756
2424

0 commit comments

Comments
 (0)