Skip to content

Commit 399dfb3

Browse files
authored
Cleanup (#1045)
* Update to Kotlin 2.3.20-RC3 * Add a convention plugin for KMP * Add a jvm convention plugin * Update Gradle to 9.4.0 * Update kctfork * Clean up version catalog, consolidate versions, remove deprecated properties - Rename `abg` to `agp`, remove duplicate `gradleMavenPublishPlugin` version - Consolidate 8 ktorfit version entries to 3 (ktorfit, ktorfitCompiler, ktorfitGradlePlugin) - Remove `groupId` from catalog, use `group` property in gradle.properties instead - Add ktlint, gradlePluginPublish, licensee plugin entries to catalog - Remove platform-specific ktor-client-core-* and ktor-client-cio-* catalog entries - Replace platform-specific ktor deps with common artifacts in ktorfit-lib and sandbox - Remove stale `kotlinx-serialization-runtime-js` usage from sandbox - Remove deprecated `kotlin.native.binary.freezing` from root gradle.properties - Remove deprecated `kotlin.mpp.androidSourceSetLayoutVersion=2` from module gradle.properties - Add POM_ARTIFACT_ID to all module gradle.properties for vanniktech publishing - Add `kotlin.js.yarn=false` to gradle.properties (Phase 10 prep) - Update AGP to 9.0.0 and Detekt to 2.0.0-alpha.2 in catalog (Phases 4+8 prep) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add publishing convention plugin and remove per-module publishing boilerplate Create `ktorfit.publishing` convention plugin using vanniktech maven-publish that handles publishToMavenCentral, signAllPublications, and all POM metadata automatically from gradle.properties. This removes from every module: - `maven-publish` and `signing` plugin applications - `enableSigning` conditional logic and sign task dependency workaround - `javadocJar` task registration (vanniktech handles this) - Entire `publishing { publications { ... } }` POM blocks (~30 lines each) - Entire `publishing { repositories { ... } }` sonatype blocks (~15 lines each) Each module now just applies `id("ktorfit.publishing")` and calls `mavenPublishing { coordinates(version = ...) }`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add licensee convention plugin to deduplicate license config Create `ktorfit.licensee` convention plugin that applies licensee and configures Apache-2.0, MIT, and MIT URL allowances. Replace per-module licensee blocks in all 8 published modules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Remove buildscript block and clean up repository configuration - Remove entire buildscript block from root build.gradle.kts (classpath deps now handled by build-logic convention plugins) - Remove mavenLocal() from settings.gradle.kts and build-logic settings - Remove duplicate google() repository - Remove Ktor EAP and Kotlin WASM experimental repos (not needed) - Remove resolutionStrategy for de.jensklingenberg.ktorfit plugin - Move pluginManagement.dependencyResolutionManagement to top-level Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Migrate to AGP 9 KMP plugin and Detekt v2 AGP 9 migration: - Replace `com.android.library` with `com.android.kotlin.multiplatform.library` in KMP convention plugin - Move `androidTarget { publishLibraryVariants() }` to `androidLibrary {}` - Remove standalone `android {}` blocks from all modules; move namespace into `kotlin { androidLibrary { namespace = "..." } }` - Update compileSdk to 35, remove manual manifest srcFile setup - Remove consumerProguardFiles from ktorfit-lib-core (not supported in AGP 9 KMP library plugin) Detekt v2 migration: - Update plugin ID from `io.gitlab.arturbosch.detekt` to `dev.detekt` - Update Maven group from `io.gitlab.arturbosch.detekt` to `dev.detekt` - Create `ktorfit.detekt` convention plugin with shared config - Replace per-module detekt configuration blocks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Switch from Yarn to npm for JS/WASM targets - Set kotlin.js.yarn=false in gradle.properties (done in earlier commit) - Remove kotlin-js-store/ directory containing yarn.lock files - npm lock files will be generated on next build via kotlinUpgradePackageLock Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Move CI to ubuntu-latest and centralize Java version in .java-version - Create .java-version file (JDK 25) - Move build job from macos-latest to ubuntu-latest (klib cross-compilation) - Move publish-annotations and publish-ktorfit-lib from macos-latest to ubuntu-latest - Move publish-converters from macos-latest to ubuntu-latest - Replace hardcoded java-version: 21 with java-version-file: .java-version across all workflow jobs - Remove manual Gradle cache setup (gradle/actions/setup-gradle handles it) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Consolidate dependabot into renovate - Remove .github/dependabot.yml (renovate handles gradle + github-actions) - Remove update-gradle-wrapper.yml workflow (renovate handles wrapper updates) - Update renovate.json5 with enabledManagers for gradle, gradle-wrapper, and github-actions; add registryUrls and dependency labels Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Remove unused catalog entries and add serialization plugin to root - Remove unused `kotlin-serialization` library (was in removed buildscript block) - Remove unused `ktorfit-gradle-plugin` library (sandbox uses project substitution) - Add `kotlin("plugin.serialization")` to root plugins block so sandbox can resolve `id("kotlinx-serialization")` without buildscript classpath Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix build issues from modernization - Change build-logic deps from compileOnly to implementation (required for precompiled script plugins to resolve plugin IDs at apply time) - Re-add buildscript classpath for ktorfit-gradle-plugin (needed by sandbox) - Re-add resolutionStrategy for de.jensklingenberg.ktorfit plugin in settings - Update sandbox to use alias(libs.plugins.licensee) and alias(libs.plugins.ktorfit) - Update detekt-config.yml for v2: rename ComplexMethod to CyclomaticComplexMethod, remove removed rules, fix excludedFunctions YAML format - Regenerate detekt baselines for compiler-plugin and ksp modules - Remove obsolete supportsK2 from compiler-plugin test (K2 is now default) - Fix ktlint trailing blank line in compiler-plugin build file - Regenerate klib API dumps (library unique name changed due to group property) - Use released ktorfitGradlePlugin version (2.7.2) for buildscript resolution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add npm lock files after yarn-to-npm migration Generated by the build after setting kotlin.js.yarn=false. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Use GROUP instead of group in gradle.properties to preserve klib API The lowercase `group` property sets Gradle's project group, which changes the klib library unique name (e.g. <Ktorfit:ktorfit-annotations> becomes <de.jensklingenberg.ktorfit:ktorfit-annotations>). Use uppercase `GROUP` instead, which the vanniktech maven-publish plugin reads for publishing coordinates without affecting the project group. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix quick-win Kotlin warnings and add warnings plan doc Suppress unnecessary safe call warnings on KSType in KSP code generators, add @Suppress("UNCHECKED_CAST") for intentional generic casts, fix parameter name mismatch in test, and remove deprecated developmentMode usage in sandbox. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update AGP to 9.1.0 * Update maven publish plugin * Cleanup gradle plugin module * Update gradle plugin publish * Add comment explaining the ktorfit versions in the catalog * Update mockk * Remove kapt * Update releasing instructions * Publish SNAPSHOT builds on pushes to master * Fix more warnings * Clean up sandbox build.gradle.kts * Handle deprecated API * Update Gradle checksum * Don't require signing when publishing to maven local * Simplify running tasks on all modules in GitHub Actions * Add test for #887 * Silence licensee unused license warning * Don't apply kotlin(jvm) and kotlin-dsl plugins together * Make detekt quieter when there are no violations
1 parent 6f204c2 commit 399dfb3

75 files changed

Lines changed: 2051 additions & 2213 deletions

File tree

Some content is hidden

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

.github/dependabot.yml

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

.github/workflows/build.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
- 'release/**'
2222
env:
2323
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx8g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
24-
24+
2525
jobs:
2626
set-milestone:
2727
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
@@ -56,7 +56,7 @@ jobs:
5656
uses: actions/setup-java@v5
5757
with:
5858
distribution: temurin
59-
java-version: 21
59+
java-version-file: .java-version
6060
- uses: gradle/actions/setup-gradle@v5
6161
- name: API check
6262
run: ./gradlew ktLintCheck
@@ -73,32 +73,34 @@ jobs:
7373
uses: actions/setup-java@v5
7474
with:
7575
distribution: temurin
76-
java-version: 21
76+
java-version-file: .java-version
7777
- uses: gradle/actions/setup-gradle@v5
7878
- name: API check
7979
run: ./gradlew apiCheck
8080
- name: 'Notify on failure'
8181
if: failure()
8282
run: echo "Format check failed. Run ./gradlew apiDump to fix."
8383
build:
84-
runs-on: macos-latest
84+
runs-on: ubuntu-latest
8585
steps:
8686
- uses: actions/checkout@v6
87-
- name: Set up JDK 21
87+
- name: Set up JDK
8888
uses: actions/setup-java@v5
8989
with:
90-
java-version: 21
9190
distribution: 'temurin'
92-
- name: Cache Gradle and wrapper
93-
uses: actions/cache@v5
94-
with:
95-
path: |
96-
~/.gradle/caches
97-
~/.gradle/wrapper
98-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
99-
restore-keys: |
100-
${{ runner.os }}-gradle-
101-
- name: Grant execute permission for gradlew
102-
run: chmod +x gradlew
91+
java-version-file: .java-version
92+
- uses: gradle/actions/setup-gradle@v5
10393
- name: Build and test with Gradle
104-
run: ./gradlew licensee :ktorfit-gradle-plugin:publishToMavenLocal :ktorfit-annotations:publishToMavenLocal :ktorfit-ksp:publishToMavenLocal :ktorfit-lib-core:publishToMavenLocal :ktorfit-compiler-plugin:test :ktorfit-ksp:test :ktorfit-lib-core:jvmTest :ktorfit-converters:call:publishToMavenLocal :ktorfit-converters:flow:publishToMavenLocal :ktorfit-converters:response:publishToMavenLocal
94+
run: ./gradlew build publishToMavenLocal
95+
build-apple:
96+
runs-on: macos-latest
97+
steps:
98+
- uses: actions/checkout@v6
99+
- name: Set up JDK
100+
uses: actions/setup-java@v5
101+
with:
102+
distribution: 'temurin'
103+
java-version-file: .java-version
104+
- uses: gradle/actions/setup-gradle@v5
105+
- name: Build and test Apple targets
106+
run: ./gradlew appleTest publishAppleToMavenLocal

.github/workflows/publish-converters.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ on:
55

66
jobs:
77
publish-converters:
8-
runs-on: macos-latest
8+
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v6
1212

13-
- name: Install JDK 21
13+
- name: Set up JDK
1414
uses: actions/setup-java@v5
1515
with:
1616
distribution: 'temurin'
17-
java-version: 21
17+
java-version-file: .java-version
1818

1919
- uses: gradle/actions/setup-gradle@v5
2020
- name: Publish release

.github/workflows/publish-gradle-plugin.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ jobs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v6
12-
- name: Set up JDK 21
12+
- name: Set up JDK
1313
uses: actions/setup-java@v5
1414
with:
1515
distribution: 'temurin'
16-
java-version: 21
16+
java-version-file: .java-version
1717
- name: Set up Gradle
1818
uses: gradle/actions/setup-gradle@v5
1919
- name: Publish plugin
2020
env:
2121
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
2222
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
23-
run: ./gradlew :ktorfit-gradle-plugin:publishPlugins -Dgradle.publish.key=${GRADLE_PUBLISH_KEY} -Dgradle.publish.secret=${GRADLE_PUBLISH_SECRET}
23+
run: ./gradlew :ktorfit-gradle-plugin:publishPlugins -Dgradle.publish.key=${GRADLE_PUBLISH_KEY} -Dgradle.publish.secret=${GRADLE_PUBLISH_SECRET}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish Snapshot
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
publish-snapshot:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v6
14+
15+
- name: Set up JDK
16+
uses: actions/setup-java@v5
17+
with:
18+
distribution: 'temurin'
19+
java-version-file: .java-version
20+
21+
- uses: gradle/actions/setup-gradle@v5
22+
23+
- name: Bump versions to SNAPSHOT
24+
run: |
25+
bump_snapshot() {
26+
local key="$1"
27+
local version
28+
version=$(grep "^${key} = " gradle/libs.versions.toml | sed 's/.*"\(.*\)"/\1/')
29+
local major minor patch
30+
IFS='.' read -r major minor patch <<< "$version"
31+
patch=$((patch + 1))
32+
local snapshot="${major}.${minor}.${patch}-SNAPSHOT"
33+
sed -i "s/^${key} = \".*\"/${key} = \"${snapshot}\"/" gradle/libs.versions.toml
34+
echo "${key}: ${version} -> ${snapshot}"
35+
}
36+
bump_snapshot "ktorfit"
37+
bump_snapshot "ktorfitCompiler"
38+
39+
- name: Publish snapshot
40+
run: ./gradlew publishToMavenCentral
41+
env:
42+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
43+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
44+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY }}
45+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

.github/workflows/publish.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ on:
55

66
jobs:
77
publish-annotations:
8-
runs-on: macos-latest
8+
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v6
1212

13-
- name: Install JDK 21
13+
- name: Set up JDK
1414
uses: actions/setup-java@v5
1515
with:
1616
distribution: 'temurin'
17-
java-version: 21
17+
java-version-file: .java-version
1818

1919
- uses: gradle/actions/setup-gradle@v5
2020

@@ -31,11 +31,11 @@ jobs:
3131
- name: Checkout
3232
uses: actions/checkout@v6
3333

34-
- name: Install JDK 21
34+
- name: Set up JDK
3535
uses: actions/setup-java@v5
3636
with:
3737
distribution: 'temurin'
38-
java-version: 21
38+
java-version-file: .java-version
3939

4040
- uses: gradle/actions/setup-gradle@v5
4141

@@ -52,11 +52,11 @@ jobs:
5252
- name: Checkout
5353
uses: actions/checkout@v6
5454

55-
- name: Install JDK 21
55+
- name: Set up JDK
5656
uses: actions/setup-java@v5
5757
with:
5858
distribution: 'temurin'
59-
java-version: 21
59+
java-version-file: .java-version
6060

6161
- uses: gradle/actions/setup-gradle@v5
6262

@@ -73,11 +73,11 @@ jobs:
7373
- name: Checkout
7474
uses: actions/checkout@v6
7575

76-
- name: Install JDK 21
76+
- name: Set up JDK
7777
uses: actions/setup-java@v5
7878
with:
7979
distribution: 'temurin'
80-
java-version: 21
80+
java-version-file: .java-version
8181

8282
- uses: gradle/actions/setup-gradle@v5
8383

@@ -89,16 +89,16 @@ jobs:
8989
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY }}
9090
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
9191
publish-ktorfit-lib:
92-
runs-on: macos-latest
92+
runs-on: ubuntu-latest
9393
steps:
9494
- name: Checkout
9595
uses: actions/checkout@v6
9696

97-
- name: Install JDK 21
97+
- name: Set up JDK
9898
uses: actions/setup-java@v5
9999
with:
100100
distribution: 'temurin'
101-
java-version: 21
101+
java-version-file: .java-version
102102

103103
- uses: gradle/actions/setup-gradle@v5
104104

.github/workflows/update-gradle-wrapper.yml

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

.java-version

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

RELEASING.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@ Releasing
44
# Publish new version
55

66
1. Create new branch `release/X.Y.Z` from `master` branch
7-
2. Update **ktorfit** version inside `gradle/libs.versions.toml`
8-
3. Update **ktorfitGradlePlugin** version inside `gradle/libs.versions.toml`
9-
4. Update Compatibility table in Readme.md
10-
5. Update KtorfitCompilerSubPlugin.defaultCompilerPluginVersion if necessary
11-
6. Update ktorfit release version in mkdocs.yml
12-
7. Update version in KtorfitGradleConfiguration
13-
8. Set the release date in docs/changelog.md
14-
9. `git commit -am "X.Y.Z."` (where X.Y.Z is the new version)
15-
10. Push and create a PR to the `master` branch
16-
11. When all checks successful, run GitHub Action `Publish Release` from your branch
17-
12. Set the Git tag `git tag -a X.Y.Z -m "X.Y.Z"` (where X.Y.Z is the new version)
18-
13. Merge the PR
19-
14. Create a new release with for the Tag on GitHub
20-
15. Run "deploy to GitHub pages" action
21-
16. Put the relevant changelog in the release description
7+
2. Update **ktorfit** and **ktorfitCompiler** version inside `gradle/libs.versions.toml`
8+
3. Update Compatibility table in Readme.md
9+
4. Update KtorfitCompilerSubPlugin.defaultCompilerPluginVersion if necessary
10+
5. Update ktorfit release version in mkdocs.yml
11+
6. Set the release date in docs/changelog.md
12+
7. `git commit -am "X.Y.Z."` (where X.Y.Z is the new version)
13+
8. Push and create a PR to the `master` branch
14+
9. When all checks successful, run GitHub Action `Publish Release` from your branch
15+
10. Set the Git tag `git tag -a X.Y.Z -m "X.Y.Z"` (where X.Y.Z is the new version)
16+
11. Merge the PR
17+
12. Create a new release with for the Tag on GitHub
18+
13. Run "deploy to GitHub pages" action
19+
14. Put the relevant changelog in the release description

build-logic/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
dependencies {
6+
implementation(libs.android.build.gradle)
7+
implementation(libs.kotlin.gradle.plugin)
8+
implementation(libs.gradle.maven.publish.plugin)
9+
implementation(libs.licensee.gradle.plugin)
10+
implementation(libs.detekt.gradle.plugin)
11+
}

0 commit comments

Comments
 (0)