Skip to content

Commit

Permalink
Upgrade spotless and fix #1213
Browse files Browse the repository at this point in the history
Move spotless configuration to top-level
diffplug/spotless#1213

Change-Id: I689a76f7e297709132841574249dd0b8243f30f9
  • Loading branch information
Nodroid7 committed Feb 1, 2023
1 parent 1b3aecc commit 7ca5614
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,31 @@ buildscript {
}

plugins {
// v6.6.1 and above currently results in https://github.com/diffplug/spotless/issues/1213
id "com.diffplug.spotless" version "6.6.0"
id "com.diffplug.spotless" version "6.13.0"
id "com.github.ben-manes.versions" version "0.44.0"
id "nl.littlerobots.version-catalog-update" version "0.7.0"
}

apply plugin: 'com.dropbox.affectedmoduledetector'

spotless {
predeclareDeps()
}

spotlessPredeclare {
kotlin {
target "**/*.kt"
ktlint(libs.versions.ktlint.get())
licenseHeaderFile rootProject.file('spotless/copyright.txt')
}
groovyGradle {
target '**/*.gradle'
greclipse().configFile(rootProject.file('spotless/greclipse.properties'))
licenseHeaderFile rootProject.file('spotless/copyright.txt'),
'(buildscript|apply|import|plugins)'
}
}

versionCatalogUpdate {
sortByKey = true
keep {
Expand Down Expand Up @@ -81,22 +98,6 @@ allprojects {
}

subprojects {
apply plugin: 'com.diffplug.spotless'
spotless {
kotlin {
target "**/*.kt"
ktlint(libs.versions.ktlint.get())
licenseHeaderFile rootProject.file('spotless/copyright.txt')
}

groovyGradle {
target '**/*.gradle'
greclipse().configFile(rootProject.file('spotless/greclipse.properties'))
licenseHeaderFile rootProject.file('spotless/copyright.txt'),
'(buildscript|apply|import|plugins)'
}
}

// Remove all test apps after running UI tests.
// This is specially important in CI so that test emulators don't run out of space.
tasks.whenTaskAdded { task ->
Expand Down

0 comments on commit 7ca5614

Please sign in to comment.