diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2023-03-22 21:27:50 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2023-03-22 21:35:34 +0530 |
commit | 052ff060b18491d178a68336a68b4f2b959d2de2 (patch) | |
tree | fb0a00881488854241fd05d10bdb5cc9649228ee | |
parent | e843fccbc6a4a61c6473e48bca7b9c1fa46c334b (diff) |
gradle: use idiomatic task handling
- The hand-rolled clean task is not required
- Tasks should use configureEach to prevent eager evaluation
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
-rw-r--r-- | build.gradle | 4 | ||||
-rw-r--r-- | ui/build.gradle | 10 |
2 files changed, 5 insertions, 9 deletions
diff --git a/build.gradle b/build.gradle index 46d94a33..448162f0 100644 --- a/build.gradle +++ b/build.gradle @@ -23,10 +23,6 @@ buildscript { } } -task clean(type: Delete) { - delete rootProject.buildDir -} - tasks { wrapper { gradleVersion = "8.0.2" diff --git a/ui/build.gradle b/ui/build.gradle index a5e7b4fa..2c2a3fa8 100644 --- a/ui/build.gradle +++ b/ui/build.gradle @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' @@ -82,13 +84,11 @@ dependencies { coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugarVersion" } -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { options.compilerArgs << '-Xlint:unchecked' options.deprecation = true } -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } +tasks.withType(KotlinCompile).configureEach { + kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8 } |