Skip to content

Commit

Permalink
Merge branch 'next' into unity/new-session-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
rich-bugsnag authored Sep 13, 2021
2 parents 7952890 + b1c60f5 commit 242a936
Show file tree
Hide file tree
Showing 35 changed files with 728 additions and 522 deletions.
3 changes: 2 additions & 1 deletion .buildkite/pipeline.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ steps:
env:
MAVEN_VERSION: "3.6.1"
MINIMAL_FIXTURE: true
TEST_FIXTURE_NDK_VERSION: "16.1.4479499"
TEST_FIXTURE_NDK_VERSION: "17.2.4988734"
TEST_FIXTURE_NAME: "fixture-minimal.apk"

- label: ':android: Build Example App'
Expand Down Expand Up @@ -64,6 +64,7 @@ steps:
- docker-compose#v3.7.0:
run: android-ci
env:
SINGLE_RUNNER: "true"
INSTRUMENTATION_DEVICES: '["Google Pixel 3-9.0"]'
TEST_APK_LOCATION: 'bugsnag-android-core/build/outputs/apk/androidTest/debug/bugsnag-android-core-debug-androidTest.apk'
concurrency: 9
Expand Down
5 changes: 4 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ steps:
run: android-builder
env:
MAVEN_VERSION: "3.6.1"
TEST_FIXTURE_NDK_VERSION: "16.1.4479499"
TEST_FIXTURE_NDK_VERSION: "17.2.4988734"
TEST_FIXTURE_NAME: "fixture-r16.apk"

- label: ':android: Build fixture APK r19'
Expand Down Expand Up @@ -163,6 +163,7 @@ steps:
- docker-compose#v3.7.0:
run: android-ci
env:
SINGLE_RUNNER: "true"
INSTRUMENTATION_DEVICES: '["Google Pixel-7.1"]'
TEST_APK_LOCATION: 'bugsnag-android-core/build/outputs/apk/androidTest/debug/bugsnag-android-core-debug-androidTest.apk'
concurrency: 9
Expand All @@ -178,6 +179,7 @@ steps:
- docker-compose#v3.7.0:
run: android-ci
env:
SINGLE_RUNNER: "true"
INSTRUMENTATION_DEVICES: '["Google Pixel-7.1"]'
TEST_APK_LOCATION: 'bugsnag-plugin-android-ndk/build/outputs/apk/androidTest/debug/bugsnag-plugin-android-ndk-debug-androidTest.apk'
concurrency: 9
Expand All @@ -193,6 +195,7 @@ steps:
- docker-compose#v3.7.0:
run: android-ci
env:
SINGLE_RUNNER: "false"
INSTRUMENTATION_DEVICES: '["Google Pixel-7.1"]'
TEST_APK_LOCATION: 'bugsnag-benchmarks/build/outputs/apk/androidTest/release/bugsnag-benchmarks-release-androidTest.apk'
concurrency: 9
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## TBD

* Update project to build using Gradle/AGP 7
[#1354](https://github.com/bugsnag/bugsnag-android/pull/1354)

## 5.12.0 (2021-08-26)

* The `app.lowMemory` value always report the most recent `onTrimMemory`/`onLowMemory` status
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all: build
.PHONY: build test clean bump release

build:
./gradlew build -PABI_FILTERS=arm64-v8a,armeabi,armeabi-v7a,x86,x86_64
./gradlew build -PABI_FILTERS=arm64-v8a,armeabi-v7a,x86,x86_64

clean:
./gradlew clean
Expand Down
11 changes: 6 additions & 5 deletions bugsnag-android-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import kotlin.reflect.jvm.internal.impl.types.checker.KotlinTypeChecker

plugins {
id("bugsnag-build-plugin")
}
Expand All @@ -11,9 +9,12 @@ bugsnagBuildOptions {
apply plugin: "com.android.library"
apply plugin: "org.jetbrains.dokka"

dokka {
outputFormat = "html"
outputDirectory = "$buildDir/dokka"
dokkaHtml.configure {
dokkaSourceSets {
named("main") {
noAndroidSdkLink.set(false)
}
}
}

apply from: "../gradle/kotlin.gradle"
1 change: 1 addition & 0 deletions bugsnag-plugin-android-anr/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<CurrentIssues>
<ID>SwallowedException:AnrDetailsCollector.kt$AnrDetailsCollector$catch (exc: RuntimeException) { null }</ID>
<ID>SwallowedException:AnrPlugin.kt$AnrPlugin$catch (exc: Throwable) { null }</ID>
<ID>ThrowingExceptionsWithoutMessageOrCause:AnrPlugin.kt$AnrPlugin$RuntimeException()</ID>
<ID>UnusedPrivateMember:AnrPlugin.kt$AnrPlugin$ private fun notifyAnrDetected(nativeTrace: List&lt;NativeStackframe&gt;)</ID>
</CurrentIssues>
</SmellBaseline>
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ buildscript {
}
dependencies {
classpath "com.android.tools.build:gradle:${Versions.androidGradlePlugin}"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${Versions.bintrayPlugin}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${Versions.detektPlugin}"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${Versions.dokkaPlugin}"
Expand All @@ -17,7 +16,7 @@ buildscript {
}
}
plugins {
id "com.github.hierynomus.license" version "0.15.0"
id "com.github.hierynomus.license" version "0.16.1"
}

allprojects {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ repositories {

dependencies {
compileOnly(gradleApi())
implementation("com.android.tools.build:gradle:4.1.1")
implementation("com.android.tools.build:gradle:7.0.2")
}
28 changes: 13 additions & 15 deletions buildSrc/src/main/kotlin/com/bugsnag/android/BugsnagBuildPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,16 @@ class BugsnagBuildPlugin : Plugin<Project> {
*/
private fun BaseExtension.configureNdk(project: Project) {
defaultConfig {
externalNativeBuild.cmake {
arguments("-DANDROID_CPP_FEATURES=exceptions", "-DANDROID_STL=c++_static")

val override: String? = project.findProperty("ABI_FILTERS") as String?
val abis = override?.split(",") ?: mutableSetOf(
"arm64-v8a",
"armeabi-v7a",
"x86",
"x86_64"
)
ndk.setAbiFilters(abis)
}
externalNativeBuild.cmake.arguments += listOf("-DANDROID_CPP_FEATURES=exceptions", "-DANDROID_STL=c++_static")

val override: String? = project.findProperty("ABI_FILTERS") as String?
val abis = override?.split(",") ?: mutableSetOf(
"arm64-v8a",
"armeabi-v7a",
"x86",
"x86_64"
)
ndk.setAbiFilters(abis)
}
externalNativeBuild.cmake.path = project.file("CMakeLists.txt")
}
Expand Down Expand Up @@ -136,8 +134,8 @@ class BugsnagBuildPlugin : Plugin<Project> {
project.dependencies {
// needs to be kept as 'compile' for license checking to work
// as otherwise the downloadLicenses task misses these deps
add("compile", "androidx.annotation:annotation:${Versions.supportLib}")
add("compile", "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}")
add("api", "androidx.annotation:annotation:${Versions.supportLib}")
add("api", "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}")

add("testImplementation", "junit:junit:${Versions.junitTestLib}")
add("testImplementation", "org.mockito:mockito-core:${Versions.mockitoTestLib}")
Expand All @@ -162,7 +160,7 @@ class BugsnagBuildPlugin : Plugin<Project> {
private fun BaseExtension.configureDefaults() {
defaultConfig {
setCompileSdkVersion(Versions.compileSdkVersion)
minSdkVersion(Versions.minSdkVersion)
minSdk = Versions.minSdkVersion
ndkVersion = Versions.ndk
consumerProguardFiles("proguard-rules.pro")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
11 changes: 5 additions & 6 deletions buildSrc/src/main/kotlin/com/bugsnag/android/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ object Versions {
// Note minSdkVersion must be >=21 for 64 bit architectures
val minSdkVersion = 14
val compileSdkVersion = 30
val ndk = "16.1.4479499"
val ndk = "17.2.4988734"
val java = JavaVersion.VERSION_1_7
val kotlin = "1.3.72"

// plugins
val androidGradlePlugin = "4.1.1"
val bintrayPlugin = "1.8.5"
val detektPlugin = "1.17.1"
val ktlintPlugin = "9.4.1"
val dokkaPlugin = "0.10.1"
val androidGradlePlugin = "7.0.2"
val detektPlugin = "1.18.1"
val ktlintPlugin = "10.1.0"
val dokkaPlugin = "1.5.0"
val benchmarkPlugin = "1.0.0"

// dependencies
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
BROWSER_STACK_USERNAME:
BROWSER_STACK_ACCESS_KEY:
SAUCE_LABS_USERNAME:
SINGLE_RUNNER:
SAUCE_LABS_ACCESS_KEY:
INSTRUMENTATION_DEVICES:
TEST_APK_LOCATION:
Expand Down
5 changes: 3 additions & 2 deletions dockerfiles/Dockerfile.android-ci-base
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ WORKDIR /app
COPY gradlew gradle.properties /app/
COPY gradle/ /app/gradle/
ENV GRADLE_OPTS="-Dorg.gradle.daemon=false"
COPY settings.gradle /app/
RUN ./gradlew

# Copy remaining Gradle files
COPY build.gradle settings.gradle /app/
COPY build.gradle /app/
COPY buildSrc/ buildSrc/

# Build the example app - needed for Espresso tests
Expand All @@ -30,4 +31,4 @@ COPY config/ config/
COPY LICENSE LICENSE

# Build and upload to the local maven as version 9.9.9
RUN ./gradlew assembleRelease publishToMavenLocal -PVERSION_NAME=9.9.9 -PABI_FILTERS=arm64-v8a,armeabi,armeabi-v7a,x86,x86_64
RUN ./gradlew assembleRelease publishToMavenLocal -PVERSION_NAME=9.9.9 -PABI_FILTERS=arm64-v8a,armeabi-v7a,x86,x86_64
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.android-common
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN rm $CMDLINE_TOOLS_NAME
# Install Android tools using sdkmanager
RUN yes | sdkmanager "platform-tools" > /dev/null
RUN yes | sdkmanager "platforms;android-30" > /dev/null
RUN yes | sdkmanager "ndk;16.1.4479499" > /dev/null
RUN yes | sdkmanager "ndk;17.2.4988734" > /dev/null
RUN yes | sdkmanager "cmake;3.6.4111459" > /dev/null
RUN yes | sdkmanager "cmake;3.10.2.4988404" > /dev/null
RUN yes | sdkmanager "build-tools;30.0.3" > /dev/null
Expand Down
4 changes: 2 additions & 2 deletions examples/sdk-app-example/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: "kotlin-android"

android {
compileSdkVersion 30
ndkVersion "16.1.4479499"
ndkVersion "17.2.4988734"

defaultConfig {
applicationId "com.example.bugsnag.android"
Expand Down Expand Up @@ -38,7 +38,7 @@ android {
}

dependencies {
implementation "com.bugsnag:bugsnag-android:5.10.1"
implementation "com.bugsnag:bugsnag-android:5.12.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.appcompat:appcompat:1.3.1"
implementation "com.google.android.material:material:1.4.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/sdk-app-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ buildscript {
mavenLocal()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.2"
classpath "com.android.tools.build:gradle:7.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.bugsnag:bugsnag-android-gradle-plugin:5.7.7"
classpath "com.bugsnag:bugsnag-android-gradle-plugin:7.0.0"
}
}

Expand Down
Binary file modified examples/sdk-app-example/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Jul 16 09:48:14 BST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 242a936

Please sign in to comment.