Skip to content
Draft
22 changes: 6 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
job_build_upload:
name: Build and upload distribution artifact
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout current commit (${{ github.sha }})
uses: actions/checkout@v3
Expand All @@ -24,15 +25,8 @@ jobs:
distribution: 'temurin'
java-version: '17'

- name: Build Gradle Plugin distribution artifacts
run: |
cd plugin-build
make all

- name: Build Kotlin Compiler artifacts
run: |
cd sentry-kotlin-compiler-plugin
make all
run: make -i preMerge

- name: Archive artifacts
uses: actions/upload-artifact@v3
Expand All @@ -42,11 +36,7 @@ jobs:
${{ github.workspace }}/plugin-build/build/distributions/*.zip
${{ github.workspace }}/sentry-kotlin-compiler-plugin/build/distributions/*.zip

- name: Verifies Sentry CLI is bundled
shell: bash
run: |
zipfile=$(ls -1 plugin-build/build/distributions | grep -v "PluginMarker")
filename=${zipfile/\.zip/}
unzip plugin-build/build/distributions/$filename.zip -d /tmp
unzip /tmp/$filename/$filename.jar -d /tmp/jar/
find /tmp/jar | grep "bin/sentry-cli"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@v3
with:
name: sentry-android-gradle-plugin
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ clean:
./gradlew clean

preMerge:
./gradlew preMerge --continue
./gradlew :sentry-kotlin-compiler-plugin:test ;
./gradlew :sentry-kotlin-compiler-plugin:jacocoTestReport ;
./gradlew :plugin-build:test ;
./gradlew :plugin-build:jacocoTestReport


# We stop gradle at the end to make sure the cache folders
# don't contain any lock files and are free to be cached.
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ tasks.register("preMerge") {
dependsOn(gradle.includedBuild("sentry-kotlin-compiler-plugin").task(":check"))
dependsOn(gradle.includedBuild("sentry-kotlin-compiler-plugin").task(":publishAllPublicationsToMavenTestRepoRepository"))

dependsOn(":examples:android-gradle:check")
/*dependsOn(":examples:android-gradle:check")
dependsOn(":examples:android-gradle-kts:check")
dependsOn(":examples:android-ndk:check")
dependsOn(":examples:android-instrumentation-sample:check")
dependsOn(":examples:android-room-lib:check")
dependsOn(":examples:android-room-lib:check")*/
dependsOn(gradle.includedBuild("plugin-build").task(":check"))
}

Expand Down
19 changes: 19 additions & 0 deletions plugin-build/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ plugins {
id("io.sentry.android.gradle.aar2jar")
id("com.github.johnrengelman.shadow") version BuildPluginsVersion.SHADOW
id("com.github.gmazzo.buildconfig") version BuildPluginsVersion.BUILDCONFIG
jacoco
id("org.jetbrains.kotlinx.kover") version "0.7.3"
}

jacoco {
toolVersion = "0.8.10"
}

tasks.jacocoTestReport {
reports {
xml.required.set(true)
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}
}

allprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ abstract class BaseSentryNonAndroidPluginTest(
fun parameters() = listOf(
// The supported Gradle version can be found here:
// https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
arrayOf("7.2"),
/*arrayOf("7.2"),
arrayOf("7.3.3"),
arrayOf("7.4"),
arrayOf("7.5"),
arrayOf("7.6"),
arrayOf("8.0.2"),
arrayOf("8.1")
arrayOf("8.1")*/
arrayOf("7.5")
)

internal fun GradleRunner.appendArguments(vararg arguments: String) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,14 @@ abstract class BaseSentryPluginTest(
// The supported Gradle version can be found here:
// https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// The pair is [AGP Version, Gradle Version]
arrayOf("7.0.4", "7.2"),
/*arrayOf("7.0.4", "7.2"),
arrayOf("7.1.3", "7.3.3"),
arrayOf("7.2.1", "7.4"),
arrayOf("7.3.0", "7.5"),
arrayOf("7.4.0", "7.6"),
arrayOf("8.0.0", "8.0.2"),
arrayOf("8.1.0-alpha11", "8.1")
arrayOf("8.1.0-alpha11", "8.1") */
arrayOf("7.3.0", "7.5"),
)

internal fun GradleRunner.appendArguments(vararg arguments: String) =
Expand Down
7 changes: 7 additions & 0 deletions sentry-kotlin-compiler-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("distribution")
id("com.vanniktech.maven.publish") version "0.17.0"
id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
jacoco
}

allprojects {
Expand All @@ -13,6 +14,12 @@ allprojects {
}
}

tasks.jacocoTestReport {
reports {
xml.required.set(true)
}
}

ktlint {
debug.set(false)
verbose.set(true)
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ pluginManagement {

rootProject.name = ("sentry-android-gradle-plugin-composite-build")

include(":examples:android-gradle")
/*include(":examples:android-gradle")
include(":examples:android-gradle-kts")
include(":examples:android-guardsquare-proguard")
include(":examples:android-ndk")
include(":examples:android-instrumentation-sample")
include(":examples:android-room-lib")
include(":examples:spring-boot-sample")
include(":examples:spring-boot-sample")*/
includeBuild("plugin-build") {
dependencySubstitution {
substitute(module("io.sentry:sentry-android-gradle-plugin")).using(project(":"))
Expand Down