610fcd7e0c
Deprecated APIs in Quartz are kept for library consumers but internal usages now carry @Suppress annotations so the module builds warning-free. Also replaces redundant .toInt() on hex Int literals in ChaCha20Core and migrates deprecated java.net.URL to URI.resolve() in ServerInfoParser. The spotless license header delimiter is updated to recognize @file: annotations. https://claude.ai/code/session_01EwS56YAGGnnac5EuwhaUSs
80 lines
2.3 KiB
Groovy
80 lines
2.3 KiB
Groovy
plugins {
|
|
alias(libs.plugins.androidApplication) apply false
|
|
alias(libs.plugins.androidLibrary) apply false
|
|
alias(libs.plugins.jetbrainsKotlinJvm) apply false
|
|
alias(libs.plugins.androidBenchmark) apply false
|
|
alias(libs.plugins.diffplugSpotless)
|
|
alias(libs.plugins.googleServices) apply false
|
|
alias(libs.plugins.jetbrainsComposeCompiler) apply false
|
|
alias(libs.plugins.composeMultiplatform) apply false
|
|
alias(libs.plugins.kotlinMultiplatform) apply false
|
|
alias(libs.plugins.androidKotlinMultiplatformLibrary) apply false
|
|
alias(libs.plugins.serialization)
|
|
}
|
|
|
|
allprojects {
|
|
configurations.configureEach {
|
|
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
|
}
|
|
|
|
apply plugin: 'com.diffplug.spotless'
|
|
|
|
if (project === rootProject) {
|
|
spotless {
|
|
predeclareDeps()
|
|
}
|
|
spotlessPredeclare {
|
|
kotlin {
|
|
ktlint()
|
|
}
|
|
}
|
|
} else {
|
|
spotless {
|
|
kotlin {
|
|
target 'src/**/*.kt'
|
|
|
|
ktlint()
|
|
licenseHeaderFile rootProject.file('.spotless/copyright.kt'), "@file:|package|import|class|object|sealed|open|interface|abstract "
|
|
}
|
|
|
|
groovyGradle {
|
|
target '*.gradle'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
afterEvaluate {
|
|
try {
|
|
tasks.named("preBuild") {
|
|
dependsOn("spotlessApply")
|
|
}
|
|
} catch (UnknownTaskException ignored) {
|
|
tasks.matching {
|
|
it.name.startsWith("pre") && it.name.endsWith("Build")
|
|
}.configureEach {
|
|
dependsOn("spotlessApply")
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
tasks.register('installGitHook', Copy) {
|
|
def dotGit = new File(rootProject.rootDir, '.git')
|
|
def hooksDir
|
|
if (dotGit.isFile()) {
|
|
// Git worktree: .git is a file with "gitdir: <path>"
|
|
def gitDir = new File(dotGit.text.trim().replace('gitdir: ', ''))
|
|
hooksDir = new File(gitDir, 'hooks')
|
|
} else {
|
|
hooksDir = new File(dotGit, 'hooks')
|
|
}
|
|
from new File(rootProject.rootDir, '.git-hooks/pre-commit')
|
|
from new File(rootProject.rootDir, '.git-hooks/pre-push')
|
|
into { hooksDir }
|
|
filePermissions { unix(0777) }
|
|
}
|
|
tasks.getByPath(':amethyst:preBuild').dependsOn installGitHook
|