Skip to content

Commit

Permalink
Bump AGP 4.1.1 and its dependencies (#1040)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto committed Nov 12, 2020
1 parent c4e1680 commit e0aad49
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 50 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# vNext

* Bump: AGP 4.1.1
* Fix: use neutral Locale for String operations #1033
* Update to sentry-native 0.4.4 and fix shared library builds (#1039)

# 3.1.3

* Fix broken NDK integration on 3.1.2 (release failed on packaging a .so file)
* Increase max cached events to 30 (#1029)
* Normalize DSN URI (#1030)
* fix: use neutral Locale for String operations #1033

# 3.1.2

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ all: clean compile update dryRelease

# deep clean
clean:
./gradlew clean cleanBuildCache
./gradlew clean

# build and run tests
compile:
Expand Down
21 changes: 12 additions & 9 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object Config {
val springKotlinCompatibleLanguageVersion = "1.3"

object BuildPlugins {
val androidGradle = "com.android.tools.build:gradle:4.0.2"
val androidGradle = "com.android.tools.build:gradle:4.1.1"
val kotlinGradlePlugin = "gradle-plugin"
val buildConfig = "com.github.gmazzo.buildconfig"
val buildConfigVersion = "2.0.2"
Expand All @@ -25,7 +25,10 @@ object Config {
val minSdkVersionNdk = 16
val targetSdkVersion = sdkVersion
val compileSdkVersion = sdkVersion
val cmakeVersion = "3.10.2"
// CMake: Projects that don't set a specific CMake version are built with CMake 3.10.2

// ndk is set to 21.3.x but I see on the logs the version 21.1.x, not sure if it's a bug
// on the Gradle plugin picking up the wrong version.
val ndkVersion = "21.3.6528147"
val abiFilters = listOf("x86", "armeabi-v7a", "x86_64", "arm64-v8a")
}
Expand All @@ -35,7 +38,7 @@ object Config {
val timber = "com.jakewharton.timber:timber:4.7.1"
// only bump gson if https://github.com/google/gson/issues/1597 is fixed
val gson = "com.google.code.gson:gson:2.8.5"
val leakCanary = "com.squareup.leakcanary:leakcanary-android:2.4"
val leakCanary = "com.squareup.leakcanary:leakcanary-android:2.5"

private val lifecycleVersion = "2.2.0"
val lifecycleProcess = "androidx.lifecycle:lifecycle-process:$lifecycleVersion"
Expand Down Expand Up @@ -71,7 +74,7 @@ object Config {
val androidxJunit = "androidx.test.ext:junit:1.1.2"
val robolectric = "org.robolectric:robolectric:4.4"
val mockitoKotlin = "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
val mockitoInline = "org.mockito:mockito-inline:3.5.13"
val mockitoInline = "org.mockito:mockito-inline:3.6.0"
val awaitility = "org.awaitility:awaitility-kotlin:4.0.3"
}

Expand All @@ -81,13 +84,13 @@ object Config {
val minimumCoverage = BigDecimal.valueOf(0.6)
}
val spotless = "com.diffplug.spotless"
val spotlessVersion = "5.3.0"
val spotlessVersion = "5.7.0"
val errorProne = "net.ltgt.errorprone"
val errorpronePlugin = "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1"
val gradleVersionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.31.0"
val errorpronePlugin = "net.ltgt.gradle:gradle-errorprone-plugin:1.3.0"
val gradleVersionsPlugin = "com.github.ben-manes:gradle-versions-plugin:0.34.0"
val gradleVersions = "com.github.ben-manes.versions"
val detekt = "io.gitlab.arturbosch.detekt"
val detektVersion = "1.12.0"
val detektVersion = "1.14.2"
val detektPlugin = "io.gitlab.arturbosch.detekt"
}

Expand Down Expand Up @@ -134,7 +137,7 @@ object Config {
}

object NativePlugins {
val nativeBundlePlugin = "com.ydq.android.gradle.build.tool:nativeBundle:1.0.6"
val nativeBundlePlugin = "com.ydq.android.gradle.build.tool:nativeBundle:1.0.7"
val nativeBundleExport = "com.ydq.android.gradle.native-aar.export"
}
}
7 changes: 2 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Daemon’s heap size
org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=512m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# Gradle will try to reuse outputs from previous builds for all builds
org.gradle.caching=true

# AndroidX required by AGP 3.6.x
# AndroidX required by AGP >= 3.6.x
android.useAndroidX=true

# Release information
Expand Down
16 changes: 9 additions & 7 deletions sentry-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ android {
versionCode = project.properties[Config.Sentry.buildVersionCodeProp].toString().toInt()

buildConfigField("String", "SENTRY_ANDROID_SDK_NAME", "\"${Config.Sentry.SENTRY_ANDROID_SDK_NAME}\"")

// for AGP 4.1
buildConfigField("String", "VERSION_NAME", "\"$versionName\"")
}

buildTypes {
Expand All @@ -44,13 +47,6 @@ android {
unitTests.apply {
isReturnDefaultValues = true
isIncludeAndroidResources = true
all(KotlinClosure1<Any, Test>({
(this as Test).also { testTask ->
testTask.extensions
.getByType(JacocoTaskExtension::class.java)
.isIncludeNoLocationClasses = true
}
}, this))
}
}

Expand All @@ -68,6 +64,12 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

dependencies {
api(project(":sentry"))

Expand Down
1 change: 1 addition & 0 deletions sentry-android-ndk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project(Sentry-Android LANGUAGES C CXX)
# Add sentry-android shared library
add_library(sentry-android SHARED src/main/jni/sentry.c)

# make sure that we build it as a shared lib instead of a static lib
set(BUILD_SHARED_LIBS ON)
set(SENTRY_BUILD_SHARED_LIBS ON)

Expand Down
24 changes: 13 additions & 11 deletions sentry-android-ndk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ android {
}

ndk {
setAbiFilters(Config.Android.abiFilters)
ndkVersion = Config.Android.ndkVersion
abiFilters.addAll(Config.Android.abiFilters)
}

// for AGP 4.1
buildConfigField("String", "VERSION_NAME", "\"$versionName\"")
}

ndkVersion = Config.Android.ndkVersion

externalNativeBuild {
cmake {
version = Config.Android.cmakeVersion
setPath("CMakeLists.txt")
path("CMakeLists.txt")
}
}

Expand All @@ -70,13 +73,6 @@ android {
unitTests.apply {
isReturnDefaultValues = true
isIncludeAndroidResources = true
all(KotlinClosure1<Any, Test>({
(this as Test).also { testTask ->
testTask.extensions
.getByType(JacocoTaskExtension::class.java)
.isIncludeNoLocationClasses = true
}
}, this))
}
}

Expand All @@ -98,6 +94,12 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

dependencies {
api(project(":sentry"))
api(project(":sentry-android-core"))
Expand Down
16 changes: 9 additions & 7 deletions sentry-android-timber/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ android {

versionName = project.version.toString()
versionCode = project.properties[Config.Sentry.buildVersionCodeProp].toString().toInt()

// for AGP 4.1
buildConfigField("String", "VERSION_NAME", "\"$versionName\"")
}

buildTypes {
Expand All @@ -44,13 +47,6 @@ android {
unitTests.apply {
isReturnDefaultValues = true
isIncludeAndroidResources = true
all(KotlinClosure1<Any, Test>({
(this as Test).also { testTask ->
testTask.extensions
.getByType(JacocoTaskExtension::class.java)
.isIncludeNoLocationClasses = true
}
}, this))
}
}

Expand All @@ -63,6 +59,12 @@ android {
}
}

tasks.withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = false
}
}

dependencies {
api(project(":sentry"))

Expand Down
1 change: 1 addition & 0 deletions sentry-samples/sentry-samples-android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ project(Sentry-Sample LANGUAGES C CXX)

add_library(native-sample SHARED src/main/cpp/native-sample.cpp)

# make sure that we build it as a shared lib instead of a static lib
set(BUILD_SHARED_LIBS ON)
set(SENTRY_BUILD_SHARED_LIBS ON)

Expand Down
16 changes: 8 additions & 8 deletions sentry-samples/sentry-samples-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ android {
}

ndk {
setAbiFilters(Config.Android.abiFilters)
ndkVersion = Config.Android.ndkVersion
abiFilters.addAll(Config.Android.abiFilters)
}
}

ndkVersion = Config.Android.ndkVersion

buildFeatures {
// Determines whether to support View Binding.
// Note that the viewBinding.enabled property is now deprecated.
Expand All @@ -48,8 +49,7 @@ android {

externalNativeBuild {
cmake {
version = Config.Android.cmakeVersion
setPath("CMakeLists.txt")
path("CMakeLists.txt")
}
}

Expand All @@ -64,21 +64,21 @@ android {

buildTypes {
getByName("debug") {
manifestPlaceholders = mapOf(
addManifestPlaceholders(mapOf(
"sentryDebug" to true,
"sentryEnvironment" to "debug"
)
))
}
getByName("release") {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("debug") // to be able to run release mode
isShrinkResources = true

manifestPlaceholders = mapOf(
addManifestPlaceholders(mapOf(
"sentryDebug" to false,
"sentryEnvironment" to "release"
)
))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:allowNativeHeapPointerTagging="false"
android:extractNativeLibs="true"
Expand Down

0 comments on commit e0aad49

Please sign in to comment.