Skip to content

Commit 71d89b3

Browse files
committedFeb 9, 2025·
Refactor to plugin management and remove pitest
1 parent 167c3c9 commit 71d89b3

14 files changed

+115
-154
lines changed
 

‎.github/workflows/build.yml

+4-17
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,6 @@ jobs:
5555
- name: "Check if coverage is satisfied"
5656
run: ./gradlew jacocoTestCoverageVerification
5757

58-
mutation_test:
59-
runs-on: ubuntu-latest
60-
steps:
61-
- name: "Checkout"
62-
uses: actions/checkout@v4
63-
- name: "Set up Java"
64-
uses: actions/setup-java@v4
65-
with:
66-
distribution: 'adopt'
67-
java-version: '17'
68-
- name: "Mutation Testing"
69-
run: ./gradlew pitest
70-
7158
api_validation:
7259
runs-on: ubuntu-latest
7360
steps:
@@ -82,7 +69,7 @@ jobs:
8269
run: ./gradlew apiCheck
8370

8471
assemble:
85-
needs: [lint, ktlint, test, check_coverage, mutation_test]
72+
needs: [lint, ktlint, test, check_coverage]
8673
runs-on: ubuntu-latest
8774
steps:
8875
- name: "Checkout"
@@ -109,8 +96,8 @@ jobs:
10996
- name: "Create coverage reports"
11097
run: ./gradlew check jacocoTestReport
11198
- name: "Upload coverage to codecov"
112-
uses: codecov/codecov-action@v3
99+
uses: codecov/codecov-action@v5.3.1
113100
with:
114101
token: ${{ secrets.CODECOV_TOKEN }}
115-
file: ./control-core/build/reports/jacoco/test/jacocoTestReport.xml
116-
fail_ci_if_error: true
102+
files: ./control-core/build/reports/jacoco/test/jacocoTestReport.xml
103+
fail_ci_if_error: true

‎.github/workflows/deploy-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
distribution: 'adopt'
1818
java-version: '17'
1919
- name: "Checks all the things"
20-
run: ./gradlew lint ktlintCheck test jacocoTestCoverageVerification pitest apiCheck assemble
20+
run: ./gradlew lint ktlintCheck test jacocoTestCoverageVerification apiCheck assemble
2121

2222
publish:
2323
needs: [ all_checks ]

‎.github/workflows/deploy-snapshot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
distribution: 'adopt'
1818
java-version: '17'
1919
- name: "Checks all the things"
20-
run: ./gradlew lint ktlintCheck test jacocoTestCoverageVerification pitest apiCheck assemble
20+
run: ./gradlew lint ktlintCheck test jacocoTestCoverageVerification apiCheck assemble
2121

2222
publish:
2323
needs: [ all_checks ]

‎.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,4 @@ fabric.properties
199199

200200
# End of https://www.toptal.com/developers/gitignore/api/android,androidstudio,macos
201201

202-
*.salive
203-
.java-version
202+
*.salive

‎.idea/misc.xml

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.java-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
17.0

‎CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# changelog
22

3+
## `[1.4.0]` - 2025-XX-XX
4+
5+
- Update Kotlin to `2.1.10`
6+
- Update kotlinx.coroutines to `1.10.1`
7+
- Publish `control-core` as kotlin multiplatform library
8+
39
## `[1.3.0]` - 2024-11-16
410

511
- Update Kotlin to `2.0.21`

‎build.gradle.kts

+9-32
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,19 @@
1-
buildscript {
2-
repositories {
3-
google()
4-
mavenCentral()
5-
maven(url = "https://plugins.gradle.org/m2/")
6-
}
7-
8-
dependencies {
9-
classpath(libs.kotlin.gradle.plugin)
10-
classpath(libs.pitest.gradle.plugin)
11-
classpath(libs.binary.compat.validator)
12-
classpath(libs.maven.publish.plugin)
13-
classpath(libs.dokka.gradle.plugin)
14-
15-
// examples
16-
classpath(libs.android.gradle.plugin)
17-
classpath(libs.kotlin.serialization)
18-
}
19-
}
20-
211
plugins {
22-
jacoco
232
alias(libs.plugins.ktlint)
3+
alias(libs.plugins.dokka)
4+
alias(libs.plugins.binary.compatibility.validator)
5+
jacoco
246
`maven-publish`
257
signing
8+
alias(libs.plugins.kotlin.multiplatform) apply false
9+
alias(libs.plugins.android.application) apply false
10+
alias(libs.plugins.android.library) apply false
11+
alias(libs.plugins.vanniktech.maven.publish) apply false
2612
}
2713

2814
// ---- api-validation --- //
2915

30-
apply(plugin = "binary-compatibility-validator")
31-
32-
configure<kotlinx.validation.ApiValidationExtension> {
16+
apiValidation {
3317
ignoredProjects.addAll(
3418
listOf(
3519
"kotlin-counter",
@@ -47,18 +31,11 @@ subprojects {
4731
resolutionStrategy {
4832
eachDependency {
4933
if (requested.group == "org.jacoco") {
50-
useVersion("0.8.7")
34+
useVersion("0.8.12")
5135
}
5236
}
5337
}
5438
}
5539
}
5640

5741
// ---- end jacoco --- //
58-
59-
allprojects {
60-
repositories {
61-
google()
62-
mavenCentral()
63-
}
64-
}

‎control-core/build.gradle.kts

+37-48
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import com.vanniktech.maven.publish.SonatypeHost
2+
13
plugins {
24
id("kotlin")
3-
id("jacoco")
4-
id("info.solidsoft.pitest")
5-
id("com.vanniktech.maven.publish")
5+
jacoco
6+
alias(libs.plugins.vanniktech.maven.publish)
67
}
78

89
dependencies {
@@ -17,22 +18,8 @@ dependencies {
1718

1819
tasks.jacocoTestCoverageVerification {
1920
violationRules {
20-
rule { limit { minimum = "0.95".toBigDecimal() } }
21+
rule { limit { minimum = "0.9".toBigDecimal() } }
2122
}
22-
classDirectories.setFrom(
23-
sourceSets.main.get().output.asFileTree.matching {
24-
// jacoco cannot handle inline functions properly
25-
exclude(
26-
"at/florianschuster/control/DefaultTagKt*",
27-
"at/florianschuster/control/TakeUntilKt*",
28-
)
29-
// builders
30-
exclude(
31-
"at/florianschuster/control/ControllerKt*",
32-
"at/florianschuster/control/EffectControllerKt*",
33-
)
34-
}
35-
)
3623
}
3724

3825
tasks.jacocoTestReport {
@@ -45,38 +32,40 @@ tasks.jacocoTestReport {
4532

4633
// ---- end jacoco --- //
4734

48-
// ---- pitest --- //
49-
50-
pitest {
51-
targetClasses.add("at.florianschuster.control.*")
52-
mutationThreshold.set(100)
53-
excludedClasses.addAll(
54-
// inline function
55-
"at.florianschuster.control.DefaultTagKt**",
56-
"at.florianschuster.control.TakeUntilKt**",
57-
58-
// builder
59-
"at.florianschuster.control.Controller**",
60-
"at.florianschuster.control.EffectController**",
61-
62-
// inlined invokeSuspend
63-
"at.florianschuster.control.ControllerImplementation\$stateJob\$1",
64-
"at.florianschuster.control.ControllerImplementation\$stateJob\$1\$2"
65-
)
66-
threads.set(4)
67-
jvmArgs.add("-ea")
68-
avoidCallsTo.addAll(
69-
"kotlin.jvm.internal",
70-
"kotlin.ResultKt",
71-
"kotlinx.coroutines"
72-
)
73-
verbose.set(true)
74-
}
75-
76-
// ---- end pitest --- //
77-
7835
// ---- publishing --- //
7936

37+
group = "at.florianschuster.control"
8038
version = System.getenv("libraryVersionTag")
8139

40+
mavenPublishing {
41+
publishToMavenCentral(SonatypeHost.S01)
42+
signAllPublications()
43+
coordinates(group.toString(), "control-core", version.toString())
44+
pom {
45+
name = "control-core"
46+
description = "coroutines flow based uni-directional architecture"
47+
inceptionYear = "2019"
48+
url = "https://github.com/floschu/control"
49+
licenses {
50+
license {
51+
name = "The Apache Software License, Version 2.0"
52+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
53+
distribution = "repo"
54+
}
55+
}
56+
developers {
57+
developer {
58+
id = "floschu"
59+
name = "Florian Schuster"
60+
url = "https://github.com/floschu"
61+
}
62+
}
63+
scm {
64+
url = "https://github.com/floschu/control"
65+
connection = "scm:git@github.com:floschu/control.git"
66+
developerConnection = "scm:git@github.com:floschu/control.git"
67+
}
68+
}
69+
}
70+
8271
// ---- end publishing --- //

‎examples/android-counter/build.gradle.kts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
plugins {
2-
id("com.android.application")
32
id("kotlin-android")
3+
alias(libs.plugins.android.application)
44
alias(libs.plugins.compose.compiler)
55
}
66

77
android {
88
namespace = "at.florianschuster.control.counter"
9-
compileSdk = 34
9+
compileSdk = libs.versions.android.compileSdk.get().toInt()
1010
defaultConfig {
1111
applicationId = "at.florianschuster.control.counter"
12-
minSdk = 23
13-
targetSdk = 34
12+
minSdk = libs.versions.android.minSdk.get().toInt()
13+
targetSdk = libs.versions.android.compileSdk.get().toInt()
1414
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1515
}
1616
compileOptions {

‎gradle.properties

-19
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,3 @@ android.useAndroidX=true
55
android.enableJetifier=true
66
# Kotlin code style for this project: "official" or "obsolete":
77
kotlin.code.style=official
8-
9-
# maven
10-
GROUP=at.florianschuster.control
11-
POM_ARTIFACT_ID=control-core
12-
POM_NAME=control-core
13-
POM_DESCRIPTION=coroutines flow based uni-directional architecture
14-
POM_INCEPTION_YEAR=2019
15-
POM_URL=https://github.com/floschu/control
16-
POM_SCM_URL=https://github.com/floschu/control
17-
POM_SCM_CONNECTION=scm:git@github.com:floschu/control.git
18-
POM_SCM_DEV_CONNECTION=scm:git@github.com:floschu/control.git
19-
POM_LICENCE_NAME=The Apache Software License, Version 2.0
20-
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
21-
POM_LICENCE_DIST=repo
22-
POM_DEVELOPER_ID=floschu
23-
POM_DEVELOPER_NAME=Florian Schuster
24-
POM_DEVELOPER_URL=https://github.com/floschu
25-
SONATYPE_HOST=S01
26-
RELEASE_SIGNING_ENABLED=true

‎gradle/libs.versions.toml

+30-27
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
11
[versions]
22
# lib
3-
kotlin = "2.0.21"
4-
coroutines = "1.9.0"
3+
kotlin = "2.1.10"
4+
coroutines = "1.10.1"
5+
binary-compatibility-validator = "0.17.0"
56

67
# examples
7-
activity-compose = "1.9.3"
8-
material3 = "1.3.1"
9-
compose-bom = "2024.11.00"
8+
agp = "8.8.0"
9+
android-minSdk = "24"
10+
android-compileSdk = "35"
11+
androidx-activity-compose = "1.10.0"
12+
androidx-compose-bom = "2025.01.01"
13+
androidx-material3 = "1.3.1"
1014
espresso = "3.6.1"
1115
junit-ktx = "1.2.1"
12-
mockk = "1.13.13"
13-
pitest = "1.15.0"
14-
binary-compat-validator = "0.14.0"
15-
maven-publish-plugin = "0.25.3"
16-
dokka = "1.9.20"
17-
android-gradle-plugin = "8.6.1"
16+
mockk = "1.13.16"
17+
maven-publish-plugin = "0.29.0"
18+
dokka = "2.0.0"
1819
ktlint = "12.1.1"
19-
ui-test-junit4 = "1.7.5"
20+
androidx-ui-test-junit4 = "1.7.7"
2021

2122
[libraries]
22-
activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity-compose" }
23-
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
24-
androidx-compose-material = { module = "androidx.compose.material3:material3", version.ref = "material3" }
23+
# lib
24+
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
25+
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
26+
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
27+
28+
# examples
29+
activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
30+
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidx-compose-bom" }
31+
androidx-compose-material = { module = "androidx.compose.material3:material3", version.ref = "androidx-material3" }
2532
androidx-compose-material-icons-core = { module = "androidx.compose.material:material-icons-core" }
2633
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
2734
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
28-
androidx-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "ui-test-junit4" }
35+
androidx-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "androidx-ui-test-junit4" }
2936
androidx-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
3037
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" }
3138
junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "junit-ktx" }
32-
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
33-
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
34-
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
35-
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
36-
pitest-gradle-plugin = { module = "info.solidsoft.gradle.pitest:gradle-pitest-plugin", version.ref = "pitest" }
37-
binary-compat-validator = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version.ref = "binary-compat-validator" }
38-
maven-publish-plugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "maven-publish-plugin" }
39-
dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
40-
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "android-gradle-plugin" }
41-
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
4239

4340
[plugins]
41+
android-application = { id = "com.android.application", version.ref = "agp" }
42+
android-library = { id = "com.android.library", version.ref = "agp" }
43+
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary-compatibility-validator" }
44+
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
45+
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
46+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
4447
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
45-
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
48+
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish-plugin" }

‎gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip

‎settings.gradle.kts

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
include(":control-core")
1+
pluginManagement {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
gradlePluginPortal()
6+
}
7+
}
8+
9+
dependencyResolutionManagement {
10+
@Suppress("UnstableApiUsage")
11+
repositories {
12+
google()
13+
mavenCentral()
14+
}
15+
}
216

17+
rootProject.name = "control"
18+
19+
include(":control-core")
320
include(":examples:kotlin-counter")
421
include(":examples:android-counter")

0 commit comments

Comments
 (0)
Please sign in to comment.