Skip to content

Commit e5aef3a

Browse files
committed
build: update repo to use Gradle 7
1 parent 304fea0 commit e5aef3a

27 files changed

+691
-466
lines changed

.buildkite/pipeline.full.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ steps:
1010
env:
1111
MAVEN_VERSION: "3.6.1"
1212
MINIMAL_FIXTURE: true
13-
TEST_FIXTURE_NDK_VERSION: "16.1.4479499"
13+
TEST_FIXTURE_NDK_VERSION: "17.2.4988734"
1414
TEST_FIXTURE_NAME: "fixture-minimal.apk"
1515

1616
- label: ':android: Build Example App'

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ steps:
6060
run: android-builder
6161
env:
6262
MAVEN_VERSION: "3.6.1"
63-
TEST_FIXTURE_NDK_VERSION: "16.1.4479499"
63+
TEST_FIXTURE_NDK_VERSION: "17.2.4988734"
6464
TEST_FIXTURE_NAME: "fixture-r16.apk"
6565

6666
- label: ':android: Build fixture APK r19'

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## TBD
4+
5+
* Update project to build using Gradle/AGP 7
6+
[#1354](https://github.com/bugsnag/bugsnag-android/pull/1354)
7+
38
## 5.12.0 (2021-08-26)
49

510
* The `app.lowMemory` value always report the most recent `onTrimMemory`/`onLowMemory` status

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ all: build
33
.PHONY: build test clean bump release
44

55
build:
6-
./gradlew build -PABI_FILTERS=arm64-v8a,armeabi,armeabi-v7a,x86,x86_64
6+
./gradlew build -PABI_FILTERS=arm64-v8a,armeabi-v7a,x86,x86_64
77

88
clean:
99
./gradlew clean

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ buildscript {
1616
}
1717
}
1818
plugins {
19-
id "com.github.hierynomus.license" version "0.15.0"
19+
id "com.github.hierynomus.license" version "0.16.1"
2020
}
2121

2222
allprojects {

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ repositories {
1919

2020
dependencies {
2121
compileOnly(gradleApi())
22-
implementation("com.android.tools.build:gradle:4.1.1")
22+
implementation("com.android.tools.build:gradle:7.0.2")
2323
}

buildSrc/src/main/kotlin/com/bugsnag/android/BugsnagBuildPlugin.kt

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,16 @@ class BugsnagBuildPlugin : Plugin<Project> {
6868
*/
6969
private fun BaseExtension.configureNdk(project: Project) {
7070
defaultConfig {
71-
externalNativeBuild.cmake {
72-
arguments("-DANDROID_CPP_FEATURES=exceptions", "-DANDROID_STL=c++_static")
73-
74-
val override: String? = project.findProperty("ABI_FILTERS") as String?
75-
val abis = override?.split(",") ?: mutableSetOf(
76-
"arm64-v8a",
77-
"armeabi-v7a",
78-
"x86",
79-
"x86_64"
80-
)
81-
ndk.setAbiFilters(abis)
82-
}
71+
externalNativeBuild.cmake.arguments += listOf("-DANDROID_CPP_FEATURES=exceptions", "-DANDROID_STL=c++_static")
72+
73+
val override: String? = project.findProperty("ABI_FILTERS") as String?
74+
val abis = override?.split(",") ?: mutableSetOf(
75+
"arm64-v8a",
76+
"armeabi-v7a",
77+
"x86",
78+
"x86_64"
79+
)
80+
ndk.setAbiFilters(abis)
8381
}
8482
externalNativeBuild.cmake.path = project.file("CMakeLists.txt")
8583
}
@@ -136,8 +134,8 @@ class BugsnagBuildPlugin : Plugin<Project> {
136134
project.dependencies {
137135
// needs to be kept as 'compile' for license checking to work
138136
// as otherwise the downloadLicenses task misses these deps
139-
add("compile", "androidx.annotation:annotation:${Versions.supportLib}")
140-
add("compile", "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}")
137+
add("api", "androidx.annotation:annotation:${Versions.supportLib}")
138+
add("api", "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}")
141139

142140
add("testImplementation", "junit:junit:${Versions.junitTestLib}")
143141
add("testImplementation", "org.mockito:mockito-core:${Versions.mockitoTestLib}")
@@ -162,7 +160,7 @@ class BugsnagBuildPlugin : Plugin<Project> {
162160
private fun BaseExtension.configureDefaults() {
163161
defaultConfig {
164162
setCompileSdkVersion(Versions.compileSdkVersion)
165-
minSdkVersion(Versions.minSdkVersion)
163+
minSdk = Versions.minSdkVersion
166164
ndkVersion = Versions.ndk
167165
consumerProguardFiles("proguard-rules.pro")
168166
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

buildSrc/src/main/kotlin/com/bugsnag/android/Versions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ object Versions {
99
// Note minSdkVersion must be >=21 for 64 bit architectures
1010
val minSdkVersion = 14
1111
val compileSdkVersion = 30
12-
val ndk = "16.1.4479499"
12+
val ndk = "17.2.4988734"
1313
val java = JavaVersion.VERSION_1_7
1414
val kotlin = "1.3.72"
1515

1616
// plugins
17-
val androidGradlePlugin = "4.2.2"
17+
val androidGradlePlugin = "7.0.2"
1818
val detektPlugin = "1.18.1"
1919
val ktlintPlugin = "10.1.0"
2020
val dokkaPlugin = "1.5.0"

dockerfiles/Dockerfile.android-ci-base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ COPY config/ config/
3131
COPY LICENSE LICENSE
3232

3333
# Build and upload to the local maven as version 9.9.9
34-
RUN ./gradlew assembleRelease publishToMavenLocal -PVERSION_NAME=9.9.9 -PABI_FILTERS=arm64-v8a,armeabi,armeabi-v7a,x86,x86_64
34+
RUN ./gradlew assembleRelease publishToMavenLocal -PVERSION_NAME=9.9.9 -PABI_FILTERS=arm64-v8a,armeabi-v7a,x86,x86_64

dockerfiles/Dockerfile.android-common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RUN rm $CMDLINE_TOOLS_NAME
2828
# Install Android tools using sdkmanager
2929
RUN yes | sdkmanager "platform-tools" > /dev/null
3030
RUN yes | sdkmanager "platforms;android-30" > /dev/null
31-
RUN yes | sdkmanager "ndk;16.1.4479499" > /dev/null
31+
RUN yes | sdkmanager "ndk;17.2.4988734" > /dev/null
3232
RUN yes | sdkmanager "cmake;3.6.4111459" > /dev/null
3333
RUN yes | sdkmanager "cmake;3.10.2.4988404" > /dev/null
3434
RUN yes | sdkmanager "build-tools;30.0.3" > /dev/null

0 commit comments

Comments
 (0)