Merge pull request #313 from MaximillianLeonov/replace-allprojects-with-subprojects

Replace allprojects block with subprojects block
pull/337/head
Adetunji Dahunsi 2 years ago committed by GitHub
commit 4a8f8727af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,29 +28,28 @@ initscript {
} }
} }
allprojects { rootProject {
if (this == rootProject) { subprojects {
return@allprojects apply<com.diffplug.gradle.spotless.SpotlessPlugin>()
} extensions.configure<com.diffplug.gradle.spotless.SpotlessExtension> {
apply<com.diffplug.gradle.spotless.SpotlessPlugin>() kotlin {
extensions.configure<com.diffplug.gradle.spotless.SpotlessExtension> { target("**/*.kt")
kotlin { targetExclude("**/build/**/*.kt")
target("**/*.kt") ktlint(ktlintVersion).userData(mapOf("android" to "true"))
targetExclude("**/build/**/*.kt") licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
ktlint(ktlintVersion).userData(mapOf("android" to "true")) }
licenseHeaderFile(rootProject.file("spotless/copyright.kt")) format("kts") {
} target("**/*.kts")
format("kts") { targetExclude("**/build/**/*.kts")
target("**/*.kts") // Look for the first line that doesn't have a block comment (assumed to be the license)
targetExclude("**/build/**/*.kts") licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
// Look for the first line that doesn't have a block comment (assumed to be the license) }
licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)") format("xml") {
} target("**/*.xml")
format("xml") { targetExclude("**/build/**/*.xml")
target("**/*.xml") // Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml)
targetExclude("**/build/**/*.xml") licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])")
// Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml) }
licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])")
} }
} }
} }

Loading…
Cancel
Save