Skip to content

Commit 0de4466

Browse files
committed
main module conversion and update
1 parent 30ca280 commit 0de4466

File tree

78 files changed

+2247
-1657
lines changed

Some content is hidden

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

78 files changed

+2247
-1657
lines changed

.editorconfig

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

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @patjackson52 @mpetuska

.gitignore

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
*.iml
2-
.gradle
2+
.gradle/
3+
lint.xml
34
/local.properties
4-
/.idea/libraries
5-
/.idea/modules.xml
6-
/.idea/workspace.xml
7-
/.idea
5+
.idea/
86
/iOS/NameGame/.idea/
97
.DS_Store
10-
/build
11-
/common/build
128
/captures
139
.externalNativeBuild
1410
node_modules/
@@ -24,7 +20,6 @@ node_modules/
2420
build/
2521
DerivedData/
2622

27-
2823
## Various settings
2924
*.pbxuser
3025
!default.pbxuser
@@ -89,11 +84,11 @@ fastlane/test_output
8984
# End of https://www.gitignore.io/api/swift,xcode
9085

9186
# From redux
92-
dist
87+
dist/
9388
es
94-
coverage
89+
coverage/
9590

96-
website/translated_docs
91+
website/translated_docs/
9792
website/build/
98-
website/node_modules
93+
website/node_modules/
9994
website/i18n/*

CHANGELOG.md

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,64 @@
11
## Unreleased
22

3+
### Added
4+
5+
- All missing ios, watchos, tvos and macos simulator targets added
6+
- Added `androidNativeX64` and `androidNativeX86` targets
7+
- Added proper android release and debug variants instead of piggybacking on jvm artefact
8+
9+
### Changed
10+
11+
- Major gradle infra rework
12+
- Enabled `explicitPublicApi()`
13+
14+
### Removed
15+
16+
- Remove deprecated `wasm32` target
17+
318
## [0.5.5] - 2020-08-16
4-
- update to Kotlin 1.4.0
5-
- added platforms (androidNativeArm32, androidNativeArm64, iosArm32, linuxArm64, linuxX64,
19+
20+
- update to Kotlin 1.4.0
21+
- added platforms (androidNativeArm32, androidNativeArm64, iosArm32, linuxArm64, linuxX64,
622
mingwX86, tvosArm64, tvosX64, watchosArm32, watchosArm64, watchosX86)
7-
- remove spek & atrium deps and use plain kotlin tests & assertions. Tests run for all platforms now.
8-
23+
- remove spek & atrium deps and use plain kotlin tests & assertions. Tests run for all platforms now.
24+
925
## [0.5.2] - 2020-07-03
10-
- publish all available platforms to maven
11-
- add CI/CD through github actions
26+
27+
- publish all available platforms to maven
28+
- add CI/CD through github actions
1229

1330
## [0.5.1] - 2020-06-11
14-
- update lib dependency to api import, so core lib is included in redux-kotlin-threadsafe
31+
32+
- update lib dependency to api import, so core lib is included in redux-kotlin-threadsafe
1533

1634
## [0.5.0] - 2020-06-11
17-
- kotlin 1.3.72
18-
- createThreadSafeStore fun added for thread synchronized access
19-
- createEnsureSameThreadStore to provide existing same-thread-enforcement
35+
36+
- kotlin 1.3.72
37+
- createThreadSafeStore fun added for thread synchronized access
38+
- createEnsureSameThreadStore to provide existing same-thread-enforcement
2039

2140
## [0.4.0] - 2020-03-23
22-
- kotlin 1.3.70
41+
42+
- kotlin 1.3.70
2343

2444
## [0.3.2] - 2020-02-22
25-
- issue #34 - incorrect same thread enforcement behavior fixed
45+
46+
- issue #34 - incorrect same thread enforcement behavior fixed
2647

2748
## [0.3.1] - 2019-12-16
2849

2950
### Changed
30-
- update same thread enforcement message to not be getState only
51+
52+
- update same thread enforcement message to not be getState only
3153

3254
## [0.3.0] - 2019-12-16
3355

3456
### Added
35-
- thread enforcement
57+
58+
- thread enforcement
3659

3760
## [0.2.9] - 2019-11-23
3861

39-
### Changed
40-
- update Kotlin to 1.3.60
62+
### Changed
63+
64+
- update Kotlin to 1.3.60

build-conventions/build.gradle.kts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
3+
plugins {
4+
`kotlin-dsl`
5+
}
6+
7+
repositories {
8+
gradlePluginPortal()
9+
mavenCentral()
10+
google()
11+
if (findProperty("project.enableSnapshots") == "true") {
12+
maven("https://oss.sonatype.org/content/repositories/snapshots")
13+
}
14+
}
15+
16+
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+
}
24+
25+
tasks {
26+
withType<KotlinCompile> {
27+
kotlinOptions {
28+
languageVersion = "1.4" // 1.9 since gradle 8
29+
}
30+
}
31+
}
32+
33+
gradleEnterprise {
34+
buildScan {
35+
termsOfServiceUrl = "https://gradle.com/terms-of-service"
36+
termsOfServiceAgree = "yes"
37+
}
38+
}

build-conventions/gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../gradle
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../gradle.properties
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
id("de.fayard.refreshVersions") version "0.51.0"
3+
id("com.gradle.enterprise") version "3.12.2"
4+
}
5+
6+
refreshVersions {
7+
versionsPropertiesFile = rootDir.resolve("gradle/versions.properties")
8+
extraArtifactVersionKeyRules(rootDir.resolve("gradle/versions.rules"))
9+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import org.jetbrains.kotlin.konan.target.HostManager
2+
3+
plugins {
4+
id("convention.local-properties")
5+
id("convention.detekt")
6+
idea
7+
}
8+
9+
repositories {
10+
mavenCentral()
11+
google()
12+
gradlePluginPortal()
13+
if (findProperty("project.enableSnapshots") == "true") {
14+
maven("https://oss.sonatype.org/content/repositories/snapshots")
15+
}
16+
}
17+
18+
printlnCI(
19+
"""
20+
CI: $CI
21+
SANDBOX: $SANDBOX
22+
isMainHost: $isMainHost
23+
---
24+
hostIsLinux: ${HostManager.hostIsLinux}
25+
hostIsMac: ${HostManager.hostIsMac}
26+
hostIsMingw: ${HostManager.hostIsMingw}
27+
""".trimIndent()
28+
)
29+
30+
idea {
31+
module {
32+
isDownloadSources = true
33+
isDownloadJavadoc = true
34+
}
35+
}
36+
37+
tasks {
38+
withType<Test> {
39+
// useJUnitPlatform()
40+
}
41+
}
42+
43+
afterEvaluate {
44+
tasks {
45+
if (findByName("compile") == null) {
46+
register("compile") {
47+
dependsOn(withType(AbstractCompile::class))
48+
group = "build"
49+
}
50+
}
51+
if (findByName("allTests") == null) {
52+
register("allTests") {
53+
dependsOn(withType(AbstractTestTask::class))
54+
group = "verification"
55+
}
56+
}
57+
}
58+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import org.jetbrains.kotlin.gradle.dsl.KotlinJsProjectExtension
2+
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
3+
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
4+
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
5+
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
6+
import org.jetbrains.kotlin.konan.target.Family
7+
import org.jetbrains.kotlin.konan.target.HostManager
8+
import util.buildHost
9+
10+
plugins {
11+
id("convention.common")
12+
}
13+
14+
pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
15+
extensions.getByType(KotlinMultiplatformExtension::class.java).targets.let(::control)
16+
}
17+
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
18+
objects.namedDomainObjectList(KotlinTarget::class.java).apply {
19+
add(extensions.getByType(KotlinJvmProjectExtension::class.java).target)
20+
}.let(::control)
21+
}
22+
pluginManager.withPlugin("org.jetbrains.kotlin.js") {
23+
objects.namedDomainObjectList(KotlinTarget::class.java).apply {
24+
add(extensions.getByType(KotlinJsProjectExtension::class.java).js())
25+
}.let(::control)
26+
}
27+
28+
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)
34+
}
35+
}
36+
compilations.all {
37+
compileTaskProvider {
38+
onlyIf(enabled)
39+
}
40+
}
41+
}
42+
}
43+
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+
linuxHostTargets.onlyBuildIf {
50+
val enabled = HostManager.hostIsLinux
51+
printlnCI("[${it.name}] ${!CI} || $SANDBOX || ${HostManager.hostIsLinux} = $enabled")
52+
enabled
53+
}
54+
osxHostTargets.onlyBuildIf {
55+
val enabled = HostManager.hostIsMac
56+
printlnCI("[${it.name}] ${!CI} || $SANDBOX || ${HostManager.hostIsMac} = $enabled")
57+
enabled
58+
}
59+
windowsHostTargets.onlyBuildIf {
60+
val enabled = HostManager.hostIsMingw
61+
printlnCI("[${it.name}] ${!CI} || $SANDBOX || ${HostManager.hostIsMingw} = $enabled")
62+
enabled
63+
}
64+
mainHostTargets.onlyBuildIf {
65+
val enabled = !CI || SANDBOX || isMainHost
66+
printlnCI("[${it.name}] ${!CI} || $SANDBOX || $isMainHost = $enabled")
67+
enabled
68+
}
69+
}

0 commit comments

Comments
 (0)