Skip to content

Commit eeef97d

Browse files
committed
ANDROID-16201/update-api-34: Fix some deprecated components
1 parent b76098d commit eeef97d

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

app/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
plugins {
24
id 'com.android.application'
35
id 'org.jetbrains.kotlin.android'
@@ -24,8 +26,10 @@ android {
2426
sourceCompatibility JavaVersion.VERSION_17
2527
targetCompatibility JavaVersion.VERSION_17
2628
}
27-
kotlinOptions {
28-
jvmTarget = '17'
29+
kotlin {
30+
compilerOptions {
31+
jvmTarget.set(JvmTarget.JVM_17)
32+
}
2933
}
3034
buildFeatures {
3135
viewBinding true

build.gradle

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import io.gitlab.arturbosch.detekt.Detekt
2+
13
// Top-level build file where you can add configuration options common to all sub-projects/modules.
24
buildscript {
35
dependencies {
@@ -15,22 +17,27 @@ plugins {
1517
id 'io.gitlab.arturbosch.detekt' version '1.23.8'
1618
}
1719

18-
detekt {
19-
input = files(rootProject.rootDir)
20-
config = files("$projectDir/detekt.yml")
20+
tasks.withType(Detekt).configureEach {
21+
// Files to analyze
22+
setSource(files(rootProject.rootDir))
23+
24+
// Configuration
25+
config.setFrom(files("$projectDir/detekt.yml"))
2126
allRules = true
2227
buildUponDefaultConfig = true
2328

2429
reports {
25-
html.enabled = true
26-
xml.enabled = true
27-
xml.destination = file("$buildDir/reports/detekt/detekt-checkstyle.xml")
28-
html.destination = file("$buildDir/reports/detekt/detekt-report.html")
30+
html.required.set(true)
31+
html.outputLocation.set(layout.buildDirectory.file("reports/detekt/detekt-report.html"))
32+
33+
xml.required.set(true)
34+
xml.outputLocation.set(layout.buildDirectory.file("reports/detekt/detekt-checkstyle.xml"))
2935
}
3036
}
3137

38+
3239
tasks.register('clean', Delete) {
33-
delete rootProject.buildDir
40+
delete rootProject.layout.buildDirectory
3441
}
3542

3643
allprojects {

0 commit comments

Comments
 (0)