Skip to content

Commit

Permalink
Merge pull request #3994 from vector-im/feature/bma/sdk_version
Browse files Browse the repository at this point in the history
Feature/bma/sdk version
  • Loading branch information
bmarty authored Sep 10, 2021
2 parents 9914fb2 + 3fcfe70 commit 397f576
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ body:
- [ ] Push `main` and the new tag `v1.1.10` to origin
- [ ] Checkout `develop`
- [ ] Increase version in `./vector/build.gradle`
- [ ] Change the value of SDK_VERSION in the file `./matrix-sdk-android/build.gradle`
- [ ] Commit and push `develop`
- [ ] Wait for [Buildkite](https://buildkite.com/matrix-dot-org/element-android/builds?branch=main) to build the `main` branch.
- [ ] Run the script `~/scripts/releaseElement.sh`. It will download the APKs from Buildkite check them and sign them.
Expand Down
8 changes: 3 additions & 5 deletions attachment-viewer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 30
compileSdk 30

defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
minSdk 21
targetSdk 30
}

buildTypes {
Expand Down
1 change: 1 addition & 0 deletions changelog.d/3994.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Better support for Sdk2 version. Also slight change in the default user agent: `MatrixAndroidSDK_X` is replaced by `MatrixAndroidSdk2`
9 changes: 3 additions & 6 deletions library/ui-styles/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ plugins {
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdk 30

defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
minSdk 21
targetSdk 30

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions matrix-sdk-android-rx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 30
compileSdk 30

defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
minSdk 21
targetSdk 30

// Multidex is useful for tests
multiDexEnabled true
Expand Down
13 changes: 5 additions & 8 deletions matrix-sdk-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ buildscript {
}

android {
compileSdkVersion 30
compileSdk 30
testOptions.unitTests.includeAndroidResources = true

defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "0.0.1"
minSdk 21
targetSdk 30

// Multidex is useful for tests
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -31,9 +30,7 @@ android {
// that the app's state is completely cleared between tests.
testInstrumentationRunnerArguments clearPackageData: 'true'

// Seems that the build tools 4.1.0 does not generate BuildConfig.VERSION_NAME anymore.
// Add it manually here. We may remove this trick in the future
buildConfigField "String", "VERSION_NAME", "\"0.0.1\""
buildConfigField "String", "SDK_VERSION", "\"1.2.2\""

buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\""
resValue "string", "git_sdk_revision", "\"${gitRevision()}\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Matrix private constructor(context: Context, matrixConfiguration: MatrixCo
}

fun getSdkVersion(): String {
return BuildConfig.VERSION_NAME + " (" + BuildConfig.GIT_SDK_REVISION + ")"
return BuildConfig.SDK_VERSION + " (" + BuildConfig.GIT_SDK_REVISION + ")"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Matrix private constructor(context: Context, matrixConfiguration: MatrixCo
}

fun getSdkVersion(): String {
return BuildConfig.VERSION_NAME + " (" + BuildConfig.GIT_SDK_REVISION + ")"
return BuildConfig.SDK_VERSION + " (" + BuildConfig.GIT_SDK_REVISION + ")"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal class UserAgentHolder @Inject constructor(private val context: Context,

/**
* Create an user agent with the application version.
* Ex: Element/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSDK_X 1.0)
* Ex: Element/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSdk2 1.0)
*
* @param flavorDescription the flavor description
*/
Expand Down Expand Up @@ -74,13 +74,13 @@ internal class UserAgentHolder @Inject constructor(private val context: Context,
// if there is no user agent or cannot parse it
if (null == systemUserAgent || systemUserAgent.lastIndexOf(")") == -1 || !systemUserAgent.contains("(")) {
userAgent = (appName + "/" + appVersion + " ( Flavour " + flavorDescription
+ "; MatrixAndroidSDK_X " + BuildConfig.VERSION_NAME + ")")
+ "; MatrixAndroidSdk2 " + BuildConfig.SDK_VERSION + ")")
} else {
// update
userAgent = appName + "/" + appVersion + " " +
systemUserAgent.substring(systemUserAgent.indexOf("("), systemUserAgent.lastIndexOf(")") - 1) +
"; Flavour " + flavorDescription +
"; MatrixAndroidSDK_X " + BuildConfig.VERSION_NAME + ")"
"; MatrixAndroidSdk2 " + BuildConfig.SDK_VERSION + ")"
}
}
}
8 changes: 3 additions & 5 deletions multipicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'

android {
compileSdkVersion 30
compileSdk 30

defaultConfig {
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
minSdk 19
targetSdk 30

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
Expand Down
6 changes: 3 additions & 3 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ ext.abiVersionCodes = ["armeabi-v7a": 1, "arm64-v8a": 2, "x86": 3, "x86_64": 4].
def buildNumber = System.env.BUILDKITE_BUILD_NUMBER as Integer ?: 0

android {
compileSdkVersion 30
compileSdk 30

// Due to a bug introduced in Android gradle plugin 3.6.0, we have to specify the ndk version to use
// Ref: https://issuetracker.google.com/issues/144111441
Expand All @@ -111,8 +111,8 @@ android {
defaultConfig {
applicationId "im.vector.app"
// Set to API 21: see #405
minSdkVersion 21
targetSdkVersion 30
minSdk 21
targetSdk 30
multiDexEnabled true

renderscriptTargetApi 24
Expand Down

0 comments on commit 397f576

Please sign in to comment.