mirror of
https://github.com/JakeWharton/mosaic.git
synced 2025-10-30 18:26:59 +08:00
82 lines
2.2 KiB
Groovy
82 lines
2.2 KiB
Groovy
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
|
|
|
|
buildscript {
|
|
dependencies {
|
|
classpath libs.kotlin.plugin.core
|
|
classpath libs.kotlin.plugin.compose
|
|
classpath libs.maven.publish.gradlePlugin
|
|
classpath libs.dokka.gradlePlugin
|
|
classpath libs.cite.gradlePlugin
|
|
classpath libs.poko.gradlePlugin
|
|
classpath libs.spotless.gradlePlugin
|
|
classpath libs.binary.compatibility.validator.gradlePlugin
|
|
classpath libs.cklib.gradlePlugin
|
|
classpath libs.jextract.gradlePlugin
|
|
classpath 'com.jakewharton.mosaic.build:gradle-plugin'
|
|
}
|
|
repositories {
|
|
mavenCentral()
|
|
google()
|
|
gradlePluginPortal()
|
|
}
|
|
}
|
|
|
|
apply plugin: 'org.jetbrains.dokka'
|
|
|
|
allprojects {
|
|
group = GROUP
|
|
version = VERSION_NAME
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
google()
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
|
|
tasks.withType(KotlinJvmCompile).configureEach {
|
|
compilerOptions.jvmTarget = JvmTarget.JVM_11
|
|
compilerOptions.freeCompilerArgs.add('-Xjvm-default=all')
|
|
}
|
|
|
|
tasks.withType(KotlinNativeCompile).configureEach {
|
|
compilerOptions.freeCompilerArgs.add('-Xpartial-linkage=disable')
|
|
}
|
|
|
|
tasks.withType(AbstractTestTask).configureEach {
|
|
testLogging {
|
|
if (System.getenv('CI') == 'true') {
|
|
events = ['started', 'failed', 'skipped', 'passed']
|
|
showStandardStreams = true
|
|
}
|
|
exceptionFormat 'full'
|
|
}
|
|
}
|
|
|
|
apply plugin: 'com.diffplug.spotless'
|
|
spotless {
|
|
kotlin {
|
|
target('src/**/*.kt')
|
|
ktlint(libs.ktlint.core.get().version)
|
|
.editorConfigOverride([
|
|
'ktlint_standard_filename': 'disabled',
|
|
// Making something an expression body should be a choice around readability.
|
|
'ktlint_standard_function-expression-body': 'disabled',
|
|
'ktlint_standard_property-naming': 'disabled',
|
|
'ktlint_function_naming_ignore_when_annotated_with': 'Composable',
|
|
'ktlint_compose_modifier-missing-check': 'disabled',
|
|
'ktlint_compose_compositionlocal-allowlist': 'disabled',
|
|
'compose_treat_as_lambda': 'MeasurePolicy'
|
|
])
|
|
.customRuleSets([
|
|
libs.ktlint.composeRules.get().toString(),
|
|
])
|
|
}
|
|
}
|
|
}
|