From 4ce0e2465f92b4c1217ebdb5c38bdcd0edcf8ea9 Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 11:24:50 -0700 Subject: [PATCH 01/11] Migrate to spotless plugin and remove init script --- .github/workflows/build-sample.yml | 2 +- Jetcaster/build.gradle.kts | 47 +++++++++++++++++ Jetcaster/buildscripts/init.gradle.kts | 72 -------------------------- Jetcaster/gradle/libs.versions.toml | 2 + 4 files changed, 50 insertions(+), 73 deletions(-) delete mode 100644 Jetcaster/buildscripts/init.gradle.kts diff --git a/.github/workflows/build-sample.yml b/.github/workflows/build-sample.yml index d4d65a9984..b06f5465e4 100644 --- a/.github/workflows/build-sample.yml +++ b/.github/workflows/build-sample.yml @@ -59,7 +59,7 @@ jobs: - name: Check formatting working-directory: ${{ inputs.path }} - run: ./gradlew --init-script buildscripts/init.gradle.kts spotlessCheck --stacktrace + run: ./gradlew spotlessCheck --stacktrace - name: Check lint working-directory: ${{ inputs.path }} diff --git a/Jetcaster/build.gradle.kts b/Jetcaster/build.gradle.kts index 8488c7159d..bcd5617e23 100644 --- a/Jetcaster/build.gradle.kts +++ b/Jetcaster/build.gradle.kts @@ -24,6 +24,53 @@ plugins { alias(libs.plugins.hilt) apply false alias(libs.plugins.ksp) apply false alias(libs.plugins.compose) apply false + alias(libs.plugins.spotless) apply false } apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") + +subprojects { + apply(plugin = "com.diffplug.spotless") + configure { + ratchetFrom = "origin/main" + kotlin { + target("**/*.kt") + targetExclude("**/build/**/*.kt") + ktlint().editorConfigOverride( + mapOf( + "ktlint_code_style" to "android_studio", + "ij_kotlin_allow_trailing_comma" to true, + "ktlint_function_naming_ignore_when_annotated_with" to "Composable", + // These rules were introduced in ktlint 0.46.0 and should not be + // enabled without further discussion. They are disabled for now. + // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 + "disabled_rules" to + "filename," + + "annotation,annotation-spacing," + + "argument-list-wrapping," + + "double-colon-spacing," + + "enum-entry-name-case," + + "multiline-if-else," + + "no-empty-first-line-in-method-block," + + "package-name," + + "trailing-comma," + + "spacing-around-angle-brackets," + + "spacing-between-declarations-with-annotations," + + "spacing-between-declarations-with-comments," + + "unary-op-spacing" + ) + ) + licenseHeaderFile(rootProject.file("spotless/copyright.kt")) + } + format("kts") { + target("**/*.kts") + targetExclude("**/build/**/*.kts") + // Look for the first line that doesn't have a block comment (assumed to be the license) + licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") + } + kotlinGradle { + target("*.gradle.kts") + ktlint() + } + } +} diff --git a/Jetcaster/buildscripts/init.gradle.kts b/Jetcaster/buildscripts/init.gradle.kts deleted file mode 100644 index 1b7a54264c..0000000000 --- a/Jetcaster/buildscripts/init.gradle.kts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2022 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -val ktlintVersion = "0.46.1" - -initscript { - val spotlessVersion = "6.10.0" - - repositories { - mavenCentral() - } - - dependencies { - classpath("com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion") - } -} - -allprojects { - if (this == rootProject) { - return@allprojects - } - apply() - extensions.configure { - kotlin { - target("**/*.kt") - targetExclude("**/build/**/*.kt") - ktlint(ktlintVersion).editorConfigOverride( - mapOf( - "ktlint_code_style" to "android", - "ij_kotlin_allow_trailing_comma" to true, - // These rules were introduced in ktlint 0.46.0 and should not be - // enabled without further discussion. They are disabled for now. - // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 - "disabled_rules" to - "filename," + - "annotation,annotation-spacing," + - "argument-list-wrapping," + - "double-colon-spacing," + - "enum-entry-name-case," + - "multiline-if-else," + - "no-empty-first-line-in-method-block," + - "package-name," + - "trailing-comma," + - "spacing-around-angle-brackets," + - "spacing-between-declarations-with-annotations," + - "spacing-between-declarations-with-comments," + - "unary-op-spacing" - ) - ) - licenseHeaderFile(rootProject.file("spotless/copyright.kt")) - } - format("kts") { - target("**/*.kts") - targetExclude("**/build/**/*.kts") - // Look for the first line that doesn't have a block comment (assumed to be the license) - licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") - } - } -} \ No newline at end of file diff --git a/Jetcaster/gradle/libs.versions.toml b/Jetcaster/gradle/libs.versions.toml index b772707772..3cffd54753 100644 --- a/Jetcaster/gradle/libs.versions.toml +++ b/Jetcaster/gradle/libs.versions.toml @@ -54,6 +54,7 @@ roborazzi = "1.42.0" rome = "2.1.0" room = "2.6.1" secrets = "2.0.1" +spotless = "7.0.3" # @keep targetSdk = "33" version-catalog-update = "0.8.5" @@ -173,4 +174,5 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" } secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" } From 27a033f5d90f9f66d440c4c0aff341ee19f5bd42 Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 11:49:30 -0700 Subject: [PATCH 02/11] Add 5 spotless version imports --- JetLagged/gradle/libs.versions.toml | 2 ++ JetNews/gradle/libs.versions.toml | 2 ++ Jetchat/gradle/libs.versions.toml | 2 ++ Jetsnack/gradle/libs.versions.toml | 2 ++ Reply/gradle/libs.versions.toml | 2 ++ 5 files changed, 10 insertions(+) diff --git a/JetLagged/gradle/libs.versions.toml b/JetLagged/gradle/libs.versions.toml index 29300201d3..1cd5b96b62 100644 --- a/JetLagged/gradle/libs.versions.toml +++ b/JetLagged/gradle/libs.versions.toml @@ -53,6 +53,7 @@ roborazzi = "1.42.0" rome = "2.1.0" room = "2.6.1" secrets = "2.0.1" +spotless = "7.0.3" # @keep targetSdk = "33" version-catalog-update = "0.8.5" @@ -171,4 +172,5 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" } secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" } diff --git a/JetNews/gradle/libs.versions.toml b/JetNews/gradle/libs.versions.toml index 29300201d3..1cd5b96b62 100644 --- a/JetNews/gradle/libs.versions.toml +++ b/JetNews/gradle/libs.versions.toml @@ -53,6 +53,7 @@ roborazzi = "1.42.0" rome = "2.1.0" room = "2.6.1" secrets = "2.0.1" +spotless = "7.0.3" # @keep targetSdk = "33" version-catalog-update = "0.8.5" @@ -171,4 +172,5 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" } secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" } diff --git a/Jetchat/gradle/libs.versions.toml b/Jetchat/gradle/libs.versions.toml index 29300201d3..1cd5b96b62 100644 --- a/Jetchat/gradle/libs.versions.toml +++ b/Jetchat/gradle/libs.versions.toml @@ -53,6 +53,7 @@ roborazzi = "1.42.0" rome = "2.1.0" room = "2.6.1" secrets = "2.0.1" +spotless = "7.0.3" # @keep targetSdk = "33" version-catalog-update = "0.8.5" @@ -171,4 +172,5 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" } secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" } diff --git a/Jetsnack/gradle/libs.versions.toml b/Jetsnack/gradle/libs.versions.toml index 29300201d3..1cd5b96b62 100644 --- a/Jetsnack/gradle/libs.versions.toml +++ b/Jetsnack/gradle/libs.versions.toml @@ -53,6 +53,7 @@ roborazzi = "1.42.0" rome = "2.1.0" room = "2.6.1" secrets = "2.0.1" +spotless = "7.0.3" # @keep targetSdk = "33" version-catalog-update = "0.8.5" @@ -171,4 +172,5 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" } secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" } diff --git a/Reply/gradle/libs.versions.toml b/Reply/gradle/libs.versions.toml index 29300201d3..1cd5b96b62 100644 --- a/Reply/gradle/libs.versions.toml +++ b/Reply/gradle/libs.versions.toml @@ -53,6 +53,7 @@ roborazzi = "1.42.0" rome = "2.1.0" room = "2.6.1" secrets = "2.0.1" +spotless = "7.0.3" # @keep targetSdk = "33" version-catalog-update = "0.8.5" @@ -171,4 +172,5 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" } secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" } From b7396acfee1a1f1bbed4bfc6aca3a9c17096eace Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 11:49:12 -0700 Subject: [PATCH 03/11] Add 5 spotless configurations --- JetLagged/build.gradle.kts | 47 ++++++++++++++++++++++++++++++++++++++ JetNews/build.gradle.kts | 47 ++++++++++++++++++++++++++++++++++++++ Jetchat/build.gradle.kts | 47 ++++++++++++++++++++++++++++++++++++++ Jetsnack/build.gradle.kts | 47 ++++++++++++++++++++++++++++++++++++++ Reply/build.gradle.kts | 47 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 235 insertions(+) diff --git a/JetLagged/build.gradle.kts b/JetLagged/build.gradle.kts index 0a68895495..2b3f56e8a2 100644 --- a/JetLagged/build.gradle.kts +++ b/JetLagged/build.gradle.kts @@ -21,6 +21,53 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.parcelize) apply false alias(libs.plugins.compose) apply false + alias(libs.plugins.spotless) apply false } apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") + +subprojects { + apply(plugin = "com.diffplug.spotless") + configure { + ratchetFrom = "origin/main" + kotlin { + target("**/*.kt") + targetExclude("**/build/**/*.kt") + ktlint().editorConfigOverride( + mapOf( + "ktlint_code_style" to "android_studio", + "ij_kotlin_allow_trailing_comma" to true, + "ktlint_function_naming_ignore_when_annotated_with" to "Composable", + // These rules were introduced in ktlint 0.46.0 and should not be + // enabled without further discussion. They are disabled for now. + // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 + "disabled_rules" to + "filename," + + "annotation,annotation-spacing," + + "argument-list-wrapping," + + "double-colon-spacing," + + "enum-entry-name-case," + + "multiline-if-else," + + "no-empty-first-line-in-method-block," + + "package-name," + + "trailing-comma," + + "spacing-around-angle-brackets," + + "spacing-between-declarations-with-annotations," + + "spacing-between-declarations-with-comments," + + "unary-op-spacing" + ) + ) + licenseHeaderFile(rootProject.file("spotless/copyright.kt")) + } + format("kts") { + target("**/*.kts") + targetExclude("**/build/**/*.kts") + // Look for the first line that doesn't have a block comment (assumed to be the license) + licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") + } + kotlinGradle { + target("*.gradle.kts") + ktlint() + } + } +} diff --git a/JetNews/build.gradle.kts b/JetNews/build.gradle.kts index 08ccea3e70..30355ffe44 100644 --- a/JetNews/build.gradle.kts +++ b/JetNews/build.gradle.kts @@ -21,6 +21,53 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.parcelize) apply false alias(libs.plugins.compose) apply false + alias(libs.plugins.spotless) apply false } apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") + +subprojects { + apply(plugin = "com.diffplug.spotless") + configure { + ratchetFrom = "origin/main" + kotlin { + target("**/*.kt") + targetExclude("**/build/**/*.kt") + ktlint().editorConfigOverride( + mapOf( + "ktlint_code_style" to "android_studio", + "ij_kotlin_allow_trailing_comma" to true, + "ktlint_function_naming_ignore_when_annotated_with" to "Composable", + // These rules were introduced in ktlint 0.46.0 and should not be + // enabled without further discussion. They are disabled for now. + // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 + "disabled_rules" to + "filename," + + "annotation,annotation-spacing," + + "argument-list-wrapping," + + "double-colon-spacing," + + "enum-entry-name-case," + + "multiline-if-else," + + "no-empty-first-line-in-method-block," + + "package-name," + + "trailing-comma," + + "spacing-around-angle-brackets," + + "spacing-between-declarations-with-annotations," + + "spacing-between-declarations-with-comments," + + "unary-op-spacing" + ) + ) + licenseHeaderFile(rootProject.file("spotless/copyright.kt")) + } + format("kts") { + target("**/*.kts") + targetExclude("**/build/**/*.kts") + // Look for the first line that doesn't have a block comment (assumed to be the license) + licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") + } + kotlinGradle { + target("*.gradle.kts") + ktlint() + } + } +} diff --git a/Jetchat/build.gradle.kts b/Jetchat/build.gradle.kts index 08ccea3e70..30355ffe44 100644 --- a/Jetchat/build.gradle.kts +++ b/Jetchat/build.gradle.kts @@ -21,6 +21,53 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.parcelize) apply false alias(libs.plugins.compose) apply false + alias(libs.plugins.spotless) apply false } apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") + +subprojects { + apply(plugin = "com.diffplug.spotless") + configure { + ratchetFrom = "origin/main" + kotlin { + target("**/*.kt") + targetExclude("**/build/**/*.kt") + ktlint().editorConfigOverride( + mapOf( + "ktlint_code_style" to "android_studio", + "ij_kotlin_allow_trailing_comma" to true, + "ktlint_function_naming_ignore_when_annotated_with" to "Composable", + // These rules were introduced in ktlint 0.46.0 and should not be + // enabled without further discussion. They are disabled for now. + // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 + "disabled_rules" to + "filename," + + "annotation,annotation-spacing," + + "argument-list-wrapping," + + "double-colon-spacing," + + "enum-entry-name-case," + + "multiline-if-else," + + "no-empty-first-line-in-method-block," + + "package-name," + + "trailing-comma," + + "spacing-around-angle-brackets," + + "spacing-between-declarations-with-annotations," + + "spacing-between-declarations-with-comments," + + "unary-op-spacing" + ) + ) + licenseHeaderFile(rootProject.file("spotless/copyright.kt")) + } + format("kts") { + target("**/*.kts") + targetExclude("**/build/**/*.kts") + // Look for the first line that doesn't have a block comment (assumed to be the license) + licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") + } + kotlinGradle { + target("*.gradle.kts") + ktlint() + } + } +} diff --git a/Jetsnack/build.gradle.kts b/Jetsnack/build.gradle.kts index 08ccea3e70..30355ffe44 100644 --- a/Jetsnack/build.gradle.kts +++ b/Jetsnack/build.gradle.kts @@ -21,6 +21,53 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.parcelize) apply false alias(libs.plugins.compose) apply false + alias(libs.plugins.spotless) apply false } apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") + +subprojects { + apply(plugin = "com.diffplug.spotless") + configure { + ratchetFrom = "origin/main" + kotlin { + target("**/*.kt") + targetExclude("**/build/**/*.kt") + ktlint().editorConfigOverride( + mapOf( + "ktlint_code_style" to "android_studio", + "ij_kotlin_allow_trailing_comma" to true, + "ktlint_function_naming_ignore_when_annotated_with" to "Composable", + // These rules were introduced in ktlint 0.46.0 and should not be + // enabled without further discussion. They are disabled for now. + // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 + "disabled_rules" to + "filename," + + "annotation,annotation-spacing," + + "argument-list-wrapping," + + "double-colon-spacing," + + "enum-entry-name-case," + + "multiline-if-else," + + "no-empty-first-line-in-method-block," + + "package-name," + + "trailing-comma," + + "spacing-around-angle-brackets," + + "spacing-between-declarations-with-annotations," + + "spacing-between-declarations-with-comments," + + "unary-op-spacing" + ) + ) + licenseHeaderFile(rootProject.file("spotless/copyright.kt")) + } + format("kts") { + target("**/*.kts") + targetExclude("**/build/**/*.kts") + // Look for the first line that doesn't have a block comment (assumed to be the license) + licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") + } + kotlinGradle { + target("*.gradle.kts") + ktlint() + } + } +} diff --git a/Reply/build.gradle.kts b/Reply/build.gradle.kts index 0a68895495..2b3f56e8a2 100644 --- a/Reply/build.gradle.kts +++ b/Reply/build.gradle.kts @@ -21,6 +21,53 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.parcelize) apply false alias(libs.plugins.compose) apply false + alias(libs.plugins.spotless) apply false } apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") + +subprojects { + apply(plugin = "com.diffplug.spotless") + configure { + ratchetFrom = "origin/main" + kotlin { + target("**/*.kt") + targetExclude("**/build/**/*.kt") + ktlint().editorConfigOverride( + mapOf( + "ktlint_code_style" to "android_studio", + "ij_kotlin_allow_trailing_comma" to true, + "ktlint_function_naming_ignore_when_annotated_with" to "Composable", + // These rules were introduced in ktlint 0.46.0 and should not be + // enabled without further discussion. They are disabled for now. + // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 + "disabled_rules" to + "filename," + + "annotation,annotation-spacing," + + "argument-list-wrapping," + + "double-colon-spacing," + + "enum-entry-name-case," + + "multiline-if-else," + + "no-empty-first-line-in-method-block," + + "package-name," + + "trailing-comma," + + "spacing-around-angle-brackets," + + "spacing-between-declarations-with-annotations," + + "spacing-between-declarations-with-comments," + + "unary-op-spacing" + ) + ) + licenseHeaderFile(rootProject.file("spotless/copyright.kt")) + } + format("kts") { + target("**/*.kts") + targetExclude("**/build/**/*.kts") + // Look for the first line that doesn't have a block comment (assumed to be the license) + licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") + } + kotlinGradle { + target("*.gradle.kts") + ktlint() + } + } +} From 1eecdbaa74f3e5c66479c6632d31ecc899bf7dbd Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 11:46:22 -0700 Subject: [PATCH 04/11] Delete 5 init.gradle.kts scripts --- JetLagged/buildscripts/init.gradle.kts | 72 -------------------------- JetNews/buildscripts/init.gradle.kts | 72 -------------------------- Jetchat/buildscripts/init.gradle.kts | 72 -------------------------- Jetsnack/buildscripts/init.gradle.kts | 72 -------------------------- Reply/buildscripts/init.gradle.kts | 72 -------------------------- 5 files changed, 360 deletions(-) delete mode 100644 JetLagged/buildscripts/init.gradle.kts delete mode 100644 JetNews/buildscripts/init.gradle.kts delete mode 100644 Jetchat/buildscripts/init.gradle.kts delete mode 100644 Jetsnack/buildscripts/init.gradle.kts delete mode 100644 Reply/buildscripts/init.gradle.kts diff --git a/JetLagged/buildscripts/init.gradle.kts b/JetLagged/buildscripts/init.gradle.kts deleted file mode 100644 index 1b7a54264c..0000000000 --- a/JetLagged/buildscripts/init.gradle.kts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2022 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -val ktlintVersion = "0.46.1" - -initscript { - val spotlessVersion = "6.10.0" - - repositories { - mavenCentral() - } - - dependencies { - classpath("com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion") - } -} - -allprojects { - if (this == rootProject) { - return@allprojects - } - apply() - extensions.configure { - kotlin { - target("**/*.kt") - targetExclude("**/build/**/*.kt") - ktlint(ktlintVersion).editorConfigOverride( - mapOf( - "ktlint_code_style" to "android", - "ij_kotlin_allow_trailing_comma" to true, - // These rules were introduced in ktlint 0.46.0 and should not be - // enabled without further discussion. They are disabled for now. - // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 - "disabled_rules" to - "filename," + - "annotation,annotation-spacing," + - "argument-list-wrapping," + - "double-colon-spacing," + - "enum-entry-name-case," + - "multiline-if-else," + - "no-empty-first-line-in-method-block," + - "package-name," + - "trailing-comma," + - "spacing-around-angle-brackets," + - "spacing-between-declarations-with-annotations," + - "spacing-between-declarations-with-comments," + - "unary-op-spacing" - ) - ) - licenseHeaderFile(rootProject.file("spotless/copyright.kt")) - } - format("kts") { - target("**/*.kts") - targetExclude("**/build/**/*.kts") - // Look for the first line that doesn't have a block comment (assumed to be the license) - licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") - } - } -} \ No newline at end of file diff --git a/JetNews/buildscripts/init.gradle.kts b/JetNews/buildscripts/init.gradle.kts deleted file mode 100644 index 1b7a54264c..0000000000 --- a/JetNews/buildscripts/init.gradle.kts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2022 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -val ktlintVersion = "0.46.1" - -initscript { - val spotlessVersion = "6.10.0" - - repositories { - mavenCentral() - } - - dependencies { - classpath("com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion") - } -} - -allprojects { - if (this == rootProject) { - return@allprojects - } - apply() - extensions.configure { - kotlin { - target("**/*.kt") - targetExclude("**/build/**/*.kt") - ktlint(ktlintVersion).editorConfigOverride( - mapOf( - "ktlint_code_style" to "android", - "ij_kotlin_allow_trailing_comma" to true, - // These rules were introduced in ktlint 0.46.0 and should not be - // enabled without further discussion. They are disabled for now. - // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 - "disabled_rules" to - "filename," + - "annotation,annotation-spacing," + - "argument-list-wrapping," + - "double-colon-spacing," + - "enum-entry-name-case," + - "multiline-if-else," + - "no-empty-first-line-in-method-block," + - "package-name," + - "trailing-comma," + - "spacing-around-angle-brackets," + - "spacing-between-declarations-with-annotations," + - "spacing-between-declarations-with-comments," + - "unary-op-spacing" - ) - ) - licenseHeaderFile(rootProject.file("spotless/copyright.kt")) - } - format("kts") { - target("**/*.kts") - targetExclude("**/build/**/*.kts") - // Look for the first line that doesn't have a block comment (assumed to be the license) - licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") - } - } -} \ No newline at end of file diff --git a/Jetchat/buildscripts/init.gradle.kts b/Jetchat/buildscripts/init.gradle.kts deleted file mode 100644 index 1b7a54264c..0000000000 --- a/Jetchat/buildscripts/init.gradle.kts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2022 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -val ktlintVersion = "0.46.1" - -initscript { - val spotlessVersion = "6.10.0" - - repositories { - mavenCentral() - } - - dependencies { - classpath("com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion") - } -} - -allprojects { - if (this == rootProject) { - return@allprojects - } - apply() - extensions.configure { - kotlin { - target("**/*.kt") - targetExclude("**/build/**/*.kt") - ktlint(ktlintVersion).editorConfigOverride( - mapOf( - "ktlint_code_style" to "android", - "ij_kotlin_allow_trailing_comma" to true, - // These rules were introduced in ktlint 0.46.0 and should not be - // enabled without further discussion. They are disabled for now. - // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 - "disabled_rules" to - "filename," + - "annotation,annotation-spacing," + - "argument-list-wrapping," + - "double-colon-spacing," + - "enum-entry-name-case," + - "multiline-if-else," + - "no-empty-first-line-in-method-block," + - "package-name," + - "trailing-comma," + - "spacing-around-angle-brackets," + - "spacing-between-declarations-with-annotations," + - "spacing-between-declarations-with-comments," + - "unary-op-spacing" - ) - ) - licenseHeaderFile(rootProject.file("spotless/copyright.kt")) - } - format("kts") { - target("**/*.kts") - targetExclude("**/build/**/*.kts") - // Look for the first line that doesn't have a block comment (assumed to be the license) - licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") - } - } -} \ No newline at end of file diff --git a/Jetsnack/buildscripts/init.gradle.kts b/Jetsnack/buildscripts/init.gradle.kts deleted file mode 100644 index 1b7a54264c..0000000000 --- a/Jetsnack/buildscripts/init.gradle.kts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2022 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -val ktlintVersion = "0.46.1" - -initscript { - val spotlessVersion = "6.10.0" - - repositories { - mavenCentral() - } - - dependencies { - classpath("com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion") - } -} - -allprojects { - if (this == rootProject) { - return@allprojects - } - apply() - extensions.configure { - kotlin { - target("**/*.kt") - targetExclude("**/build/**/*.kt") - ktlint(ktlintVersion).editorConfigOverride( - mapOf( - "ktlint_code_style" to "android", - "ij_kotlin_allow_trailing_comma" to true, - // These rules were introduced in ktlint 0.46.0 and should not be - // enabled without further discussion. They are disabled for now. - // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 - "disabled_rules" to - "filename," + - "annotation,annotation-spacing," + - "argument-list-wrapping," + - "double-colon-spacing," + - "enum-entry-name-case," + - "multiline-if-else," + - "no-empty-first-line-in-method-block," + - "package-name," + - "trailing-comma," + - "spacing-around-angle-brackets," + - "spacing-between-declarations-with-annotations," + - "spacing-between-declarations-with-comments," + - "unary-op-spacing" - ) - ) - licenseHeaderFile(rootProject.file("spotless/copyright.kt")) - } - format("kts") { - target("**/*.kts") - targetExclude("**/build/**/*.kts") - // Look for the first line that doesn't have a block comment (assumed to be the license) - licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") - } - } -} \ No newline at end of file diff --git a/Reply/buildscripts/init.gradle.kts b/Reply/buildscripts/init.gradle.kts deleted file mode 100644 index 1b7a54264c..0000000000 --- a/Reply/buildscripts/init.gradle.kts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2022 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -val ktlintVersion = "0.46.1" - -initscript { - val spotlessVersion = "6.10.0" - - repositories { - mavenCentral() - } - - dependencies { - classpath("com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion") - } -} - -allprojects { - if (this == rootProject) { - return@allprojects - } - apply() - extensions.configure { - kotlin { - target("**/*.kt") - targetExclude("**/build/**/*.kt") - ktlint(ktlintVersion).editorConfigOverride( - mapOf( - "ktlint_code_style" to "android", - "ij_kotlin_allow_trailing_comma" to true, - // These rules were introduced in ktlint 0.46.0 and should not be - // enabled without further discussion. They are disabled for now. - // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 - "disabled_rules" to - "filename," + - "annotation,annotation-spacing," + - "argument-list-wrapping," + - "double-colon-spacing," + - "enum-entry-name-case," + - "multiline-if-else," + - "no-empty-first-line-in-method-block," + - "package-name," + - "trailing-comma," + - "spacing-around-angle-brackets," + - "spacing-between-declarations-with-annotations," + - "spacing-between-declarations-with-comments," + - "unary-op-spacing" - ) - ) - licenseHeaderFile(rootProject.file("spotless/copyright.kt")) - } - format("kts") { - target("**/*.kts") - targetExclude("**/build/**/*.kts") - // Look for the first line that doesn't have a block comment (assumed to be the license) - licenseHeaderFile(rootProject.file("spotless/copyright.kt"), "(^(?![\\/ ]\\*).*$)") - } - } -} \ No newline at end of file From 40d4d89a5092c161a3ba75daf8878a039a9ef5e5 Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 13:14:06 -0700 Subject: [PATCH 05/11] Jetcaster: Identify lints that will need to be fixed without ratchet --- Jetcaster/build.gradle.kts | 16 ++++ Jetcaster/core/data-testing/build.gradle.kts | 28 ++++++- Jetcaster/core/data/build.gradle.kts | 10 ++- Jetcaster/core/designsystem/build.gradle.kts | 74 ++++++++++--------- .../core/domain-testing/build.gradle.kts | 12 ++- Jetcaster/core/domain/build.gradle.kts | 12 ++- Jetcaster/glancewidget/build.gradle.kts | 10 ++- Jetcaster/mobile/build.gradle.kts | 33 ++++----- Jetcaster/tv/build.gradle.kts | 19 +++-- 9 files changed, 143 insertions(+), 71 deletions(-) diff --git a/Jetcaster/build.gradle.kts b/Jetcaster/build.gradle.kts index bcd5617e23..691013e6b9 100644 --- a/Jetcaster/build.gradle.kts +++ b/Jetcaster/build.gradle.kts @@ -60,6 +60,22 @@ subprojects { "unary-op-spacing" ) ) +// suppressLintsFor { +// step = "ktlint" +// shortCode = "standard:filename" +// } +// suppressLintsFor { +// step = "ktlint" +// shortCode = "standard:property-naming" +// } +// suppressLintsFor { +// step = "ktlint" +// shortCode = "standard:backing-property-naming" +// } +// suppressLintsFor { +// step = "ktlint" +// shortCode = "standard:package-name" +// } licenseHeaderFile(rootProject.file("spotless/copyright.kt")) } format("kts") { diff --git a/Jetcaster/core/data-testing/build.gradle.kts b/Jetcaster/core/data-testing/build.gradle.kts index a8644e1c1b..8d8143ef76 100644 --- a/Jetcaster/core/data-testing/build.gradle.kts +++ b/Jetcaster/core/data-testing/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2020 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) @@ -5,10 +21,16 @@ plugins { android { namespace = "com.example.jetcaster.core.data.testing" - compileSdk = libs.versions.compileSdk.get().toInt() + compileSdk = + libs.versions.compileSdk + .get() + .toInt() defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() + minSdk = + libs.versions.minSdk + .get() + .toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -19,7 +41,7 @@ android { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + "proguard-rules.pro", ) } } diff --git a/Jetcaster/core/data/build.gradle.kts b/Jetcaster/core/data/build.gradle.kts index bd81f036e7..4154d18c95 100644 --- a/Jetcaster/core/data/build.gradle.kts +++ b/Jetcaster/core/data/build.gradle.kts @@ -7,10 +7,16 @@ plugins { android { namespace = "com.example.jetcaster.core.data" - compileSdk = libs.versions.compileSdk.get().toInt() + compileSdk = + libs.versions.compileSdk + .get() + .toInt() defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() + minSdk = + libs.versions.minSdk + .get() + .toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/Jetcaster/core/designsystem/build.gradle.kts b/Jetcaster/core/designsystem/build.gradle.kts index 3e4ba24cb3..087f768aa1 100644 --- a/Jetcaster/core/designsystem/build.gradle.kts +++ b/Jetcaster/core/designsystem/build.gradle.kts @@ -1,51 +1,57 @@ plugins { - alias(libs.plugins.android.library) - alias(libs.plugins.kotlin.android) - alias(libs.plugins.compose) + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.compose) } // TODO(chris): Set up convention plugin android { - namespace = "com.example.jetcaster.core.designsystem" - compileSdk = libs.versions.compileSdk.get().toInt() + namespace = "com.example.jetcaster.core.designsystem" + compileSdk = + libs.versions.compileSdk + .get() + .toInt() - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - vectorDrawables.useSupportLibrary = true - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } + defaultConfig { + minSdk = + libs.versions.minSdk + .get() + .toInt() + vectorDrawables.useSupportLibrary = true + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } - buildTypes { - release { - isMinifyEnabled = false - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } } - } - buildFeatures { - compose = true - buildConfig = true - } + buildFeatures { + compose = true + buildConfig = true + } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } } kotlin { - jvmToolchain(17) + jvmToolchain(17) } dependencies { - val composeBom = platform(libs.androidx.compose.bom) - implementation(composeBom) - implementation(libs.androidx.compose.foundation) - implementation(libs.androidx.compose.material3) - implementation(libs.androidx.compose.ui.graphics) - implementation(libs.androidx.compose.ui.text) - implementation(libs.coil.kt.compose) + val composeBom = platform(libs.androidx.compose.bom) + implementation(composeBom) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.ui.graphics) + implementation(libs.androidx.compose.ui.text) + implementation(libs.coil.kt.compose) - implementation(libs.androidx.core.ktx) - implementation(libs.androidx.appcompat) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) } diff --git a/Jetcaster/core/domain-testing/build.gradle.kts b/Jetcaster/core/domain-testing/build.gradle.kts index 19d9964324..e80955a712 100644 --- a/Jetcaster/core/domain-testing/build.gradle.kts +++ b/Jetcaster/core/domain-testing/build.gradle.kts @@ -5,10 +5,16 @@ plugins { android { namespace = "com.example.jetcaster.core.domain.testing" - compileSdk = libs.versions.compileSdk.get().toInt() + compileSdk = + libs.versions.compileSdk + .get() + .toInt() defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() + minSdk = + libs.versions.minSdk + .get() + .toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -19,7 +25,7 @@ android { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + "proguard-rules.pro", ) } } diff --git a/Jetcaster/core/domain/build.gradle.kts b/Jetcaster/core/domain/build.gradle.kts index bca3291357..d654aee281 100644 --- a/Jetcaster/core/domain/build.gradle.kts +++ b/Jetcaster/core/domain/build.gradle.kts @@ -6,11 +6,17 @@ plugins { } android { - compileSdk = libs.versions.compileSdk.get().toInt() + compileSdk = + libs.versions.compileSdk + .get() + .toInt() namespace = "com.example.jetcaster.core.domain" defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() + minSdk = + libs.versions.minSdk + .get() + .toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -21,7 +27,7 @@ android { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + "proguard-rules.pro", ) } } diff --git a/Jetcaster/glancewidget/build.gradle.kts b/Jetcaster/glancewidget/build.gradle.kts index a29291be40..55e23f8e1c 100644 --- a/Jetcaster/glancewidget/build.gradle.kts +++ b/Jetcaster/glancewidget/build.gradle.kts @@ -6,10 +6,16 @@ plugins { android { namespace = "com.example.jetcaster.glancewidget" - compileSdk = libs.versions.compileSdk.get().toInt() + compileSdk = + libs.versions.compileSdk + .get() + .toInt() defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() + minSdk = + libs.versions.minSdk + .get() + .toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/Jetcaster/mobile/build.gradle.kts b/Jetcaster/mobile/build.gradle.kts index 044fc24423..a1b3914f30 100644 --- a/Jetcaster/mobile/build.gradle.kts +++ b/Jetcaster/mobile/build.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2020 The Android Open Source Project + * Copyright 2024 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. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -22,15 +22,23 @@ plugins { alias(libs.plugins.compose) } - android { - compileSdk = libs.versions.compileSdk.get().toInt() + compileSdk = + libs.versions.compileSdk + .get() + .toInt() namespace = "com.example.jetcaster" defaultConfig { applicationId = "com.example.jetcaster" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.targetSdk.get().toInt() + minSdk = + libs.versions.minSdk + .get() + .toInt() + targetSdk = + libs.versions.targetSdk + .get() + .toInt() versionCode = 1 versionName = "1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" @@ -52,7 +60,6 @@ android { buildTypes { getByName("debug") { - } getByName("release") { @@ -60,7 +67,7 @@ android { signingConfig = signingConfigs.getByName("release") proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + "proguard-rules.pro", ) } } @@ -95,19 +102,15 @@ dependencies { val composeBom = platform(libs.androidx.compose.bom) implementation(composeBom) androidTestImplementation(composeBom) - implementation(libs.kotlin.stdlib) implementation(libs.kotlinx.coroutines.android) implementation(libs.kotlinx.collections.immutable) - implementation(libs.androidx.core.ktx) implementation(libs.androidx.palette) - // Dependency injection implementation(libs.androidx.hilt.navigation.compose) implementation(libs.hilt.android) ksp(libs.hilt.compiler) - // Compose implementation(libs.androidx.activity.compose) implementation(libs.androidx.compose.foundation) @@ -119,24 +122,18 @@ dependencies { implementation(libs.androidx.compose.ui) implementation(libs.androidx.compose.ui.tooling.preview) debugImplementation(libs.androidx.compose.ui.tooling) - implementation(libs.androidx.lifecycle.runtime) implementation(libs.androidx.lifecycle.viewModelCompose) implementation(libs.androidx.lifecycle.runtime.compose) implementation(libs.androidx.navigation.compose) - implementation(libs.androidx.window) implementation(libs.androidx.window.core) - implementation(libs.accompanist.adaptive) - implementation(libs.coil.kt.compose) - implementation(projects.core.data) implementation(projects.core.designsystem) implementation(projects.core.domain) implementation(projects.glancewidget) implementation(projects.core.domainTesting) - coreLibraryDesugaring(libs.core.jdk.desugaring) } diff --git a/Jetcaster/tv/build.gradle.kts b/Jetcaster/tv/build.gradle.kts index 3ff7ae7b46..b0766d4d59 100644 --- a/Jetcaster/tv/build.gradle.kts +++ b/Jetcaster/tv/build.gradle.kts @@ -24,18 +24,26 @@ plugins { android { namespace = "com.example.jetcaster.tv" - compileSdk = libs.versions.compileSdk.get().toInt() + compileSdk = + libs.versions.compileSdk + .get() + .toInt() defaultConfig { applicationId = "com.example.jetcaster" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.targetSdk.get().toInt() + minSdk = + libs.versions.minSdk + .get() + .toInt() + targetSdk = + libs.versions.targetSdk + .get() + .toInt() versionCode = 1 versionName = "1.0" vectorDrawables { useSupportLibrary = true } - } signingConfigs { // Important: change the keystore for a production deployment @@ -57,7 +65,7 @@ android { signingConfig = signingConfigs.getByName("release") proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + "proguard-rules.pro", ) } } @@ -85,7 +93,6 @@ android { } } - dependencies { implementation(libs.androidx.core.ktx) implementation(libs.androidx.appcompat) From c572c929ef485522fdb457396f636f598c58b801 Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 13:16:53 -0700 Subject: [PATCH 06/11] Remove unused suppressions (will need to address when removing ratchet) --- Jetcaster/build.gradle.kts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Jetcaster/build.gradle.kts b/Jetcaster/build.gradle.kts index 691013e6b9..bcd5617e23 100644 --- a/Jetcaster/build.gradle.kts +++ b/Jetcaster/build.gradle.kts @@ -60,22 +60,6 @@ subprojects { "unary-op-spacing" ) ) -// suppressLintsFor { -// step = "ktlint" -// shortCode = "standard:filename" -// } -// suppressLintsFor { -// step = "ktlint" -// shortCode = "standard:property-naming" -// } -// suppressLintsFor { -// step = "ktlint" -// shortCode = "standard:backing-property-naming" -// } -// suppressLintsFor { -// step = "ktlint" -// shortCode = "standard:package-name" -// } licenseHeaderFile(rootProject.file("spotless/copyright.kt")) } format("kts") { From d4cd20935d87ee044655b1a85feab5da2bba982f Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 13:26:13 -0700 Subject: [PATCH 07/11] Undo spotlessApply for Jetcaster build files --- Jetcaster/core/data-testing/build.gradle.kts | 28 +------ Jetcaster/core/data/build.gradle.kts | 10 +-- Jetcaster/core/designsystem/build.gradle.kts | 74 +++++++++---------- .../core/domain-testing/build.gradle.kts | 12 +-- Jetcaster/core/domain/build.gradle.kts | 12 +-- Jetcaster/glancewidget/build.gradle.kts | 10 +-- Jetcaster/mobile/build.gradle.kts | 33 +++++---- Jetcaster/tv/build.gradle.kts | 19 ++--- 8 files changed, 71 insertions(+), 127 deletions(-) diff --git a/Jetcaster/core/data-testing/build.gradle.kts b/Jetcaster/core/data-testing/build.gradle.kts index 8d8143ef76..a8644e1c1b 100644 --- a/Jetcaster/core/data-testing/build.gradle.kts +++ b/Jetcaster/core/data-testing/build.gradle.kts @@ -1,19 +1,3 @@ -/* - * Copyright 2020 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. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) @@ -21,16 +5,10 @@ plugins { android { namespace = "com.example.jetcaster.core.data.testing" - compileSdk = - libs.versions.compileSdk - .get() - .toInt() + compileSdk = libs.versions.compileSdk.get().toInt() defaultConfig { - minSdk = - libs.versions.minSdk - .get() - .toInt() + minSdk = libs.versions.minSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -41,7 +19,7 @@ android { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", + "proguard-rules.pro" ) } } diff --git a/Jetcaster/core/data/build.gradle.kts b/Jetcaster/core/data/build.gradle.kts index 4154d18c95..bd81f036e7 100644 --- a/Jetcaster/core/data/build.gradle.kts +++ b/Jetcaster/core/data/build.gradle.kts @@ -7,16 +7,10 @@ plugins { android { namespace = "com.example.jetcaster.core.data" - compileSdk = - libs.versions.compileSdk - .get() - .toInt() + compileSdk = libs.versions.compileSdk.get().toInt() defaultConfig { - minSdk = - libs.versions.minSdk - .get() - .toInt() + minSdk = libs.versions.minSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/Jetcaster/core/designsystem/build.gradle.kts b/Jetcaster/core/designsystem/build.gradle.kts index 087f768aa1..3e4ba24cb3 100644 --- a/Jetcaster/core/designsystem/build.gradle.kts +++ b/Jetcaster/core/designsystem/build.gradle.kts @@ -1,57 +1,51 @@ plugins { - alias(libs.plugins.android.library) - alias(libs.plugins.kotlin.android) - alias(libs.plugins.compose) + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.compose) } // TODO(chris): Set up convention plugin android { - namespace = "com.example.jetcaster.core.designsystem" - compileSdk = - libs.versions.compileSdk - .get() - .toInt() + namespace = "com.example.jetcaster.core.designsystem" + compileSdk = libs.versions.compileSdk.get().toInt() - defaultConfig { - minSdk = - libs.versions.minSdk - .get() - .toInt() - vectorDrawables.useSupportLibrary = true - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } + defaultConfig { + minSdk = libs.versions.minSdk.get().toInt() + vectorDrawables.useSupportLibrary = true + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } - buildTypes { - release { - isMinifyEnabled = false - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") - } + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } + } - buildFeatures { - compose = true - buildConfig = true - } + buildFeatures { + compose = true + buildConfig = true + } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } } kotlin { - jvmToolchain(17) + jvmToolchain(17) } dependencies { - val composeBom = platform(libs.androidx.compose.bom) - implementation(composeBom) - implementation(libs.androidx.compose.foundation) - implementation(libs.androidx.compose.material3) - implementation(libs.androidx.compose.ui.graphics) - implementation(libs.androidx.compose.ui.text) - implementation(libs.coil.kt.compose) + val composeBom = platform(libs.androidx.compose.bom) + implementation(composeBom) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.ui.graphics) + implementation(libs.androidx.compose.ui.text) + implementation(libs.coil.kt.compose) - implementation(libs.androidx.core.ktx) - implementation(libs.androidx.appcompat) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) } diff --git a/Jetcaster/core/domain-testing/build.gradle.kts b/Jetcaster/core/domain-testing/build.gradle.kts index e80955a712..19d9964324 100644 --- a/Jetcaster/core/domain-testing/build.gradle.kts +++ b/Jetcaster/core/domain-testing/build.gradle.kts @@ -5,16 +5,10 @@ plugins { android { namespace = "com.example.jetcaster.core.domain.testing" - compileSdk = - libs.versions.compileSdk - .get() - .toInt() + compileSdk = libs.versions.compileSdk.get().toInt() defaultConfig { - minSdk = - libs.versions.minSdk - .get() - .toInt() + minSdk = libs.versions.minSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -25,7 +19,7 @@ android { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", + "proguard-rules.pro" ) } } diff --git a/Jetcaster/core/domain/build.gradle.kts b/Jetcaster/core/domain/build.gradle.kts index d654aee281..bca3291357 100644 --- a/Jetcaster/core/domain/build.gradle.kts +++ b/Jetcaster/core/domain/build.gradle.kts @@ -6,17 +6,11 @@ plugins { } android { - compileSdk = - libs.versions.compileSdk - .get() - .toInt() + compileSdk = libs.versions.compileSdk.get().toInt() namespace = "com.example.jetcaster.core.domain" defaultConfig { - minSdk = - libs.versions.minSdk - .get() - .toInt() + minSdk = libs.versions.minSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -27,7 +21,7 @@ android { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", + "proguard-rules.pro" ) } } diff --git a/Jetcaster/glancewidget/build.gradle.kts b/Jetcaster/glancewidget/build.gradle.kts index 55e23f8e1c..a29291be40 100644 --- a/Jetcaster/glancewidget/build.gradle.kts +++ b/Jetcaster/glancewidget/build.gradle.kts @@ -6,16 +6,10 @@ plugins { android { namespace = "com.example.jetcaster.glancewidget" - compileSdk = - libs.versions.compileSdk - .get() - .toInt() + compileSdk = libs.versions.compileSdk.get().toInt() defaultConfig { - minSdk = - libs.versions.minSdk - .get() - .toInt() + minSdk = libs.versions.minSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/Jetcaster/mobile/build.gradle.kts b/Jetcaster/mobile/build.gradle.kts index a1b3914f30..044fc24423 100644 --- a/Jetcaster/mobile/build.gradle.kts +++ b/Jetcaster/mobile/build.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2024 The Android Open Source Project + * Copyright 2020 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. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -22,23 +22,15 @@ plugins { alias(libs.plugins.compose) } + android { - compileSdk = - libs.versions.compileSdk - .get() - .toInt() + compileSdk = libs.versions.compileSdk.get().toInt() namespace = "com.example.jetcaster" defaultConfig { applicationId = "com.example.jetcaster" - minSdk = - libs.versions.minSdk - .get() - .toInt() - targetSdk = - libs.versions.targetSdk - .get() - .toInt() + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() versionCode = 1 versionName = "1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" @@ -60,6 +52,7 @@ android { buildTypes { getByName("debug") { + } getByName("release") { @@ -67,7 +60,7 @@ android { signingConfig = signingConfigs.getByName("release") proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", + "proguard-rules.pro" ) } } @@ -102,15 +95,19 @@ dependencies { val composeBom = platform(libs.androidx.compose.bom) implementation(composeBom) androidTestImplementation(composeBom) + implementation(libs.kotlin.stdlib) implementation(libs.kotlinx.coroutines.android) implementation(libs.kotlinx.collections.immutable) + implementation(libs.androidx.core.ktx) implementation(libs.androidx.palette) + // Dependency injection implementation(libs.androidx.hilt.navigation.compose) implementation(libs.hilt.android) ksp(libs.hilt.compiler) + // Compose implementation(libs.androidx.activity.compose) implementation(libs.androidx.compose.foundation) @@ -122,18 +119,24 @@ dependencies { implementation(libs.androidx.compose.ui) implementation(libs.androidx.compose.ui.tooling.preview) debugImplementation(libs.androidx.compose.ui.tooling) + implementation(libs.androidx.lifecycle.runtime) implementation(libs.androidx.lifecycle.viewModelCompose) implementation(libs.androidx.lifecycle.runtime.compose) implementation(libs.androidx.navigation.compose) + implementation(libs.androidx.window) implementation(libs.androidx.window.core) + implementation(libs.accompanist.adaptive) + implementation(libs.coil.kt.compose) + implementation(projects.core.data) implementation(projects.core.designsystem) implementation(projects.core.domain) implementation(projects.glancewidget) implementation(projects.core.domainTesting) + coreLibraryDesugaring(libs.core.jdk.desugaring) } diff --git a/Jetcaster/tv/build.gradle.kts b/Jetcaster/tv/build.gradle.kts index b0766d4d59..3ff7ae7b46 100644 --- a/Jetcaster/tv/build.gradle.kts +++ b/Jetcaster/tv/build.gradle.kts @@ -24,26 +24,18 @@ plugins { android { namespace = "com.example.jetcaster.tv" - compileSdk = - libs.versions.compileSdk - .get() - .toInt() + compileSdk = libs.versions.compileSdk.get().toInt() defaultConfig { applicationId = "com.example.jetcaster" - minSdk = - libs.versions.minSdk - .get() - .toInt() - targetSdk = - libs.versions.targetSdk - .get() - .toInt() + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() versionCode = 1 versionName = "1.0" vectorDrawables { useSupportLibrary = true } + } signingConfigs { // Important: change the keystore for a production deployment @@ -65,7 +57,7 @@ android { signingConfig = signingConfigs.getByName("release") proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", + "proguard-rules.pro" ) } } @@ -93,6 +85,7 @@ android { } } + dependencies { implementation(libs.androidx.core.ktx) implementation(libs.androidx.appcompat) From 75ad3bc76355b1f9c7319b2d0e824232859a318b Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 14:02:46 -0700 Subject: [PATCH 08/11] Ratchet from a specific commit instead of origin/main GitHub Actions cannot references origin/main ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" --- JetLagged/build.gradle.kts | 2 +- JetNews/build.gradle.kts | 2 +- Jetcaster/build.gradle.kts | 2 +- Jetchat/build.gradle.kts | 2 +- Jetsnack/build.gradle.kts | 2 +- Reply/build.gradle.kts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/JetLagged/build.gradle.kts b/JetLagged/build.gradle.kts index 2b3f56e8a2..785ad6f1f1 100644 --- a/JetLagged/build.gradle.kts +++ b/JetLagged/build.gradle.kts @@ -29,7 +29,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "origin/main" + ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") diff --git a/JetNews/build.gradle.kts b/JetNews/build.gradle.kts index 30355ffe44..431ee13845 100644 --- a/JetNews/build.gradle.kts +++ b/JetNews/build.gradle.kts @@ -29,7 +29,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "origin/main" + ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") diff --git a/Jetcaster/build.gradle.kts b/Jetcaster/build.gradle.kts index bcd5617e23..72c065c14d 100644 --- a/Jetcaster/build.gradle.kts +++ b/Jetcaster/build.gradle.kts @@ -32,7 +32,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "origin/main" + ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") diff --git a/Jetchat/build.gradle.kts b/Jetchat/build.gradle.kts index 30355ffe44..431ee13845 100644 --- a/Jetchat/build.gradle.kts +++ b/Jetchat/build.gradle.kts @@ -29,7 +29,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "origin/main" + ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") diff --git a/Jetsnack/build.gradle.kts b/Jetsnack/build.gradle.kts index 30355ffe44..431ee13845 100644 --- a/Jetsnack/build.gradle.kts +++ b/Jetsnack/build.gradle.kts @@ -29,7 +29,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "origin/main" + ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") diff --git a/Reply/build.gradle.kts b/Reply/build.gradle.kts index 2b3f56e8a2..785ad6f1f1 100644 --- a/Reply/build.gradle.kts +++ b/Reply/build.gradle.kts @@ -29,7 +29,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "origin/main" + ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") From cd9b61312dcd66dea95a676e810573d21f2b1539 Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 14:09:50 -0700 Subject: [PATCH 09/11] Checkout full history for spotless The spotless action requires enough git history to correctly determine which files have been modified. This commit configures the checkout action to fetch the full history by setting `fetch-depth: 0`. If we remove usage of ratchetFrom we should be able to remove this. --- .github/workflows/build-sample.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-sample.yml b/.github/workflows/build-sample.yml index b06f5465e4..4c306c0023 100644 --- a/.github/workflows/build-sample.yml +++ b/.github/workflows/build-sample.yml @@ -36,6 +36,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + # https://github.com/diffplug/spotless/issues/710 + fetch-depth: 0 - name: Copy CI gradle.properties run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties From d93f22844f995635c11d3d3257e1750824587e53 Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 14:11:14 -0700 Subject: [PATCH 10/11] Revert "Ratchet from a specific commit instead of origin/main" This reverts commit 75ad3bc76355b1f9c7319b2d0e824232859a318b. --- JetLagged/build.gradle.kts | 2 +- JetNews/build.gradle.kts | 2 +- Jetcaster/build.gradle.kts | 2 +- Jetchat/build.gradle.kts | 2 +- Jetsnack/build.gradle.kts | 2 +- Reply/build.gradle.kts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/JetLagged/build.gradle.kts b/JetLagged/build.gradle.kts index 785ad6f1f1..2b3f56e8a2 100644 --- a/JetLagged/build.gradle.kts +++ b/JetLagged/build.gradle.kts @@ -29,7 +29,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" + ratchetFrom = "origin/main" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") diff --git a/JetNews/build.gradle.kts b/JetNews/build.gradle.kts index 431ee13845..30355ffe44 100644 --- a/JetNews/build.gradle.kts +++ b/JetNews/build.gradle.kts @@ -29,7 +29,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" + ratchetFrom = "origin/main" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") diff --git a/Jetcaster/build.gradle.kts b/Jetcaster/build.gradle.kts index 72c065c14d..bcd5617e23 100644 --- a/Jetcaster/build.gradle.kts +++ b/Jetcaster/build.gradle.kts @@ -32,7 +32,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" + ratchetFrom = "origin/main" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") diff --git a/Jetchat/build.gradle.kts b/Jetchat/build.gradle.kts index 431ee13845..30355ffe44 100644 --- a/Jetchat/build.gradle.kts +++ b/Jetchat/build.gradle.kts @@ -29,7 +29,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" + ratchetFrom = "origin/main" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") diff --git a/Jetsnack/build.gradle.kts b/Jetsnack/build.gradle.kts index 431ee13845..30355ffe44 100644 --- a/Jetsnack/build.gradle.kts +++ b/Jetsnack/build.gradle.kts @@ -29,7 +29,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" + ratchetFrom = "origin/main" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") diff --git a/Reply/build.gradle.kts b/Reply/build.gradle.kts index 785ad6f1f1..2b3f56e8a2 100644 --- a/Reply/build.gradle.kts +++ b/Reply/build.gradle.kts @@ -29,7 +29,7 @@ apply("${project.rootDir}/buildscripts/toml-updater-config.gradle") subprojects { apply(plugin = "com.diffplug.spotless") configure { - ratchetFrom = "57913c513a17c39a93d9a5bab4284fbf9c85dc98" + ratchetFrom = "origin/main" kotlin { target("**/*.kt") targetExclude("**/build/**/*.kt") From 59f2ba2fd5aef3ba8e78c1de7e0ba7868c17240f Mon Sep 17 00:00:00 2001 From: cartland Date: Thu, 10 Apr 2025 14:17:40 -0700 Subject: [PATCH 11/11] Add comment to explain fetch-depth 0 for ratchetFrom --- .github/workflows/build-sample.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-sample.yml b/.github/workflows/build-sample.yml index 4c306c0023..4d0de3cb44 100644 --- a/.github/workflows/build-sample.yml +++ b/.github/workflows/build-sample.yml @@ -38,6 +38,7 @@ jobs: uses: actions/checkout@v4 with: # https://github.com/diffplug/spotless/issues/710 + # Check out full history for Spotless to ensure ratchetFrom can find the ratchet version fetch-depth: 0 - name: Copy CI gradle.properties