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 fc6cbbc commit 3fcee4a
Show file tree
Hide file tree
Showing 19 changed files with 227 additions and 205 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 19 additions & 26 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,25 +31,25 @@ ext {
'compileSdk' : 31,

// Android official support
'kotlin' : '1.5.31',
'kotlin' : '1.6.10',
'kotlinCoroutine' : "1.5.2",
'multidexLib' : "2.0.1",
'androidxCore' : '1.7.0',
'fragment' : '1.3.6',
'preference' : "1.1.1",
'fragment' : '1.4.1',
'preference' : "1.2.0",
'palette' : "1.0.0",
'recyclerView' : "1.2.1",
'constraintLayout' : "2.1.1",
'constraintLayout' : "2.1.3",
'vectorDrawable' : "1.1.0",
'lintLib' : '30.0.2',
'archCore' : "2.1.0",
'lifecycle' : "2.4.0",
'room' : '2.3.0',
'sqlite' : "2.1.0",
'navigation' : "2.3.5",
'paging' : "3.0.1",
'work' : "2.7.0",
'media2' : "1.2.0",
'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.4.0",
Expand Down Expand Up @@ -118,12 +111,12 @@ ext {
'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.3.1",
'material' : "com.google.android.material:material:1.4.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,7 +127,7 @@ 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",
Expand All @@ -147,7 +140,7 @@ ext {
'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.5",
'mediarouter' : "androidx.mediarouter:mediarouter:1.2.6",
'exifinterface' : "androidx.exifinterface:exifinterface:1.3.3",
'wear' : "androidx.wear:wear:1.0.0",
// legacy
Expand Down
3 changes: 0 additions & 3 deletions archLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ android {
defaultConfig {
minSdkVersion versions.minSdk
}

lintOptions {
}
}

dependencies {
Expand Down
6 changes: 6 additions & 0 deletions archLintRules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ test {
showStandardStreams = true
}
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
jvmTarget = "11"
}
}
26 changes: 12 additions & 14 deletions archLintRulesTestDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,37 @@ android {
}
}

lintOptions {
abortOnError false

// comment the following line when debug lint rules
disable 'MyBaseActivity', 'MyBroadcastHelper', 'MyIntentHelper', 'MyToastHelper'

disable 'GoogleAppIndexingWarning'
disable 'AllowBackup'
lint {
// It's too slow to run lint checks. So disable it.
checkDependencies false
checkReleaseBuilds false
checkOnly 'AllowBackup'
ignoreWarnings true
}
}

dependencies {
implementation project(':archLib')

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}"
implementation "androidx.appcompat:appcompat:1.3.1"
implementation "androidx.appcompat:appcompat:1.4.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.kotlinCoroutine}"

// The following dependencies are just for checking new versions of library
implementation "androidx.core:core-ktx:${versions.androidxCore}"
implementation "androidx.fragment:fragment-ktx:${versions.fragment}"
implementation "com.google.android.material:material:1.4.0"
implementation "com.google.android.material:material:1.5.0"
implementation "androidx.multidex:multidex:${versions.multidexLib}"
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0"
implementation "androidx.collection:collection-ktx:1.1.0"
implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.1.0"
implementation "androidx.collection:collection-ktx:1.2.0"
implementation "androidx.preference:preference-ktx:${versions.preference}"
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.gridlayout:gridlayout:1.0.0"
implementation "androidx.palette:palette-ktx:${versions.palette}"
implementation "androidx.recyclerview:recyclerview:${versions.recyclerView}"
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
implementation "androidx.coordinatorlayout:coordinatorlayout:1.2.0"
implementation "androidx.drawerlayout:drawerlayout:1.1.1"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation "androidx.viewpager2:viewpager2:1.0.0"
Expand All @@ -66,7 +64,7 @@ dependencies {
implementation "androidx.browser:browser:1.4.0"
implementation "androidx.transition:transition:1.4.1"
implementation "androidx.media2:media2-session:${versions.media2}"
implementation "androidx.mediarouter:mediarouter:1.2.5"
implementation "androidx.mediarouter:mediarouter:1.2.6"
implementation "androidx.exifinterface:exifinterface:1.3.3"

implementation "androidx.arch.core:core-common:${versions.archCore}"
Expand Down
2 changes: 1 addition & 1 deletion baseLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdkVersion versions.minSdk
}

lintOptions {
lint {
disable 'PrivateApi'
}
}
Expand Down
4 changes: 0 additions & 4 deletions baseLib/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.ycdev.android.lib.common.test">

<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="9" />

<permission
android:name="${applicationId}.permission.DYNAMIC_BROADCAST"
android:protectionLevel="signature" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract class PacketsWorker(
fun onDataParsed(data: ByteArray)
}

@VisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
internal enum class ParserState {
HEADER_MAGIC,
VERSION,
Expand Down
17 changes: 2 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,15 @@ buildscript {
}
apply from: "${androidProjectCommon}"

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
}
}

plugins {
id("com.diffplug.spotless") version "5.16.0"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.jetbrains.dokka") version "1.5.30"
}

allprojects {
repositories {
google()
mavenCentral()
}
}

ext {
Expand All @@ -39,7 +26,7 @@ ext {
'projectScmDevConnection': 'ssh://[email protected]/yongce/AndroidLib.git',
'projectInceptionYear': '2013',
'groupId': 'io.github.yongce',
'version': '2.0.0',
'version': '2.0.1',
'developerId': 'yongce',
'developerName': 'Yongce Tu',
'developerEmail': '[email protected]',
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ android.enableJetifier=true

org.gradle.jvmargs=-Xmx4096M

android.disableAutomaticComponentCreation=true
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 3fcee4a

Please sign in to comment.