Skip to content

Commit

Permalink
Merge pull request #47 from TelemetryDeck/fix/41-library-version
Browse files Browse the repository at this point in the history
[#41] Send the correct library version for outgoing signals
  • Loading branch information
kkostov authored Jan 6, 2025
2 parents 6e99c9a + 5ddb6a7 commit 9587c06
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The Kotlin SDK for TelemetryDeck is available from Maven Central and can be used

```groovy
dependencies {
implementation 'com.telemetrydeck:kotlin-sdk:3.0.3'
implementation 'com.telemetrydeck:kotlin-sdk:3.0.4'
}
```

Expand Down
7 changes: 4 additions & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## Releasing a new version of the library

1. Update the library coordinates by incrementing the version in https://github.com/TelemetryDeck/KotlinSDK/blob/lib/build.gradle.kts#L103.
2. Update the README.md to instruct new users to use the latest version.
3. Commit and push.
1. Update the library coordinates by incrementing the version in https://github.com/TelemetryDeck/KotlinSDK/blob/lib/build.gradle.kts#L104.
2. Update the `sdkVersion` in `EnvironmentParameterProvider`
3. Update the README.md to instruct new users to use the latest version.
4. Commit and push.

### Publishing using GitHub Actions

Expand Down
2 changes: 1 addition & 1 deletion lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ dependencies {
}

mavenPublishing {
coordinates("com.telemetrydeck", "kotlin-sdk", "3.0.3")
coordinates("com.telemetrydeck", "kotlin-sdk", "3.0.4")

pom {
name = "TelemetryDeck SDK"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ internal class EnvironmentParameterProvider : TelemetryDeckProvider, TelemetryPr
private val platform: String = "Android"
private val os: String = "Android"
private val sdkName: String = "KotlinSDK"
private val sdkVersion: String = "3.0.4"

override fun fallbackRegister(ctx: Application?, client: TelemetryDeckSignalProcessor) {
register(ctx, client)
Expand All @@ -49,8 +50,8 @@ internal class EnvironmentParameterProvider : TelemetryDeckProvider, TelemetryPr

private fun appendSDKMetadata() {
metadata[SDK.Name.paramName] = sdkName
metadata[SDK.Version.paramName] = BuildConfig.LIBRARY_PACKAGE_NAME
metadata[SDK.NameAndVersion.paramName] = "$sdkName ${BuildConfig.LIBRARY_PACKAGE_NAME}"
metadata[SDK.Version.paramName] = sdkVersion
metadata[SDK.NameAndVersion.paramName] = "$sdkName $sdkVersion"
metadata[SDK.BuildType.paramName] = BuildConfig.BUILD_TYPE
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class EnvironmentMetadataProviderTest {
true
)
Assert.assertEquals(
queuedSignal?.payload?.contains("TelemetryDeck.SDK.version:com.telemetrydeck.sdk"),
queuedSignal?.payload?.any { it.startsWith("TelemetryDeck.SDK.version:") },
true
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class EnvironmentParameterProviderTest {
Assert.assertNotNull(queuedSignal)
Assert.assertEquals(
true,
queuedSignal?.payload?.contains("TelemetryDeck.SDK.version:com.telemetrydeck.sdk")
queuedSignal?.payload?.any { it.startsWith("TelemetryDeck.SDK.version:") }

)
}
Expand Down

0 comments on commit 9587c06

Please sign in to comment.