From c75435bf60fc2dbbae056738cf1f1106fe16f55a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odin=20Asbj=C3=B8rnsen?= Date: Sun, 16 Apr 2023 20:26:36 +0200 Subject: [PATCH 1/3] Prepare drawable painter module gradle for Kotlin DSL migration --- drawablepainter/build.gradle | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drawablepainter/build.gradle b/drawablepainter/build.gradle index 6e5ce5901..0bb953347 100644 --- a/drawablepainter/build.gradle +++ b/drawablepainter/build.gradle @@ -15,10 +15,10 @@ */ plugins { - id 'com.android.library' - id 'kotlin-android' - id 'org.jetbrains.dokka' - id 'me.tylerbwong.gradle.metalava' + id("com.android.library") + id("kotlin-android") + id("org.jetbrains.dokka") + id("me.tylerbwong.gradle.metalava") } kotlin { @@ -26,43 +26,43 @@ kotlin { } android { - namespace "com.google.accompanist.drawablepainter" + namespace = "com.google.accompanist.drawablepainter" - compileSdkVersion 33 + compileSdkVersion = 33 defaultConfig { minSdkVersion 21 // targetSdkVersion has no effect for libraries. This is only used for the test APK targetSdkVersion 33 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } buildFeatures { - buildConfig false - compose true + buildConfig = false + compose = true } composeOptions { - kotlinCompilerExtensionVersion libs.versions.composeCompiler.get() + kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() } lintOptions { - textReport true + textReport = true textOutput 'stdout' // We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks - checkReleaseBuilds false + checkReleaseBuilds = false } testOptions { unitTests { includeAndroidResources = true } - animationsDisabled true + animationsDisabled = true } } @@ -73,8 +73,8 @@ metalava { } dependencies { - implementation libs.compose.ui.ui - implementation libs.kotlin.coroutines.android + implementation(libs.compose.ui.ui) + implementation(libs.kotlin.coroutines.android) } apply plugin: "com.vanniktech.maven.publish" From 57966eb6b87db977432add9ebe4a0ab1109fb5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odin=20Asbj=C3=B8rnsen?= Date: Sun, 16 Apr 2023 20:46:18 +0200 Subject: [PATCH 2/3] Migrate drawablepainter module gradle file to Kotlin DSL --- .../{build.gradle => build.gradle.kts} | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename drawablepainter/{build.gradle => build.gradle.kts} (88%) diff --git a/drawablepainter/build.gradle b/drawablepainter/build.gradle.kts similarity index 88% rename from drawablepainter/build.gradle rename to drawablepainter/build.gradle.kts index 0bb953347..a9a9928ba 100644 --- a/drawablepainter/build.gradle +++ b/drawablepainter/build.gradle.kts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +@file:Suppress("UnstableApiUsage") plugins { id("com.android.library") @@ -28,12 +29,12 @@ kotlin { android { namespace = "com.google.accompanist.drawablepainter" - compileSdkVersion = 33 + compileSdk = 33 defaultConfig { - minSdkVersion 21 + minSdk = 21 // targetSdkVersion has no effect for libraries. This is only used for the test APK - targetSdkVersion 33 + targetSdk = 33 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -51,16 +52,16 @@ android { kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() } - lintOptions { + lint { textReport = true - textOutput 'stdout' + textOutput = File("stdout") // We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks checkReleaseBuilds = false } testOptions { unitTests { - includeAndroidResources = true + isIncludeAndroidResources = true } animationsDisabled = true } @@ -77,4 +78,4 @@ dependencies { implementation(libs.kotlin.coroutines.android) } -apply plugin: "com.vanniktech.maven.publish" +apply(plugin = "com.vanniktech.maven.publish") From e3cdbe3c49c6ba06ffc2615aa337793e69fef36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odin=20Asbj=C3=B8rnsen?= Date: Fri, 28 Apr 2023 17:05:37 +0200 Subject: [PATCH 3/3] Apply review comments --- drawablepainter/build.gradle.kts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drawablepainter/build.gradle.kts b/drawablepainter/build.gradle.kts index a9a9928ba..734fbadf6 100644 --- a/drawablepainter/build.gradle.kts +++ b/drawablepainter/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Android Open Source Project + * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,11 @@ @file:Suppress("UnstableApiUsage") plugins { - id("com.android.library") - id("kotlin-android") - id("org.jetbrains.dokka") - id("me.tylerbwong.gradle.metalava") + id(libs.plugins.android.library.get().pluginId) + id(libs.plugins.android.kotlin.get().pluginId) + id(libs.plugins.jetbrains.dokka.get().pluginId) + id(libs.plugins.gradle.metalava.get().pluginId) + id(libs.plugins.vanniktech.maven.publish.get().pluginId) } kotlin { @@ -77,5 +78,3 @@ dependencies { implementation(libs.compose.ui.ui) implementation(libs.kotlin.coroutines.android) } - -apply(plugin = "com.vanniktech.maven.publish")