Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.
3 changes: 2 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: '{build}'
image: Visual Studio 2017
environment:
ANDROID_HOME: "C:\\android-sdk-windows"
ANDROID_NDK_HOME: "C:\\android-sdk-windows\\ndk-bundle"
ANDROID_BUILD_VERSION: 29
ANDROID_TOOLS_VERSION: 29.0.2
GRADLE_OPTS: -Dorg.gradle.daemon=false
Expand All @@ -18,7 +19,7 @@ cache:
- "%USERPROFILE%\\.gradle\\wrapper"
- "%USERPROFILE%\\.m2\\repository"
build_script:
- cmd: gradlew.bat assemble check
- cmd: gradlew.bat build
artifacts:
- path: '**\libs\*sentry*.jar'
- path: '**\outputs\aar\*sentry*.aar'
Expand Down
47 changes: 26 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ licenses:
before_install:
- touch $HOME/.android/repositories.cfg
- yes | sdkmanager --update
install:
- echo y | sdkmanager "ndk-bundle" >/dev/null
- echo y | sdkmanager "cmake;3.6.4111459" >/dev/null
before_script:
- export ANDROID_NDK_HOME=$ANDROID_HOME/ndk-bundle
android:
components:
- platform-tools
Expand All @@ -25,29 +30,29 @@ language: android
env:
matrix:
- API=android-14 ABI=armeabi-v7a
# Keeping only lowest/higher API level per ABI temporarily
# - API=android-15 ABI=armeabi-v7a
# - API=android-16 ABI=armeabi-v7a
# - API=android-17 ABI=armeabi-v7a
# - API=android-18 ABI=armeabi-v7a
# - API=android-19 ABI=armeabi-v7a
# - API=android-21 ABI=armeabi-v7aq
# - API=android-22 ABI=armeabi-v7a
# - API=android-23 ABI=armeabi-v7a
# - API=android-24 ABI=armeabi-v7a
# - API=android-25 ABI=armeabi-v7a
# - API=android-26 ABI=armeabi-v7a
# - API=android-27 ABI=armeabi-v7a
# - API=android-28 ABI=armeabi-v7a
# Keeping only lowest/higher API level per ABI temporarily
# - API=android-15 ABI=armeabi-v7a
# - API=android-16 ABI=armeabi-v7a
# - API=android-17 ABI=armeabi-v7a
# - API=android-18 ABI=armeabi-v7a
# - API=android-19 ABI=armeabi-v7a
# - API=android-21 ABI=armeabi-v7aq
# - API=android-22 ABI=armeabi-v7a
# - API=android-23 ABI=armeabi-v7a
# - API=android-24 ABI=armeabi-v7a
# - API=android-25 ABI=armeabi-v7a
# - API=android-26 ABI=armeabi-v7a
# - API=android-27 ABI=armeabi-v7a
# - API=android-28 ABI=armeabi-v7a
- API=android-29 ABI=armeabi-v7a
- API=android-21 ABI=arm64-v8a
# - API=android-22 ABI=arm64-v8a
# - API=android-23 ABI=arm64-v8a
# - API=android-24 ABI=arm64-v8a
# - API=android-25 ABI=arm64-v8a
# - API=android-26 ABI=arm64-v8a
# - API=android-27 ABI=arm64-v8a
# - API=android-28 ABI=arm64-v8a
# - API=android-22 ABI=arm64-v8a
# - API=android-23 ABI=arm64-v8a
# - API=android-24 ABI=arm64-v8a
# - API=android-25 ABI=arm64-v8a
# - API=android-26 ABI=arm64-v8a
# - API=android-27 ABI=arm64-v8a
# - API=android-28 ABI=arm64-v8a
- API=android-29 ABI=arm64-v8a
matrix:
include:
Expand Down
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ configure<JavaPluginConvention> {

buildscript {
repositories {
mavenLocal()
google()
jcenter()
mavenCentral()
}
dependencies {
classpath(Config.BuildPlugins.androidGradle)
Expand All @@ -28,6 +30,7 @@ buildscript {

allprojects {
repositories {
mavenLocal()
google()
jcenter()
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ object Config {
val kotlinStdLib = "stdlib-jdk8"

object BuildPlugins {
val androidGradle = "com.android.tools.build:gradle:3.5.2"
val androidGradle = "com.android.tools.build:gradle:3.6.0-beta03"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ninniuz what do you think about that?
I'd like to use maven-publish with the native support that AGP 3.6.x provides.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a great addition to AGP and it makes publishing a lot easier, but I wouldn't use beta releases as they could affect aar generation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ninniuz based on the changelog, the "only" different thing that affects aar generation would be useNewApkCreator which I've disabled, that's why I think it's safe to go, but I do understand your concern.

val kotlinGradlePlugin = "gradle-plugin"
}

Expand Down
9 changes: 8 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Daemon’s heap size
org.gradle.jvmargs=-Xms1g -Xmx1g -XX:MaxPermSize=512m -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xms1g -Dkotlin.daemon.jvm.options\="-Xmx1536M" -Xmx1536M -XX\:MaxPermSize\=512m -Dfile.encoding\=UTF-8

# Parallel execution
org.gradle.parallel=true

# Cacheable unit tests
android.testConfig.useRelativePath = true

# Migrating to AndroidX - AGP 3.6.x
android.useAndroidX=true
#android.enableJetifier=true - causing SHA1 digest error
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# New default packaging tool, disabled as its still preview
android.useNewApkCreator=false
11 changes: 11 additions & 0 deletions sentry-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("com.android.library")
kotlin("android")
jacoco
`maven-publish`
id("net.ltgt.errorprone")
}

Expand Down Expand Up @@ -89,3 +90,13 @@ dependencies {
testImplementation(Config.TestLibs.androidxJunit)
testImplementation(Config.TestLibs.mockitoKotlin)
}

afterEvaluate {
publishing {
publications {
register("release", MavenPublication::class) {
from(components["release"])
}
}
}
}
13 changes: 13 additions & 0 deletions sentry-android-ndk/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

plugins {
id("com.android.library")
`maven-publish`
kotlin("android")
jacoco
}
Expand Down Expand Up @@ -97,6 +98,8 @@ android {
// We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks.
isCheckReleaseBuilds = false
}

ndkVersion = "20.1.5948944"
}

dependencies {
Expand All @@ -114,3 +117,13 @@ val initNative = tasks.register<Exec>("initNative") {
tasks.named("preBuild") {
dependsOn(initNative)
}

afterEvaluate {
publishing {
publications {
register("release", MavenPublication::class) {
from(components["release"])
}
}
}
}
12 changes: 12 additions & 0 deletions sentry-android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("com.android.library")
`maven-publish`
}

android {
Expand All @@ -11,6 +12,7 @@ android {
minSdkVersion(Config.Android.minSdkVersionNdk)

versionName = "$version"

}

compileOptions {
Expand All @@ -30,3 +32,13 @@ dependencies {
api(project(":sentry-android-core"))
api(project(":sentry-android-ndk"))
}

afterEvaluate {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you factor out the repeated publishing logic into the main build.gradle file?

publishing {
publications {
register("release", MavenPublication::class) {
from(components["release"])
}
}
}
}
15 changes: 15 additions & 0 deletions sentry-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
`java-library`
kotlin("jvm")
jacoco
`maven-publish`
id("net.ltgt.errorprone")
}

Expand Down Expand Up @@ -50,3 +51,17 @@ tasks {
dependsOn(jacocoTestReport)
}
}

val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}

publishing {
publications {
register("release", MavenPublication::class) {
from(components["java"])
artifact(sourcesJar.get())
}
}
}
4 changes: 4 additions & 0 deletions sentry-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ android {
abiFilters(platform)
}
}

// Required when setting minSdkVersion to 20 or lower
multiDexEnabled = true
}

externalNativeBuild {
Expand Down Expand Up @@ -86,6 +89,7 @@ dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))

implementation(project(":sentry-android"))
// implementation("io.sentry:sentry-android:2.0.0-SNAPSHOT")

implementation(Config.Libs.appCompat)

Expand Down