From 1fdafc95e7d66e2fc89790e2c5f45fc063ab081b Mon Sep 17 00:00:00 2001 From: Roman Zavarnitsyn Date: Thu, 2 Mar 2023 15:59:24 +0100 Subject: [PATCH] Add integration test with other plugins that resolve dependency tree (#442) --- CHANGELOG.md | 6 +- .../io/sentry/android/gradle/SentryPlugin.kt | 2 +- ...entryPluginWithDependencyCollectorsTest.kt | 56 +++++++++++++++++++ 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryPluginWithDependencyCollectorsTest.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 1da6a894..951aca90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ ### Dependencies -- Bump Android SDK from v6.13.0 to v6.13.1 ([#437](https://github.com/getsentry/sentry-android-gradle-plugin/pull/437)) - - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6131) - - [diff](https://github.com/getsentry/sentry-java/compare/6.13.0...6.13.1) +- Bump Android SDK from v6.13.0 to v6.15.0 ([#442](https://github.com/getsentry/sentry-android-gradle-plugin/pull/442)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6150) + - [diff](https://github.com/getsentry/sentry-java/compare/6.13.0...6.15.0) - Bump CLI from v2.12.0 to v2.13.0 ([#439](https://github.com/getsentry/sentry-android-gradle-plugin/pull/439)) - [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2130) - [diff](https://github.com/getsentry/sentry-cli/compare/2.12.0...2.13.0) diff --git a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryPlugin.kt b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryPlugin.kt index 928ea525..baed72e8 100644 --- a/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryPlugin.kt +++ b/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryPlugin.kt @@ -119,7 +119,7 @@ class SentryPlugin : Plugin { companion object { const val SENTRY_ORG_PARAMETER = "sentryOrg" const val SENTRY_PROJECT_PARAMETER = "sentryProject" - internal const val SENTRY_SDK_VERSION = "6.13.1" + internal const val SENTRY_SDK_VERSION = "6.15.0" internal val sep = File.separator diff --git a/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryPluginWithDependencyCollectorsTest.kt b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryPluginWithDependencyCollectorsTest.kt new file mode 100644 index 00000000..2e9bc5e3 --- /dev/null +++ b/plugin-build/src/test/kotlin/io/sentry/android/gradle/SentryPluginWithDependencyCollectorsTest.kt @@ -0,0 +1,56 @@ +package io.sentry.android.gradle + +import org.junit.Test +import kotlin.test.assertTrue + +class SentryPluginWithDependencyCollectorsTest : + BaseSentryPluginTest(androidGradlePluginVersion = "7.3.0", gradleVersion = "7.6") { + + @Test + fun `does not break when there are plugins that collect dependencies applied`() { + appBuildFile.writeText( + // language=Groovy + """ + plugins { + id "com.android.application" + id "io.sentry.android.gradle" + id "com.mikepenz.aboutlibraries.plugin" + id "com.google.android.gms.oss-licenses-plugin" + } + + android { + namespace 'com.example' + + buildTypes { + release { + minifyEnabled true + } + } + } + + dependencies { + implementation 'androidx.compose.runtime:runtime:1.3.0' + implementation 'androidx.compose.ui:ui:1.3.0' + } + + sentry { + autoUploadProguardMapping = false + } + """.trimIndent() + ) + + val result = runner + .appendArguments("app:assembleRelease") + .appendArguments("--console=plain") + .forwardOutput() + .build() + + assertTrue { "BUILD SUCCESSFUL" in result.output } + } + + override val additionalBuildClasspath: String = + """ + classpath 'com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:10.6.1' + classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5' + """.trimIndent() +}