Skip to content

Commit

Permalink
Upgrade AGP to v7.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yongce committed Feb 26, 2022
1 parent 33021e1 commit 7a54301
Show file tree
Hide file tree
Showing 8 changed files with 194 additions and 149 deletions.
6 changes: 3 additions & 3 deletions android_module_common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

pluginManager.withPlugin('kotlin-android') {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
}

Expand Down
71 changes: 32 additions & 39 deletions android_project_common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@ allprojects {
configurations.all {
resolutionStrategy {
eachDependency { details ->
if (details.requested.group == 'com.android.support') {
if (details.requested.name == 'multidex'
|| details.requested.name == 'multidex-instrumentation') {
details.useVersion versions.multidexLib
} else {
details.useVersion versions.supportLib
}
} else if (details.requested.group == 'androidx.arch.core') {
if (details.requested.group == 'androidx.arch.core') {
details.useVersion versions.archCore
} else if (details.requested.group == 'androidx.lifecycle') {
details.useVersion versions.lifecycle
Expand All @@ -38,29 +31,29 @@ ext {
'compileSdk' : 31,

// Android official support
'kotlin' : '1.5.31',
'kotlinCoroutine' : "1.4.1",
'kotlin' : '1.6.10',
'kotlinCoroutine' : "1.5.2",
'multidexLib' : "2.0.1",
'androidxCore' : '1.3.2',
'fragment' : '1.3.2',
'preference' : "1.1.1",
'androidxCore' : '1.7.0',
'fragment' : '1.4.1',
'preference' : "1.2.0",
'palette' : "1.0.0",
'recyclerView' : "1.2.0",
'constraintLayout' : "2.0.4",
'recyclerView' : "1.2.1",
'constraintLayout' : "2.1.3",
'vectorDrawable' : "1.1.0",
'lintLib' : '30.0.2',
'archCore' : "2.1.0",
'lifecycle' : "2.3.1",
'room' : '2.2.6',
'sqlite' : "2.1.0",
'navigation' : "2.3.5",
'paging' : "2.1.2",
'work' : "2.5.0",
'media2' : "1.1.2",
'lifecycle' : "2.4.1",
'room' : '2.4.1',
'sqlite' : "2.2.0",
'navigation' : "2.4.1",
'paging' : "3.1.0",
'work' : "2.7.1",
'media2' : "1.2.1",

// test
'testCore' : "1.3.0",
'espresso' : "3.3.0",
'testCore' : "1.4.0",
'espresso' : "3.4.0",
'uiautomator' : "2.2.0",
'truth' : '1.0.1',
'hamcrest' : '2.2',
Expand Down Expand Up @@ -98,7 +91,7 @@ ext {
'rxandroid' : "2.1.1",

// ycdev
'androidLib' : "2.0.0",
'androidLib' : "2.0.1",

// others
'zxing' : '3.4.0',
Expand All @@ -113,17 +106,17 @@ ext {
],
'androidx': [
// core
'annotation' : "androidx.annotation:annotation:1.2.0",
'annotation' : "androidx.annotation:annotation:1.3.0",
'core' : "androidx.core:core:${versions.androidxCore}",
'coreKtx' : "androidx.core:core-ktx:${versions.androidxCore}",
'fragment' : "androidx.fragment:fragment:${versions.fragment}",
'fragmentKtx' : "androidx.fragment:fragment-ktx:${versions.fragment}",
'localBroadcast' : "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0",
'collection' : "androidx.collection:collection:1.1.0",
'collectionKtx' : "androidx.collection:collection-ktx:1.1.0",
'localBroadcast' : "androidx.localbroadcastmanager:localbroadcastmanager:1.1.0",
'collection' : "androidx.collection:collection:1.2.0",
'collectionKtx' : "androidx.collection:collection-ktx:1.2.0",
// UI
'appcompat' : "androidx.appcompat:appcompat:1.2.0",
'material' : "com.google.android.material:material:1.3.0",
'appcompat' : "androidx.appcompat:appcompat:1.4.1",
'material' : "com.google.android.material:material:1.5.0",
'preference' : "androidx.preference:preference:${versions.preference}",
'preferenceKtx' : "androidx.preference:preference-ktx:${versions.preference}",
'constraintLayout' : "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}",
Expand All @@ -134,21 +127,21 @@ ext {
'recyclerview' : "androidx.recyclerview:recyclerview:${versions.recyclerView}",
'recyclerviewSelection' : "androidx.recyclerview:recyclerview:${versions.recyclerView}",
'percent' : "androidx.percentlayout:percentlayout:1.0.0",
'coordinatorLayout' : "androidx.coordinatorlayout:coordinatorlayout:1.1.0",
'coordinatorLayout' : "androidx.coordinatorlayout:coordinatorlayout:1.2.0",
'drawerLayout' : "androidx.drawerlayout:drawerlayout:1.1.1",
'swipeRefreshLayout' : "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0",
'viewPager' : "androidx.viewpager:viewpager:1.0.0",
'viewPager2' : "androidx.viewpager2:viewpager2:1.0.0",
'vectorDrawable' : "androidx.vectordrawable:vectordrawable:${versions.vectorDrawable}",
'animatedVectorDrawable' : "androidx.vectordrawable:vectordrawable-animated:${versions.vectorDrawable}",
'browser' : "androidx.browser:browser:1.3.0",
'transition' : "androidx.transition:transition:1.4.0",
'browser' : "androidx.browser:browser:1.4.0",
'transition' : "androidx.transition:transition:1.4.1",
// others
'multidex' : "androidx.multidex:multidex:${versions.multidexLib}",
'mediaSession' : "androidx.media2:media2-session:${versions.media2}",
'mediaExoPlayer' : "androidx.media2:media2-exoplayer:${versions.media2}",
'mediarouter' : "androidx.mediarouter:mediarouter:1.2.2",
'exifinterface' : "androidx.exifinterface:exifinterface:1.3.2",
'mediarouter' : "androidx.mediarouter:mediarouter:1.2.6",
'exifinterface' : "androidx.exifinterface:exifinterface:1.3.3",
'wear' : "androidx.wear:wear:1.0.0",
// legacy
'coreUtils' : "androidx.legacy:legacy-support-core-utils:1.0.0",
Expand Down Expand Up @@ -220,9 +213,9 @@ ext {
'monitor' : "androidx.test:monitor:${versions.testCore}",
'orchestrator' : "androidx.test:orchestrator:${versions.testCore}",
// ext
'junit' : "androidx.test.ext:junit:1.1.2",
'junitKtx' : "androidx.test.ext:junit-ktx:1.1.2",
'truthAndroidX' : "androidx.test.ext:truth:1.3.0",
'junit' : "androidx.test.ext:junit:1.1.3",
'junitKtx' : "androidx.test.ext:junit-ktx:1.1.3",
'truthAndroidX' : "androidx.test.ext:truth:1.4.0",
'truth' : "com.google.truth:truth:${versions.truth}",
'truthJava8' : "com.google.truth.extensions:truth-java8-extension:${versions.truth}",
// espresso
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AppsSelectorViewModel(
private val excludeSystem: Boolean
) : ViewModelProvider.Factory {
@Suppress("UNCHECKED_CAST")
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
if (modelClass == AppsSelectorViewModel::class.java) {
return AppsSelectorViewModel(
app,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.ycdev.android.devtools.device

import android.annotation.SuppressLint
import android.bluetooth.BluetoothAdapter
import android.bluetooth.BluetoothDevice
import android.bluetooth.BluetoothManager
Expand Down Expand Up @@ -146,11 +147,13 @@ class BluetoothViewerActivity : AppCompatBaseActivity(), OnClickListener {
return adapter?.state ?: STATE_UNKNOWN
}

@SuppressLint("MissingPermission")
private fun enableBluetooth() {
val adapter = bluetoothAdapter
adapter?.enable()
}

@SuppressLint("MissingPermission")
private fun disableBluetooth() {
val adapter = bluetoothAdapter
adapter?.disable()
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
}
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
Loading

0 comments on commit 7a54301

Please sign in to comment.