From a2a97f130ef3591a05c6e21c3e92dfef2d84a2bf Mon Sep 17 00:00:00 2001 From: tonis Date: Tue, 3 Jan 2023 10:08:57 +0700 Subject: [PATCH] Update to Android 12 --- CHANGELOG.md | 5 ++++ README.md | 2 +- build.gradle | 6 ++--- gradle/DEPLOYING.md | 5 ++++ gradle/wrapper/gradle-wrapper.properties | 2 +- hm-android-basic-oauth | 2 +- hm-android-bluetooth-auto-api-explorer | 2 +- hmkit-android/build.gradle | 31 ++++++++++++---------- hmkit-android/src/main/AndroidManifest.xml | 3 +-- hmkit-core-jni | 2 +- hmkit-crypto | 2 +- hmkit-utils | 2 +- 12 files changed, 38 insertions(+), 26 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 gradle/DEPLOYING.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..aa7aa26a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## [2.0.7] +- Fix Android 12 `exported` build error. +- Move the build to latest Kotlin, Gradle and Java versions. diff --git a/README.md b/README.md index 97d05072..4a7f343f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # HMKit Android The HMKit Android SDK makes it easy to work with car data using the HIGH MOBILITY API platform. The SDK implements a strong security layer between your Android app and the platform while providing a straightforward native interface to read from, and write to, connected cars. -In addition, the SDK provides a UI component used to initate OAuth2 for the end-user in order to retrieve consent for the sharing of data. +In addition, the SDK provides a UI component used to initiate OAuth2 for the end-user in order to retrieve consent for the sharing of data. # Table of contents diff --git a/build.gradle b/build.gradle index 6cf54f7f..e43a43af 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlinVersion = '1.4.10' + ext.kotlinVersion = '1.7.20' repositories { google() @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.6.0' + classpath 'com.android.tools.build:gradle:7.3.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" } } @@ -28,7 +28,7 @@ ext.ver = [ "hmkit-core-jni" : "1.0.2", "hmkit-crypto" : "1.4.6", "hmkit-utils" : "1.4.5", - "hmkit-android" : "2.0.6", + "hmkit-android" : "2.0.7", "hmkit-auto-api" : "13.1.1", "command-queue" : "1.1.1", compileSdk : 28 diff --git a/gradle/DEPLOYING.md b/gradle/DEPLOYING.md new file mode 100644 index 00000000..a23cf9e7 --- /dev/null +++ b/gradle/DEPLOYING.md @@ -0,0 +1,5 @@ +steps in https://raw.githubusercontent.com/tonisives/tools/master/gradle/deploy-java-mavenCentral.gradle (versions in all files) + + +./gradlew clean :hmkit-android:build +g :hmkit-android:publishReleasePublicationToMavenCentralRepository \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 12d38de6..070cb702 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/hm-android-basic-oauth b/hm-android-basic-oauth index 5ec18903..963e5be7 160000 --- a/hm-android-basic-oauth +++ b/hm-android-basic-oauth @@ -1 +1 @@ -Subproject commit 5ec18903b4d4b41cee1a0ff6a27622b4a42325db +Subproject commit 963e5be7a889bc26069b48f0ecdbaec795e5f7c8 diff --git a/hm-android-bluetooth-auto-api-explorer b/hm-android-bluetooth-auto-api-explorer index 2ef7a540..0db99668 160000 --- a/hm-android-bluetooth-auto-api-explorer +++ b/hm-android-bluetooth-auto-api-explorer @@ -1 +1 @@ -Subproject commit 2ef7a540ccb8fa8c3f0b93f2810b5d9811cb8a62 +Subproject commit 0db996687cdfa5229b2f861689e2fbd64ec8de8e diff --git a/hmkit-android/build.gradle b/hmkit-android/build.gradle index d31b4ba6..091c4f8b 100644 --- a/hmkit-android/build.gradle +++ b/hmkit-android/build.gradle @@ -12,12 +12,11 @@ version ver."${deploy.id}" android { compileSdkVersion ver.compileSdk + namespace 'com.highmobility.hmkit' defaultConfig { minSdkVersion 21 targetSdkVersion ver.compileSdk - versionCode 1 - versionName "${version}" multiDexEnabled true ndk { @@ -30,14 +29,15 @@ android { buildTypes { release { + buildConfigField("String", "VERSION_NAME", "\"${version}\"") minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } + debug { + buildConfigField("String", "VERSION_NAME", "\"${version}\"") + } } - lintOptions { - abortOnError false - } testOptions { unitTests { @@ -55,10 +55,13 @@ android { } sourceSets.main { - jni.srcDirs = [] // This prevents the auto generation of Android.mk + // This prevents the auto generation of Android.mk jniLibs.srcDir 'src/main/libs' // This is not necessary unless you have precompiled libraries in your project. } + lint { + abortOnError false + } } dependencies { @@ -79,13 +82,13 @@ dependencies { implementation 'androidx.legacy:legacy-support-v4:1.0.0' // its not easy to use ndk with junit(should build separate binary) - testImplementation 'junit:junit:4.12' - testImplementation 'org.robolectric:robolectric:4.4' - testImplementation 'androidx.test:core:1.1.0' + testImplementation 'junit:junit:4.13.2' + testImplementation 'org.robolectric:robolectric:4.9.2' + testImplementation 'androidx.test:core:1.5.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.0' - androidTestImplementation 'androidx.test:runner:1.1.0-alpha4' - androidTestImplementation 'androidx.test:rules:1.1.0-alpha4' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4' - androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.4' + androidTestImplementation 'androidx.test:runner:1.5.1' + androidTestImplementation 'androidx.test:rules:1.5.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' + androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.0' } \ No newline at end of file diff --git a/hmkit-android/src/main/AndroidManifest.xml b/hmkit-android/src/main/AndroidManifest.xml index de7c284f..713964ef 100644 --- a/hmkit-android/src/main/AndroidManifest.xml +++ b/hmkit-android/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/hmkit-core-jni b/hmkit-core-jni index d1ea51b7..21bec38a 160000 --- a/hmkit-core-jni +++ b/hmkit-core-jni @@ -1 +1 @@ -Subproject commit d1ea51b7c15aeb6d8775b3c26ddcc9695846ae30 +Subproject commit 21bec38a1d089d1ebff5110a4ca5f1eba46213c2 diff --git a/hmkit-crypto b/hmkit-crypto index 9994e685..68d0f856 160000 --- a/hmkit-crypto +++ b/hmkit-crypto @@ -1 +1 @@ -Subproject commit 9994e685f973dc982dcbcd97e4ab056222440a6a +Subproject commit 68d0f856211425a8291d2aca8c30bd6980f6e954 diff --git a/hmkit-utils b/hmkit-utils index 85df905a..42c1c63c 160000 --- a/hmkit-utils +++ b/hmkit-utils @@ -1 +1 @@ -Subproject commit 85df905a84ff748bca498a6b0377a3b11394a6df +Subproject commit 42c1c63c67cc656e70bd7aabb0e518945171efb8