Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ cache:
- "%USERPROFILE%\\.gradle\\wrapper"
- "%USERPROFILE%\\.m2\\repository"
build_script:
- cmd: gradlew.bat build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PmavenCentralUser=MAVEN_USER -PmavenCentralPassword=MAVEN_PASS
- cmd: gradlew.bat build bintrayUpload
# - cmd: gradlew.bat build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PmavenCentralUser=MAVEN_USER -PmavenCentralPassword=MAVEN_PASS
artifacts:
- path: '**\libs\*sentry*.jar'
- path: '**\outputs\aar\*sentry*release*.aar'
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ before_script:
- export ANDROID_NDK_HOME=$ANDROID_HOME/ndk-bundle
- chmod +x ./gradlew
script:
- ./gradlew build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PmavenCentralUser=MAVEN_USER -PmavenCentralPassword=MAVEN_PASS
- ./gradlew build bintrayUpload
#- ./gradlew build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PmavenCentralUser=MAVEN_USER -PmavenCentralPassword=MAVEN_PASS
android:
components:
- platform-tools
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ allprojects {
mavenCentral()
}
group = Config.Sentry.group
version = Config.Sentry.version
version = properties[Config.Sentry.versionNameProp].toString()
description = Config.Sentry.description
tasks {
withType<Test> {
Expand Down
27 changes: 22 additions & 5 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.util.Locale

object Config {
val kotlinVersion = "1.3.61"
val kotlinStdLib = "stdlib-jdk8"
Expand Down Expand Up @@ -49,11 +51,9 @@ object Config {
object Sentry {
val SENTRY_CLIENT_NAME = "sentry.java.android"
val group = "io.sentry"
// TODO: change version to publish new version
val version = "2.0.1"
val versionNameProp = "versionName"
val description = "SDK for sentry.io"
// TODO: change version code to publish new version, follow the pattern of `version`
val buildVersionCode = 20017
val buildVersionCodeProp = "buildVersionCode"
val website = "https://sentry.io"
val userOrg = "getsentry"
val repoName = "sentry-android"
Expand Down Expand Up @@ -82,7 +82,24 @@ object Config {
val novodaBintrayPlugin = "com.novoda:bintray-release:1.0.1"
val novodaBintray = "com.novoda.bintray-release"
val sign = true
val mavenCentralSync = true
// we need a token and it's generated via https://oss.sonatype.org/#profile;User%20Token
// let's keep this step manual for now.
val mavenCentralSync = false
// Craft will do it
val autoPublish = false

val bintrayUserProp = "BINTRAY_USERNAME"
val bintrayKeyProp = "BINTRAY_KEY"

/**
* do not auto publish if version ends with SNAPSHOT
*/
fun isSNAPSHOT(version: String): Boolean = version.toUpperCase(Locale.ROOT).endsWith("SNAPSHOT") // could be contains

/**
* returns an env. variable or the key if not set, it will fail with 401 Unauthorized
*/
fun getEnv(key: String): String = if (System.getenv(key).isNullOrEmpty()) key else System.getenv(key)
}

object NativePlugins {
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ org.gradle.caching=true

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

# Release information
buildVersionCode=20017
versionName=2.0.2-SNAPSHOT
6 changes: 5 additions & 1 deletion sentry-android-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

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

buildConfigField("String", "SENTRY_CLIENT_NAME", "\"${Config.Sentry.SENTRY_CLIENT_NAME}\"")
}
Expand Down Expand Up @@ -116,4 +116,8 @@ configure<PublishExtension> {
scmConnection = Config.Sentry.scmConnection
scmDevConnection = Config.Sentry.scmDevConnection
scmUrl = Config.Sentry.scmUrl
autoPublish = Config.Deploy.autoPublish
dryRun = Config.Deploy.isSNAPSHOT(project.version.toString())
bintrayUser = Config.Deploy.getEnv(Config.Deploy.bintrayUserProp)
bintrayKey = Config.Deploy.getEnv(Config.Deploy.bintrayKeyProp)
}
6 changes: 5 additions & 1 deletion sentry-android-ndk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

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

externalNativeBuild {
cmake {
Expand Down Expand Up @@ -144,4 +144,8 @@ configure<PublishExtension> {
scmConnection = Config.Sentry.scmConnection
scmDevConnection = Config.Sentry.scmDevConnection
scmUrl = Config.Sentry.scmUrl
autoPublish = Config.Deploy.autoPublish
dryRun = Config.Deploy.isSNAPSHOT(project.version.toString())
bintrayUser = Config.Deploy.getEnv(Config.Deploy.bintrayUserProp)
bintrayKey = Config.Deploy.getEnv(Config.Deploy.bintrayKeyProp)
}
6 changes: 5 additions & 1 deletion sentry-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
minSdkVersion(Config.Android.minSdkVersionNdk)

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

compileOptions {
Expand Down Expand Up @@ -59,4 +59,8 @@ configure<PublishExtension> {
scmConnection = Config.Sentry.scmConnection
scmDevConnection = Config.Sentry.scmDevConnection
scmUrl = Config.Sentry.scmUrl
autoPublish = Config.Deploy.autoPublish
dryRun = Config.Deploy.isSNAPSHOT(project.version.toString())
bintrayUser = Config.Deploy.getEnv(Config.Deploy.bintrayUserProp)
bintrayKey = Config.Deploy.getEnv(Config.Deploy.bintrayKeyProp)
}
5 changes: 4 additions & 1 deletion sentry-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,8 @@ configure<PublishExtension> {
scmConnection = Config.Sentry.scmConnection
scmDevConnection = Config.Sentry.scmDevConnection
scmUrl = Config.Sentry.scmUrl
autoPublish = Config.Deploy.autoPublish
dryRun = Config.Deploy.isSNAPSHOT(project.version.toString())
bintrayUser = Config.Deploy.getEnv(Config.Deploy.bintrayUserProp)
bintrayKey = Config.Deploy.getEnv(Config.Deploy.bintrayKeyProp)
}