From f678a332523d0eb5633c9d325af7e32a537954b4 Mon Sep 17 00:00:00 2001 From: Alexey Voronov Date: Mon, 20 Feb 2023 07:16:06 +0000 Subject: [PATCH] [APP] Update android_rpc build tools version --- apps/android_camera/README.md | 23 ++++++++------- apps/android_camera/app/build.gradle | 29 ++++++++++--------- .../app/src/main/AndroidManifest.xml | 3 +- .../Camera2BasicFragment.java | 2 +- apps/android_camera/build.gradle | 4 ++- apps/android_deploy/README.md | 14 ++++----- apps/android_deploy/app/build.gradle | 25 ++++++++-------- .../android_deploy/app/download-models.gradle | 18 ++++++++++++ .../app/src/main/AndroidManifest.xml | 3 +- apps/android_deploy/build.gradle | 4 ++- apps/android_rpc/README.md | 10 +++---- apps/android_rpc/app/build.gradle | 24 ++++++++------- .../app/src/main/AndroidManifest.xml | 3 +- apps/android_rpc/build.gradle | 4 ++- 14 files changed, 97 insertions(+), 69 deletions(-) diff --git a/apps/android_camera/README.md b/apps/android_camera/README.md index f659e905f2816..25257d10c1cde 100644 --- a/apps/android_camera/README.md +++ b/apps/android_camera/README.md @@ -63,18 +63,21 @@ dependencies { androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'androidx.appcompat:appcompat:1.4.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' - implementation 'com.google.android.material:material:1.5.0' - implementation 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'com.google.android.material:material:1.8.0' + implementation files('../../../jvm/core/target/tvm4j-core-0.0.1-SNAPSHOT.jar') testImplementation 'junit:junit:4.13.2' - implementation "androidx.concurrent:concurrent-futures:1.0.0" - implementation "androidx.camera:camera-core:1.0.0-beta01" - implementation "androidx.camera:camera-camera2:1.0.0-beta01" - implementation "androidx.camera:camera-view:1.0.0-alpha08" - implementation "androidx.camera:camera-extensions:1.0.0-alpha08" - implementation "androidx.camera:camera-lifecycle:1.0.0-beta01" + implementation "androidx.concurrent:concurrent-futures:1.1.0" + implementation "androidx.camera:camera-core:1.3.0-alpha03" + implementation "androidx.camera:camera-camera2:1.3.0-alpha03" + // If you want to use the CameraX View class + implementation "androidx.camera:camera-view:1.3.0-alpha03" + // If you want to use the CameraX Extensions library + implementation "androidx.camera:camera-extensions:1.3.0-alpha03" + // If you want to use the CameraX Lifecycle library + implementation "androidx.camera:camera-lifecycle:1.3.0-alpha03" } ``` diff --git a/apps/android_camera/app/build.gradle b/apps/android_camera/app/build.gradle index c7767559e4dfd..dd763f6887717 100644 --- a/apps/android_camera/app/build.gradle +++ b/apps/android_camera/app/build.gradle @@ -53,11 +53,11 @@ tasks.withType(JavaCompile) { } android { - compileSdkVersion 31 + compileSdkVersion 33 defaultConfig { applicationId "ml.apache.tvm.android.androidcamerademo" minSdkVersion 24 - targetSdkVersion 26 + targetSdkVersion 33 renderscriptTargetApi 18 renderscriptSupportModeEnabled true versionCode 1 @@ -80,10 +80,11 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - - lintOptions { - disable "Instantiatable" // MainActivity and RPCActivity must extend android.app.Activity + lint { + disable 'Instantiatable' // MainActivity and RPCActivity must extend android.app.Activity } + namespace 'org.apache.tvm.android.androidcamerademo' + } dependencies { @@ -91,19 +92,19 @@ dependencies { androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'androidx.appcompat:appcompat:1.4.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' - implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'com.google.android.material:material:1.8.0' implementation files('../../../jvm/core/target/tvm4j-core-0.0.1-SNAPSHOT.jar') testImplementation 'junit:junit:4.13.2' - implementation "androidx.concurrent:concurrent-futures:1.0.0" - implementation "androidx.camera:camera-core:1.0.0-beta01" - implementation "androidx.camera:camera-camera2:1.0.0-beta01" + implementation "androidx.concurrent:concurrent-futures:1.1.0" + implementation "androidx.camera:camera-core:1.3.0-alpha03" + implementation "androidx.camera:camera-camera2:1.3.0-alpha03" // If you want to use the CameraX View class - implementation "androidx.camera:camera-view:1.0.0-alpha08" + implementation "androidx.camera:camera-view:1.3.0-alpha03" // If you want to use the CameraX Extensions library - implementation "androidx.camera:camera-extensions:1.0.0-alpha08" + implementation "androidx.camera:camera-extensions:1.3.0-alpha03" // If you want to use the CameraX Lifecycle library - implementation "androidx.camera:camera-lifecycle:1.0.0-beta01" + implementation "androidx.camera:camera-lifecycle:1.3.0-alpha03" } diff --git a/apps/android_camera/app/src/main/AndroidManifest.xml b/apps/android_camera/app/src/main/AndroidManifest.xml index e5b6465c5874a..6d1bdf2f5ffbf 100644 --- a/apps/android_camera/app/src/main/AndroidManifest.xml +++ b/apps/android_camera/app/src/main/AndroidManifest.xml @@ -14,8 +14,7 @@ --> + xmlns:tools="http://schemas.android.com/tools"> diff --git a/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/Camera2BasicFragment.java b/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/Camera2BasicFragment.java index 3a55a62d739c3..059ae1747add1 100644 --- a/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/Camera2BasicFragment.java +++ b/apps/android_camera/app/src/main/java/org/apache/tvm/android/androidcamerademo/Camera2BasicFragment.java @@ -491,7 +491,7 @@ private void bindPreview(@NonNull ProcessCameraProvider cameraProvider) { .setTargetName("Preview") .build(); - preview.setSurfaceProvider(previewView.getPreviewSurfaceProvider()); + preview.setSurfaceProvider(previewView.getSurfaceProvider()); CameraSelector cameraSelector = new CameraSelector.Builder() .requireLensFacing(CameraSelector.LENS_FACING_BACK) diff --git a/apps/android_camera/build.gradle b/apps/android_camera/build.gradle index 1cd5ac9b656f1..7f98372768fae 100644 --- a/apps/android_camera/build.gradle +++ b/apps/android_camera/build.gradle @@ -23,9 +23,10 @@ buildscript { maven { url 'https://maven.google.com' } + google() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.4.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -40,6 +41,7 @@ allprojects { } mavenLocal() mavenCentral() + google() } } diff --git a/apps/android_deploy/README.md b/apps/android_deploy/README.md index 4cfd9eb9daf2b..6317d96ae7396 100644 --- a/apps/android_deploy/README.md +++ b/apps/android_deploy/README.md @@ -38,15 +38,15 @@ Before you build the Android application, please refer to [TVM4J Installation Gu ``` dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + implementation fileTree(dir: 'libs', include: ['*.jar']) + androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - compile 'com.android.support:appcompat-v7:26.0.1' - compile 'com.android.support.constraint:constraint-layout:1.0.2' - compile 'com.android.support:design:26.0.1' - compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT' - testCompile 'junit:junit:4.12' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'com.google.android.material:material:1.8.0' + implementation files('../../../jvm/core/target/tvm4j-core-0.0.1-SNAPSHOT.jar') + testImplementation 'junit:junit:4.13.2' } ``` diff --git a/apps/android_deploy/app/build.gradle b/apps/android_deploy/app/build.gradle index 235bdcff5bfa1..4b4ec235f6535 100644 --- a/apps/android_deploy/app/build.gradle +++ b/apps/android_deploy/app/build.gradle @@ -62,14 +62,14 @@ tasks.withType(JavaCompile) { } android { - compileSdkVersion 31 + compileSdkVersion 33 defaultConfig { applicationId "org.apache.tvm.android.demo" minSdkVersion 24 - targetSdkVersion 26 + targetSdkVersion 33 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } buildTypes { release { @@ -83,22 +83,23 @@ android { jniLibs.srcDirs = ['src/main/libs'] } } - - lintOptions { - disable "Instantiatable" // MainActivity and RPCActivity must extend android.app.Activity - disable "MissingApplicationIcon" // Should explicitly set android:icon, there is no default - disable "UnsafeNativeCodeLocation" // Shared libraries should not be placed in the res or assets directories. + lint { + disable 'Instantiatable' // MainActivity and RPCActivity must extend android.app.Activity + disable 'MissingApplicationIcon' // Should explicitly set android:icon, there is no default + disable 'UnsafeNativeCodeLocation' // Shared libraries should not be placed in the res or assets directories. } + namespace 'org.apache.tvm.android.demo' + } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestImplementation('com.android.support.test.espresso:espresso-core:3.4.0', { + androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'com.android.support.constraint:constraint-layout:2.1.3' - implementation 'com.android.support:design:28.0.0' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'com.google.android.material:material:1.8.0' implementation files('../../../jvm/core/target/tvm4j-core-0.0.1-SNAPSHOT.jar') testImplementation 'junit:junit:4.13.2' } diff --git a/apps/android_deploy/app/download-models.gradle b/apps/android_deploy/app/download-models.gradle index dc1abf81aa359..a4e865505c31b 100644 --- a/apps/android_deploy/app/download-models.gradle +++ b/apps/android_deploy/app/download-models.gradle @@ -77,4 +77,22 @@ tasks.whenTaskAdded { task -> if (task.name == 'assembleRelease') { task.dependsOn 'extractModels' } + if (task.name == 'mergeDebugAssets') { + task.dependsOn 'extractModels' + } + if (task.name == 'mergeReleaseAssets') { + task.dependsOn 'extractModels' + } + if (task.name == 'lintVitalAnalyzeRelease') { + task.dependsOn 'extractModels' + } + if (task.name == 'lintVitalReportRelease') { + task.dependsOn 'extractModels' + } + if (task.name == 'lintAnalyzeDebug') { + task.dependsOn 'extractModels' + } + if (task.name == 'lintReportDebug') { + task.dependsOn 'extractModels' + } } diff --git a/apps/android_deploy/app/src/main/AndroidManifest.xml b/apps/android_deploy/app/src/main/AndroidManifest.xml index ce1b1fac45522..17a872ff315fd 100644 --- a/apps/android_deploy/app/src/main/AndroidManifest.xml +++ b/apps/android_deploy/app/src/main/AndroidManifest.xml @@ -19,8 +19,7 @@ specific language governing permissions and limitations under the License. --> - + diff --git a/apps/android_deploy/build.gradle b/apps/android_deploy/build.gradle index 35d20c9b3692b..b6d686b4e4c19 100644 --- a/apps/android_deploy/build.gradle +++ b/apps/android_deploy/build.gradle @@ -23,9 +23,10 @@ buildscript { maven { url 'https://maven.google.com' } + google() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.4.1' classpath 'org.apache.httpcomponents:httpclient:4.5.13' // NOTE: Do not place your application dependencies here; they belong @@ -41,6 +42,7 @@ allprojects { } mavenLocal() mavenCentral() + google() } } diff --git a/apps/android_rpc/README.md b/apps/android_rpc/README.md index d0a11b6121dcb..44b6f774697ec 100644 --- a/apps/android_rpc/README.md +++ b/apps/android_rpc/README.md @@ -33,13 +33,13 @@ Before you build the Android application, please refer to [TVM4J Installation Gu ``` dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestImplementation('com.android.support.test.espresso:espresso-core:3.4.0', { + androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'com.android.support.constraint:constraint-layout:2.1.3' - implementation 'com.android.support:design:28.0.0' - implementation 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'com.google.android.material:material:1.8.0' + implementation files('../../../jvm/core/target/tvm4j-core-0.0.1-SNAPSHOT.jar') testImplementation 'junit:junit:4.13.2' } ``` diff --git a/apps/android_rpc/app/build.gradle b/apps/android_rpc/app/build.gradle index 14d4a7bb9a610..4d4c835e031af 100644 --- a/apps/android_rpc/app/build.gradle +++ b/apps/android_rpc/app/build.gradle @@ -59,14 +59,14 @@ tasks.withType(JavaCompile) { // } android { - compileSdkVersion 31 + compileSdkVersion 33 defaultConfig { applicationId "org.apache.tvm.tvmrpc" minSdkVersion 24 - targetSdkVersion 26 + targetSdkVersion 33 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } buildTypes { release { @@ -81,21 +81,23 @@ android { } } - lintOptions { - disable "Instantiatable" // MainActivity and RPCActivity must extend android.app.Activity - disable "MissingClass" // .RPCWatchdogService was not found in the project or the libraries - disable "IconDipSize" // The image ic_launcher.png varies significantly in its density-independent size + lint { + disable 'Instantiatable' // MainActivity and RPCActivity must extend android.app.Activity + disable 'MissingClass' // .RPCWatchdogService was not found in the project or the libraries + disable 'IconDipSize' // The image ic_launcher.png varies significantly in its density-independent size } + namespace 'org.apache.tvm.tvmrpc' + } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - androidTestImplementation('com.android.support.test.espresso:espresso-core:3.4.0', { + androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'com.android.support.constraint:constraint-layout:2.1.3' - implementation 'com.android.support:design:28.0.0' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'com.google.android.material:material:1.8.0' implementation files('../../../jvm/core/target/tvm4j-core-0.0.1-SNAPSHOT.jar') testImplementation 'junit:junit:4.13.2' } diff --git a/apps/android_rpc/app/src/main/AndroidManifest.xml b/apps/android_rpc/app/src/main/AndroidManifest.xml index 217dbb859a764..2cba4af8867f2 100644 --- a/apps/android_rpc/app/src/main/AndroidManifest.xml +++ b/apps/android_rpc/app/src/main/AndroidManifest.xml @@ -19,8 +19,7 @@ specific language governing permissions and limitations under the License. --> - + diff --git a/apps/android_rpc/build.gradle b/apps/android_rpc/build.gradle index 1cd5ac9b656f1..7f98372768fae 100644 --- a/apps/android_rpc/build.gradle +++ b/apps/android_rpc/build.gradle @@ -23,9 +23,10 @@ buildscript { maven { url 'https://maven.google.com' } + google() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.4.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -40,6 +41,7 @@ allprojects { } mavenLocal() mavenCentral() + google() } }