Skip to content

Commit cdc1904

Browse files
committed
Indentation set to 4
1 parent a949c11 commit cdc1904

File tree

57 files changed

+1511
-1510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1511
-1510
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
root = true
22

33
[*.{kt,kts}]
4-
indent_size = 2
4+
indent_size = 4
55
ignored_rules = no-wildstar-imports
66
insert_final_newline = true

build-conventions/build.gradle.kts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

33
plugins {
4-
`kotlin-dsl`
4+
`kotlin-dsl`
55
}
66

77
repositories {
8-
gradlePluginPortal()
9-
mavenCentral()
10-
google()
11-
if (findProperty("project.enableSnapshots") == "true") {
12-
maven("https://oss.sonatype.org/content/repositories/snapshots")
13-
}
8+
gradlePluginPortal()
9+
mavenCentral()
10+
google()
11+
if (findProperty("project.enableSnapshots") == "true") {
12+
maven("https://oss.sonatype.org/content/repositories/snapshots")
13+
}
1414
}
1515

1616
dependencies {
17-
implementation("com.android.tools.build:gradle:_")
18-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:_")
19-
implementation("com.github.jakemarsden:git-hooks-gradle-plugin:_")
20-
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:_")
21-
implementation("io.github.gradle-nexus:publish-plugin:_")
22-
implementation("org.jetbrains.dokka:dokka-gradle-plugin:_")
23-
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:_")
17+
implementation("com.android.tools.build:gradle:_")
18+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:_")
19+
implementation("com.github.jakemarsden:git-hooks-gradle-plugin:_")
20+
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:_")
21+
implementation("io.github.gradle-nexus:publish-plugin:_")
22+
implementation("org.jetbrains.dokka:dokka-gradle-plugin:_")
23+
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:_")
2424
}
2525

2626
tasks {
27-
withType<KotlinCompile> {
28-
kotlinOptions {
29-
languageVersion = "1.4" // 1.9 since gradle 8
27+
withType<KotlinCompile> {
28+
kotlinOptions {
29+
languageVersion = "1.4" // 1.9 since gradle 8
30+
}
3031
}
31-
}
3232
}
3333

3434
gradleEnterprise {
35-
buildScan {
36-
termsOfServiceUrl = "https://gradle.com/terms-of-service"
37-
termsOfServiceAgree = "yes"
38-
}
35+
buildScan {
36+
termsOfServiceUrl = "https://gradle.com/terms-of-service"
37+
termsOfServiceAgree = "yes"
38+
}
3939
}

build-conventions/settings.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
plugins {
2-
id("de.fayard.refreshVersions") version "0.51.0"
3-
id("com.gradle.enterprise") version "3.12.2"
2+
id("de.fayard.refreshVersions") version "0.51.0"
3+
id("com.gradle.enterprise") version "3.12.2"
44
}
55

66
refreshVersions {
7-
versionsPropertiesFile = rootDir.resolve("gradle/versions.properties")
8-
extraArtifactVersionKeyRules(rootDir.resolve("gradle/versions.rules"))
7+
versionsPropertiesFile = rootDir.resolve("gradle/versions.properties")
8+
extraArtifactVersionKeyRules(rootDir.resolve("gradle/versions.rules"))
99
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
plugins {
2-
id("kotlinx-atomicfu")
2+
id("kotlinx-atomicfu")
33
}
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
import org.jetbrains.kotlin.konan.target.HostManager
22

33
plugins {
4-
id("convention.local-properties")
5-
id("convention.detekt")
6-
idea
4+
id("convention.local-properties")
5+
id("convention.detekt")
6+
idea
77
}
88

99
repositories {
10-
mavenCentral()
11-
google()
12-
gradlePluginPortal()
13-
if (findProperty("project.enableSnapshots") == "true") {
14-
maven("https://oss.sonatype.org/content/repositories/snapshots")
15-
}
10+
mavenCentral()
11+
google()
12+
gradlePluginPortal()
13+
if (findProperty("project.enableSnapshots") == "true") {
14+
maven("https://oss.sonatype.org/content/repositories/snapshots")
15+
}
1616
}
1717

1818
printlnCI(
19-
"""
19+
"""
2020
CI: $CI
2121
SANDBOX: $SANDBOX
2222
isMainHost: $isMainHost
2323
---
2424
hostIsLinux: ${HostManager.hostIsLinux}
2525
hostIsMac: ${HostManager.hostIsMac}
2626
hostIsMingw: ${HostManager.hostIsMingw}
27-
""".trimIndent()
27+
""".trimIndent()
2828
)
2929

3030
idea {
31-
module {
32-
isDownloadSources = true
33-
isDownloadJavadoc = true
34-
}
31+
module {
32+
isDownloadSources = true
33+
isDownloadJavadoc = true
34+
}
3535
}
3636

3737
afterEvaluate {
38-
tasks {
39-
if (findByName("compile") == null) {
40-
register("compile") {
41-
dependsOn(withType(AbstractCompile::class))
42-
group = "build"
43-
}
44-
}
45-
if (findByName("allTests") == null) {
46-
register("allTests") {
47-
dependsOn(withType(AbstractTestTask::class))
48-
group = "verification"
49-
}
38+
tasks {
39+
if (findByName("compile") == null) {
40+
register("compile") {
41+
dependsOn(withType(AbstractCompile::class))
42+
group = "build"
43+
}
44+
}
45+
if (findByName("allTests") == null) {
46+
register("allTests") {
47+
dependsOn(withType(AbstractTestTask::class))
48+
group = "verification"
49+
}
50+
}
5051
}
51-
}
5252
}

build-conventions/src/main/kotlin/convention.control.gradle.kts

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,63 +8,63 @@ import org.jetbrains.kotlin.konan.target.HostManager
88
import util.buildHost
99

1010
plugins {
11-
id("convention.common")
11+
id("convention.common")
1212
}
1313

1414
pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
15-
extensions.getByType(KotlinMultiplatformExtension::class.java).targets.let(::control)
15+
extensions.getByType(KotlinMultiplatformExtension::class.java).targets.let(::control)
1616
}
1717
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
18-
objects.namedDomainObjectList(KotlinTarget::class.java).apply {
19-
add(extensions.getByType(KotlinJvmProjectExtension::class.java).target)
20-
}.let(::control)
18+
objects.namedDomainObjectList(KotlinTarget::class.java).apply {
19+
add(extensions.getByType(KotlinJvmProjectExtension::class.java).target)
20+
}.let(::control)
2121
}
2222
pluginManager.withPlugin("org.jetbrains.kotlin.js") {
23-
objects.namedDomainObjectList(KotlinTarget::class.java).apply {
24-
add(extensions.getByType(KotlinJsProjectExtension::class.java).js())
25-
}.let(::control)
23+
objects.namedDomainObjectList(KotlinTarget::class.java).apply {
24+
add(extensions.getByType(KotlinJsProjectExtension::class.java).js())
25+
}.let(::control)
2626
}
2727

2828
fun control(targets: NamedDomainObjectCollection<KotlinTarget>) {
29-
fun NamedDomainObjectCollection<out KotlinTarget>.onlyBuildIf(enabled: Spec<in Task>) {
30-
all {
31-
if (this is KotlinNativeTarget) {
32-
binaries.all {
33-
linkTask.onlyIf(enabled)
29+
fun NamedDomainObjectCollection<out KotlinTarget>.onlyBuildIf(enabled: Spec<in Task>) {
30+
all {
31+
if (this is KotlinNativeTarget) {
32+
binaries.all {
33+
linkTask.onlyIf(enabled)
34+
}
35+
}
36+
compilations.all {
37+
compileTaskProvider {
38+
onlyIf(enabled)
39+
}
40+
}
3441
}
35-
}
36-
compilations.all {
37-
compileTaskProvider {
38-
onlyIf(enabled)
39-
}
40-
}
4142
}
42-
}
4343

44-
val nativeTargets = targets.withType<KotlinNativeTarget>()
45-
val windowsHostTargets = nativeTargets.matching { it.konanTarget.buildHost == Family.MINGW }
46-
val linuxHostTargets = nativeTargets.matching { it.konanTarget.buildHost == Family.LINUX }
47-
val osxHostTargets = nativeTargets.matching { it.konanTarget.buildHost == Family.OSX }
48-
val mainHostTargets = targets.matching { it !in nativeTargets }
49-
val mainEnabled = !CI || isMainHost
50-
linuxHostTargets.onlyBuildIf {
51-
val enabled = mainEnabled || HostManager.hostIsLinux
52-
printlnCI("[${it.name}] ${!CI} || $SANDBOX || ${HostManager.hostIsLinux} = $enabled")
53-
enabled
54-
}
55-
osxHostTargets.onlyBuildIf {
56-
val enabled = mainEnabled || HostManager.hostIsMac
57-
printlnCI("[${it.name}] ${!CI} || $SANDBOX || ${HostManager.hostIsMac} = $enabled")
58-
enabled
59-
}
60-
windowsHostTargets.onlyBuildIf {
61-
val enabled = mainEnabled || HostManager.hostIsMingw
62-
printlnCI("[${it.name}] ${!CI} || $SANDBOX || ${HostManager.hostIsMingw} = $enabled")
63-
enabled
64-
}
65-
mainHostTargets.onlyBuildIf {
66-
val enabled = mainEnabled || SANDBOX
67-
printlnCI("[${it.name}] ${!CI} || $SANDBOX || $isMainHost = $enabled")
68-
mainEnabled
69-
}
44+
val nativeTargets = targets.withType<KotlinNativeTarget>()
45+
val windowsHostTargets = nativeTargets.matching { it.konanTarget.buildHost == Family.MINGW }
46+
val linuxHostTargets = nativeTargets.matching { it.konanTarget.buildHost == Family.LINUX }
47+
val osxHostTargets = nativeTargets.matching { it.konanTarget.buildHost == Family.OSX }
48+
val mainHostTargets = targets.matching { it !in nativeTargets }
49+
val mainEnabled = !CI || isMainHost
50+
linuxHostTargets.onlyBuildIf {
51+
val enabled = mainEnabled || HostManager.hostIsLinux
52+
printlnCI("[${it.name}] ${!CI} || $SANDBOX || ${HostManager.hostIsLinux} = $enabled")
53+
enabled
54+
}
55+
osxHostTargets.onlyBuildIf {
56+
val enabled = mainEnabled || HostManager.hostIsMac
57+
printlnCI("[${it.name}] ${!CI} || $SANDBOX || ${HostManager.hostIsMac} = $enabled")
58+
enabled
59+
}
60+
windowsHostTargets.onlyBuildIf {
61+
val enabled = mainEnabled || HostManager.hostIsMingw
62+
printlnCI("[${it.name}] ${!CI} || $SANDBOX || ${HostManager.hostIsMingw} = $enabled")
63+
enabled
64+
}
65+
mainHostTargets.onlyBuildIf {
66+
val enabled = mainEnabled || SANDBOX
67+
printlnCI("[${it.name}] ${!CI} || $SANDBOX || $isMainHost = $enabled")
68+
mainEnabled
69+
}
7070
}
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
import io.gitlab.arturbosch.detekt.Detekt
22

33
plugins {
4-
id("io.gitlab.arturbosch.detekt")
4+
id("io.gitlab.arturbosch.detekt")
55
}
66

77
dependencies {
8-
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:_")
8+
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:_")
99
}
1010

1111
detekt {
12-
config.from(rootDir.resolve("gradle/detekt.yml"))
13-
buildUponDefaultConfig = true
14-
source = files("src/", "*.kts")
12+
config.from(rootDir.resolve("gradle/detekt.yml"))
13+
buildUponDefaultConfig = true
14+
source = files("src/", "*.kts")
1515
}
1616

1717
tasks {
18-
if (project == rootProject) {
19-
register("detektAll", Detekt::class) {
20-
description = "Run Detekt for all modules"
21-
config.from(project.detekt.config)
22-
buildUponDefaultConfig = project.detekt.buildUponDefaultConfig
23-
setSource(files(projectDir))
24-
exclude("**/klip-kotlin-plugin-native/src")
18+
if (project == rootProject) {
19+
register("detektAll", Detekt::class) {
20+
description = "Run Detekt for all modules"
21+
config.from(project.detekt.config)
22+
buildUponDefaultConfig = project.detekt.buildUponDefaultConfig
23+
setSource(files(projectDir))
24+
exclude("**/klip-kotlin-plugin-native/src")
25+
}
2526
}
26-
}
27-
afterEvaluate {
28-
withType<Detekt> {
29-
parallel = true
30-
reports {
31-
// observe findings in your browser with structure and code snippets
32-
html.required.set(true)
33-
// checkstyle like format mainly for integrations like Jenkins
34-
xml.required.set(true)
35-
// similar to the console output, contains issue signature to manually edit baseline files
36-
txt.required.set(true)
37-
// standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with Github Code Scanning
38-
sarif.required.set(true)
39-
}
40-
include("**/*.kt", "**/*.kts")
41-
exclude("**/build", "scripts/")
27+
afterEvaluate {
28+
withType<Detekt> {
29+
parallel = true
30+
reports {
31+
// observe findings in your browser with structure and code snippets
32+
html.required.set(true)
33+
// checkstyle like format mainly for integrations like Jenkins
34+
xml.required.set(true)
35+
// similar to the console output, contains issue signature to manually edit baseline files
36+
txt.required.set(true)
37+
// standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with Github Code Scanning
38+
sarif.required.set(true)
39+
}
40+
include("**/*.kt", "**/*.kts")
41+
exclude("**/build", "scripts/")
42+
}
4243
}
43-
}
4444
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
plugins {
2-
id("com.github.jakemarsden.git-hooks")
2+
id("com.github.jakemarsden.git-hooks")
33
}
44

55
gitHooks {
6-
setHooks(
7-
mapOf(
8-
"pre-commit" to "detektAll --auto-correct",
9-
"pre-push" to "detektAll"
6+
setHooks(
7+
mapOf(
8+
"pre-commit" to "detektAll --auto-correct",
9+
"pre-push" to "detektAll"
10+
)
1011
)
11-
)
1212
}

0 commit comments

Comments
 (0)