Skip to content

Commit 71d89b3

Browse files
committed
Refactor to plugin management and remove pitest
1 parent 167c3c9 commit 71d89b3

File tree

14 files changed

+115
-154
lines changed

14 files changed

+115
-154
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 17 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.java-version

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

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
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

Lines changed: 9 additions & 32 deletions
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

Lines changed: 37 additions & 48 deletions
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:[email protected]:floschu/control.git"
66+
developerConnection = "scm:[email protected]:floschu/control.git"
67+
}
68+
}
69+
}
70+
8271
// ---- end publishing --- //

examples/android-counter/build.gradle.kts

Lines changed: 4 additions & 4 deletions
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 {

0 commit comments

Comments
 (0)