Skip to content

Commit 303d15c

Browse files
committed
Migrate to AGP 7 and update to Gradle 6.8.2
This is needed to get started with Compose
1 parent c7f188d commit 303d15c

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

app/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ android {
2121
}
2222
}
2323

24-
lintOptions {
24+
lint {
2525
disable("ResourceName", "MissingTranslation", "DuplicateStrings")
2626
}
2727

2828
compileOptions {
29-
setSourceCompatibility(JavaVersion.VERSION_1_8)
30-
setTargetCompatibility(JavaVersion.VERSION_1_8)
29+
sourceCompatibility = JavaVersion.VERSION_1_8
30+
targetCompatibility = JavaVersion.VERSION_1_8
3131
}
3232
}
3333

auth/build.gradle.kts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import com.android.build.gradle.internal.dsl.TestOptions
2-
31
android {
42
buildTypes {
53
named("release").configure {
@@ -8,7 +6,7 @@ android {
86
}
97
}
108

11-
lintOptions {
9+
lint {
1210
disable("UnusedQuantity")
1311
disable("UnknownNullness") // TODO fix in future PR
1412
disable("TypographyQuotes") // Straight versus directional quotes
@@ -19,9 +17,9 @@ android {
1917
}
2018

2119
testOptions {
22-
unitTests(closureOf<TestOptions.UnitTestOptions> {
20+
unitTests {
2321
isIncludeAndroidResources = true
24-
})
22+
}
2523
}
2624
}
2725

build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ fun Project.configureAndroid() {
8888
minSdkVersion(Config.SdkVersions.min)
8989
targetSdkVersion(Config.SdkVersions.target)
9090

91-
versionName = Config.version
91+
buildConfigField("String", "VERSION_NAME", "\"${Config.version}\"")
9292
versionCode = 1
9393

9494
resourcePrefix("fui_")
@@ -132,7 +132,7 @@ fun Project.configureQuality() {
132132

133133
fun Project.setupPublishing() {
134134
val sourcesJar = tasks.register<Jar>("sourcesJar") {
135-
classifier = "sources"
135+
archiveClassifier.set("sources")
136136
from(project.the<BaseExtension>().sourceSets["main"].java.srcDirs)
137137
}
138138

@@ -141,7 +141,8 @@ fun Project.setupPublishing() {
141141
classpath += files(project.the<BaseExtension>().bootClasspath)
142142

143143
project.the<LibraryExtension>().libraryVariants.configureEach {
144-
dependsOn(assemble)
144+
dependsOn(assembleProvider)
145+
// TODO 07.03.2021: Migrate to lazy task API
145146
classpath += files((javaCompiler as AbstractCompile).classpath)
146147
}
147148

@@ -151,7 +152,7 @@ fun Project.setupPublishing() {
151152

152153
val javadocJar = tasks.register<Jar>("javadocJar") {
153154
dependsOn(javadoc)
154-
classifier = "javadoc"
155+
archiveClassifier.set("javadoc")
155156
from(javadoc.get().destinationDir)
156157
}
157158

buildSrc/src/main/kotlin/Config.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object Config {
1111
}
1212

1313
object Plugins {
14-
const val android = "com.android.tools.build:gradle:4.0.0"
14+
const val android = "com.android.tools.build:gradle:7.0.0-alpha08"
1515
const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
1616
const val google = "com.google.gms:google-services:4.3.3"
1717

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

library/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tasks.named("check").configure { dependsOn("testAll", "prepareArtifacts") }
22

33
android {
4-
lintOptions {
4+
lint {
55
isAbortOnError = false
66
}
77
}

0 commit comments

Comments
 (0)