Skip to content

Commit 30e08b4

Browse files
committed
Redux-kotlin-threadsafe update
1 parent 0de4466 commit 30e08b4

File tree

30 files changed

+175
-174
lines changed

30 files changed

+175
-174
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ root = true
33
[*.{kt,kts}]
44
indent_size = 2
55
ignored_rules = no-wildstar-imports
6+
insert_final_newline = true

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- Major gradle infra rework
1212
- Enabled `explicitPublicApi()`
13+
- BREAKING: `redux-kotlin-threadsafe` APIs moved to a new package: `org.reduxkotlin.threadsafe`
1314

1415
### Removed
1516

build-conventions/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies {
2020
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:_")
2121
implementation("io.github.gradle-nexus:publish-plugin:_")
2222
implementation("org.jetbrains.dokka:dokka-gradle-plugin:_")
23+
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:_")
2324
}
2425

2526
tasks {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id("kotlinx-atomicfu")
3+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
plugins {
2+
id("convention.mpp-all")
3+
id("convention.library-mpp-loved")
4+
}

build-conventions/src/main/kotlin/convention.library-mpp.gradle.kts renamed to build-conventions/src/main/kotlin/convention.library-mpp-loved.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import util.jvmCommonTest
22

33
plugins {
4-
id("convention.mpp")
4+
id("convention.mpp-loved")
55
id("convention.library-android")
66
id("convention.control")
77
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import util.targetGroup
2+
3+
plugins {
4+
id("convention.mpp-loved")
5+
}
6+
7+
kotlin {
8+
val nativeMain by sourceSets.getting
9+
val nativeTest by sourceSets.getting
10+
targetGroup(
11+
name = "androidNative",
12+
mainSourceSetTarget = nativeMain,
13+
testSourceSetTarget = nativeTest,
14+
androidNativeArm32(),
15+
androidNativeArm64(),
16+
androidNativeX64(),
17+
androidNativeX86(),
18+
)
19+
targetGroup(
20+
name = "mingw",
21+
mainSourceSetTarget = nativeMain,
22+
testSourceSetTarget = nativeTest,
23+
mingwX86(),
24+
)
25+
targetGroup(
26+
name = "linux",
27+
mainSourceSetTarget = nativeMain,
28+
testSourceSetTarget = nativeTest,
29+
linuxArm32Hfp(),
30+
linuxArm64(),
31+
linuxMips32(),
32+
linuxMipsel32(),
33+
)
34+
targetGroup(
35+
name = "watchos",
36+
mainSourceSetTarget = "appleMain",
37+
testSourceSetTarget = "appleTest",
38+
watchosDeviceArm64(),
39+
)
40+
}

build-conventions/src/main/kotlin/convention.mpp.gradle.kts renamed to build-conventions/src/main/kotlin/convention.mpp-loved.gradle.kts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ kotlin {
2323
mainSourceSetTarget = "commonMain",
2424
testSourceSetTarget = "commonTest",
2525
)
26-
targetGroup(
27-
name = "androidNative",
28-
mainSourceSetTarget = nativeMain,
29-
testSourceSetTarget = nativeTest,
30-
androidNativeArm32(),
31-
androidNativeArm64(),
32-
androidNativeX64(),
33-
androidNativeX86(),
34-
)
3526
val (appleMain, appleTest) = targetGroup<KotlinNativeTarget>(
3627
name = "apple",
3728
mainSourceSetTarget = nativeMain,
@@ -60,7 +51,6 @@ kotlin {
6051
testSourceSetTarget = appleTest,
6152
watchosArm32(),
6253
watchosArm64(),
63-
watchosDeviceArm64(),
6454
watchosX64(),
6555
watchosX86(),
6656
watchosSimulatorArm64()
@@ -77,16 +67,11 @@ kotlin {
7767
mainSourceSetTarget = nativeMain,
7868
testSourceSetTarget = nativeTest,
7969
mingwX64(),
80-
mingwX86(),
8170
)
8271
targetGroup(
8372
name = "linux",
8473
mainSourceSetTarget = nativeMain,
8574
testSourceSetTarget = nativeTest,
86-
linuxArm32Hfp(),
87-
linuxArm64(),
88-
linuxMips32(),
89-
linuxMipsel32(),
9075
linuxX64(),
9176
)
9277
}

build-conventions/src/main/kotlin/util/targetGroup.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ fun <T : KotlinTarget> KotlinMultiplatformExtension.targetGroup(
1515
): Pair<KotlinSourceSet, KotlinSourceSet> {
1616
val mainName = "${name}Main"
1717
val testName = "${name}Test"
18-
val main = sourceSets.create(mainName) { dependsOn(mainSourceSetTarget) }
19-
val test = sourceSets.create(testName) { dependsOn(testSourceSetTarget) }
18+
val main = sourceSets.maybeCreate(mainName).apply { dependsOn(mainSourceSetTarget) }
19+
val test = sourceSets.maybeCreate(testName).apply { dependsOn(testSourceSetTarget) }
2020
targets.forEach { target ->
2121
target.compilations["main"].defaultSourceSet { dependsOn(main) }
2222
target.compilations["test"].defaultSourceSet { dependsOn(test) }

gradle/detekt.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,26 @@ comments:
88
active: true
99
CommentOverPrivateFunction:
1010
active: false
11+
excludes: [ "**/*Test.kt" ]
1112
CommentOverPrivateProperty:
1213
active: false
14+
excludes: [ "**/*Test.kt" ]
1315
DeprecatedBlockTag:
1416
active: true
17+
excludes: [ "**/*Test.kt" ]
1518
OutdatedDocumentation:
16-
active: false
19+
active: true
20+
excludes: [ "**/*Test.kt" ]
1721
allowParamOnConstructorProperties: false
18-
# UndocumentedPublicClass:
19-
# active: true
20-
# UndocumentedPublicFunction:
21-
# active: true
22-
# UndocumentedPublicProperty:
23-
# active: true
22+
UndocumentedPublicClass:
23+
active: true
24+
excludes: [ "**/*Test.kt" ]
25+
UndocumentedPublicFunction:
26+
active: true
27+
excludes: [ "**/*Test.kt" ]
28+
UndocumentedPublicProperty:
29+
active: true
30+
excludes: [ "**/*Test.kt" ]
2431

2532
naming:
2633
InvalidPackageDeclaration:
@@ -49,3 +56,5 @@ formatting:
4956
active: false
5057
Indentation:
5158
indentSize: 2
59+
FinalNewline:
60+
active: true

0 commit comments

Comments
 (0)