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