Skip to content

Commit 26c7f13

Browse files
committed
Fix workflow bugs, stale docs, and dead code from KMP migration
- Fix run_gradle.yml ref variable (github.event.inputs.ref → inputs.ref) - Fix pr.yml docs detection logic (mkdocs.yml/main.py were unreachable) - Remove undefined inputs.ref from pr.yml/master.yml callers - Fix firstOrNull in faker-provider-conventions (first makes ?: throw dead) - Fix kotest-bom copy-paste in bom comment - Update CLAUDE.md: Java 8→11, Kotlin 1.9→2.x, stale src paths - Remove duplicate configureondemand, unused Android properties - Remove dead nexus-publish plugin and gradle-plugin-bcv library from catalog - Delete dead utils/Ci.kt - Remove commented-out code in cli-bot/build.gradle.kts
1 parent c26c5a1 commit 26c7f13

10 files changed

Lines changed: 18 additions & 57 deletions

File tree

.github/workflows/master.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
secrets: inherit
2323
with:
2424
runs-on: ubuntu-latest
25-
ref: ${{ inputs.ref }}
25+
ref: master
2626
task: apiCheck
2727

2828
build-primary:
@@ -39,7 +39,7 @@ jobs:
3939
uses: ./.github/workflows/run_gradle.yml
4040
secrets: inherit
4141
with:
42-
ref: ${{ inputs.ref }}
42+
ref: master
4343
task: >
4444
-P"kotlinFaker_enableKotlinJs=true"
4545
-P"kotlinFaker_enableKotlinNative=true"

.github/workflows/pr.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
merge_group:
77

88
env:
9-
GRAALCE_JDK_VERSION: '17.0.9'
9+
GRAALCE_JDK_VERSION: "17.0.9"
1010
# concatenation of env variables isn't currently supported
1111
# so need to specify version explicitly
1212
GRAALVM_HOME: /opt/hostedtoolcache/Java_graalce_jdk/17.0.9/x64
@@ -42,12 +42,12 @@ jobs:
4242
while IFS= read -r file
4343
do
4444
echo $file
45-
if [[ $file != docs/* ]]; then
46-
echo "This modified file is not under the 'docs' folder. Will run tests."
47-
echo "run_tests=true" >> $GITHUB_OUTPUT
48-
elif [[ $file = docs/* ]] || [[ $file = mkdocs.yml ]] || [[ $file = main.py ]]; then
49-
echo "This modified file is under the 'docs' folder. Will run docs workflow."
45+
if [[ $file = docs/* ]] || [[ $file = mkdocs.yml ]] || [[ $file = main.py ]]; then
46+
echo "This modified file is docs-related. Will run docs workflow."
5047
echo "run_docs=true" >> $GITHUB_OUTPUT
48+
else
49+
echo "This modified file is not docs-related. Will run tests."
50+
echo "run_tests=true" >> $GITHUB_OUTPUT
5151
fi
5252
done < files.txt
5353
@@ -59,7 +59,6 @@ jobs:
5959
secrets: inherit
6060
with:
6161
runs-on: ubuntu-latest
62-
ref: ${{ inputs.ref }}
6362
task: apiCheck --continue
6463

6564
gradle-check:
@@ -77,7 +76,6 @@ jobs:
7776
secrets: inherit
7877
with:
7978
runs-on: ${{ matrix.os }}
80-
ref: ${{ inputs.ref }}
8179
task: >
8280
-P"kotlinFaker_enableKotlinJs=true"
8381
-P"kotlinFaker_enableKotlinNative=true"
@@ -105,7 +103,7 @@ jobs:
105103
- name: Set up GraalCE JDK
106104
uses: actions/setup-java@v4
107105
with:
108-
distribution: 'jdkfile'
106+
distribution: "jdkfile"
109107
jdkFile: ${{ runner.temp }}/java_package.tar.gz
110108
java-version: ${{ steps.fetch_latest_jdk.outputs.java_version }}
111109
architecture: x64
@@ -150,8 +148,6 @@ jobs:
150148
runs-on: ubuntu-latest
151149
steps:
152150
- uses: actions/checkout@v4
153-
with:
154-
ref: ${{ inputs.ref }}
155151
- uses: actions/setup-python@v5
156152
with:
157153
python-version: 3.x
@@ -170,7 +166,7 @@ jobs:
170166
finalize:
171167
# see https://github.qkg1.topmunity/t/status-check-for-a-matrix-jobs/127354/7
172168
name: Final PR results
173-
needs: [validate-api, gradle-check, docs-check]
169+
needs: [validate-api, gradle-check, docs-check, cli-check]
174170
if: ${{ always() }}
175171
runs-on: ubuntu-latest
176172
steps:

.github/workflows/run_gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Checkout the repo
4545
uses: actions/checkout@v4
4646
with:
47-
ref: ${{ github.event.inputs.ref }}
47+
ref: ${{ inputs.ref }}
4848

4949
- name: Setup JDK
5050
uses: actions/setup-java@v4

CLAUDE.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,20 @@ The project follows a multi-module Gradle build:
8080

8181
When adding a new provider to `core` or creating a new faker module:
8282

83-
1. Add YAML dictionary file to `core/src/main/resources/locales/en/{category}.yml` (or to appropriate faker module)
84-
2. Create provider class extending `YamlFakeDataProvider` in `core/src/main/kotlin/io/github/serpro69/kfaker/provider/` (or faker module's provider package)
83+
1. Add YAML dictionary file to `core/src/jvmMain/resources/locales/en/{category}.yml` (or to appropriate faker module)
84+
2. Create provider class extending `YamlFakeDataProvider` in `core/src/jvmMain/kotlin/io/github/serpro69/kfaker/provider/` (or faker module's provider package)
8585
3. Add property to `Faker` class (or appropriate faker class) that instantiates the provider
8686
4. Update `cli-bot/src/main/kotlin/io/github/serpro69/kfaker/app/Constants.kt` for CLI support
8787
5. Update native-image `reflect-config.json` in `cli-bot/src/main/resources/META-INF/native-image/`
88-
6. Update test constants in `core/src/test/kotlin/io/github/serpro69/kfaker/TestConstants.kt`
88+
6. Update test constants in `core/src/jvmTest/kotlin/io/github/serpro69/kfaker/TestConstants.kt`
8989
7. Update `cli-bot/src/test/kotlin/io/github/serpro69/kfaker/app/cli/IntrospectorTest.kt`
9090

9191
See CONTRIBUTING.md for detailed step-by-step instructions and examples.
9292

9393
## Java Version Requirements
9494

95-
- **Runtime**: Java 8 + Kotlin 1.9.x
96-
- **Build**: Requires JDK 11 or higher (due to GraalVM buildtools plugin in cli-bot)
97-
- **Toolchains**: Core libs use Gradle toolchains to compile with Java 8 compatibility
95+
- **Runtime**: Java 11 + Kotlin 2.x
96+
- **Build**: Requires JDK 21 (configured via Gradle toolchains)
9897
- **Native Image**: Requires GraalVM CE JDK 17 for building cli-bot native image
9998

10099
The project uses Gradle toolchains to automatically provision correct JDK versions.

bom/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fun projectsFilter(candidateProject: Project) =
2929
rootProject.subprojects.filter(::projectsFilter).forEach { bom.evaluationDependsOn(it.path) }
3030

3131
configurations.api.configure {
32-
// lazily add the coords from all subprojects to the kotest-bom
32+
// lazily add the coords from all subprojects to the faker-bom
3333
dependencyConstraints.addAllLater(
3434
fakerBomService.coordinates.map { coords ->
3535
logger.lifecycle("[$path] adding ${coords.size} coords to faker-bom: $coords")

buildSrc/src/main/kotlin/faker-provider-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
plugins { id("faker-lib-conventions") }
33

44
val core =
5-
rootProject.subprojects.first { it.path == ":kotlin-faker" }
5+
rootProject.subprojects.firstOrNull { it.path == ":kotlin-faker" }
66
?: throw GradleException(":kotlin-faker project not found")
77

88
kotlin {

buildSrc/src/main/kotlin/utils/Ci.kt

Lines changed: 0 additions & 15 deletions
This file was deleted.

cli-bot/build.gradle.kts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ tasks.withType<Test> {
5252
}
5353

5454
application {
55-
// mainClassName = mainFunction
5655
mainClass.set(mainFunction)
5756
}
5857

@@ -113,16 +112,6 @@ graalvmNative {
113112
}
114113
}
115114

116-
// graalvmNative {
117-
// graalVersion("21.2.0")
118-
// javaVersion("8")
119-
// mainClass(mainFunction)
120-
// outputName("faker-bot_${project.version}")
121-
// option("--no-fallback")
122-
// option("--no-server")
123-
// option("--report-unsupported-elements-at-runtime")
124-
// }
125-
126115
tasks {
127116
all {
128117
onlyIf("enable cli") {

gradle.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version=0.0.0
22
kotlin.code.style=official
33
org.gradle.jvmargs=-Xmx8g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
4-
org.gradle.configureondemand=true
54
systemProp.org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
65

76
org.gradle.caching=true
@@ -20,9 +19,6 @@ kotlin.mpp.stability.nowarn=true
2019
kotlin.incremental=true
2120
kotlin.incremental.js=true
2221

23-
android.useAndroidX=true
24-
android.enableJetifier=true
25-
2622
# KotlinFaker build settings
2723
# enabled/disable Kotlin targets, for improving local dev & CI/CD performance
2824
kotlinFaker_enableKotlinJs=true

gradle/libs.versions.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ plugin-dokka = "2.0.0"
1414
plugin-semantic-versioning = "0.13.0"
1515
plugin-devpublish = "0.4.1"
1616
plugin-nmcp = "1.0.2"
17-
plugin-nexus-publish = "2.0.0"
1817
plugin-benmanes-versions = "0.51.0"
1918
plugin-spotless = "7.2.1"
2019
# test
@@ -49,8 +48,6 @@ rgxgen = { module = "com.github.curious-odd-man:rgxgen", version.ref = "rgxgen"
4948
# Plugins and dependencies for use in buildSrc/build.gradle.kts
5049
# Plugins are the *Maven coodinates* of Gradle plugins.
5150
gradle-plugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
52-
#gradle-plugin-ktLint = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint" }
53-
gradle-plugin-bcv = { module = "org.jetbrains.kotlinx.binary-compatibility-validator:org.jetbrains.kotlinx.binary-compatibility-validator.gradle.plugin", version.ref = "plugin-bcv" }
5451
gradle-plugin-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "plugin-dokka" }
5552
gradle-plugin-semantic-versioning = { module = "io.github.serpro69:semantic-versioning", version.ref = "plugin-semantic-versioning" }
5653
gradle-plugin-spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "plugin-spotless" }
@@ -84,7 +81,6 @@ test-kotest = [
8481
[plugins]
8582
# these are for root build.gradle.kts
8683
# most plugins are imported using Maven coordinates (see above), not the Gradle plugin ID
87-
nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "plugin-nexus-publish" }
8884
benmanes-versions = { id = "com.github.ben-manes.versions", version.ref = "plugin-benmanes-versions" }
8985
dokka = { id = "org.jetbrains.dokka" }
9086
bcv = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "plugin-bcv" }

0 commit comments

Comments
 (0)