Skip to content

Commit

Permalink
Release 2.3.0 (#784)
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso authored Feb 16, 2025
1 parent 82510a4 commit 3053312
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 30 deletions.
23 changes: 21 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ and this project orients towards [Semantic Versioning](http://semver.org/spec/v2
Note: This project needs KSP to work and every new Ktorfit with an update of the KSP version is technically a breaking change.
But there is no intent to bump the Ktorfit major version for every KSP update.

# Unreleased
# [2.3.0]()

2.3.0 - 2025-02-16
========================================
* Supported KSP version: 1.0.30
* Supported Kotlin version: 2.1.10
* Ktor version: 3.1.0

## Added
Expand All @@ -22,15 +27,29 @@ ktorfit{
kotlinVersion = "x.x.x"
}
```

- Added targets:
androidNativeArm32
androidNativeArm64
androidNativeX86
androidNativeX64


- Include function annotations in request attribute
See https://foso.github.io/Ktorfit/requests/#annotations

## Fixed
- @Headers annotation produces unexpected newline in generated code by ksp plugin #752
- Generated code containing repeated @OptIn annotation #767

Thanks to @DatL4g, @dewantawsif and @MohammadFakhraee for contributing to this release!

# [2.2.0]()
* Supported Kotlin version: 2.0.0; 2.0.10; 2.0.20, 2.1.0-Beta1; 2.0.21-RC, 2.0.21

2.2.0 - 2024-11-10
========================================

* Supported Kotlin version: 2.0.0; 2.0.10; 2.0.20, 2.1.0-Beta1; 2.0.21-RC, 2.0.21, 2.10
* Supported KSP version: 1.0.27, 1.0.28, 1.0.29, 1.0.30
* Ktor version: 3.0.1

Expand Down
16 changes: 8 additions & 8 deletions example/AndroidOnlyExample/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp") version "2.1.0-1.0.29"
id("com.google.devtools.ksp") version "2.1.10-1.0.30"
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.21"
id("de.jensklingenberg.ktorfit") version "2.2.0"
id("org.jetbrains.kotlin.plugin.compose") version "2.0.21"
id("de.jensklingenberg.ktorfit") version "2.3.0"
id("org.jetbrains.kotlin.plugin.compose") version "2.1.10"
}

ktorfit{
Expand All @@ -13,12 +13,12 @@ ktorfit{

android {
namespace = "de.jensklingenberg.androidonlyexample"
compileSdk = 34
compileSdk = 35

defaultConfig {
applicationId = ("de.jensklingenberg.androidonlyexample")
minSdk = 21
targetSdk = 33
targetSdk = 35
versionCode = 1
versionName = "1.0"

Expand Down Expand Up @@ -52,8 +52,8 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach
}
}

val ktorfit = "2.2.0"
val ktor = "3.0.1"
val ktorfit = "2.3.0"
val ktor = "3.1.0"
val compose_ui_version = "1.7.8"
dependencies {
implementation("de.jensklingenberg.ktorfit:ktorfit-lib:$ktorfit")
Expand All @@ -64,7 +64,7 @@ dependencies {
implementation("de.jensklingenberg.ktorfit:ktorfit-converters-call:$ktorfit")
implementation("de.jensklingenberg.ktorfit:ktorfit-converters-flow:$ktorfit")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
implementation("androidx.activity:activity-compose:1.9.3")
implementation("androidx.activity:activity-compose:1.10.0")
implementation("androidx.compose.ui:ui:$compose_ui_version")
implementation("androidx.compose.ui:ui-tooling-preview:$compose_ui_version")
implementation("androidx.compose.material:material:1.7.8")
Expand Down
6 changes: 3 additions & 3 deletions example/AndroidOnlyExample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.4.1' apply false
id 'com.android.library' version '8.4.1' apply false
id 'org.jetbrains.kotlin.android' version '2.1.0' apply false
id 'com.android.application' version '8.4.2' apply false
id 'com.android.library' version '8.4.2' apply false
id 'org.jetbrains.kotlin.android' version '2.1.10' apply false
}
8 changes: 4 additions & 4 deletions example/MultiplatformExample/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ plugins {
kotlin("multiplatform")
kotlin("native.cocoapods")
id("com.android.library")
id("com.google.devtools.ksp") version "2.1.0-1.0.29"
id("com.google.devtools.ksp") version "2.1.10-1.0.30"
id("kotlinx-serialization")
id("de.jensklingenberg.ktorfit") version "2.2.0"
id("de.jensklingenberg.ktorfit") version "2.3.0"
}

ktorfit {
Expand All @@ -15,8 +15,8 @@ ktorfit {
}

version = "1.0"
val ktorVersion = "3.0.1"
val ktorfitVersion = "2.2.0"
val ktorVersion = "3.1.0"
val ktorfitVersion = "2.3.0"

kotlin {
jvmToolchain(8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ val ktorfit =
)
}

val starWarsApi = ktorfit.create<StarWarsApi>()
val starWarsApi = ktorfit.createStarWarsApi()

class Greeting {
fun greeting(): String {
Expand Down
13 changes: 7 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ kotlinPoet = "2.0.0"
kspVersion = "2.1.10-1.0.30"

groupId = "de.jensklingenberg.ktorfit"
ktorfit = "2.2.0"
ktorfitKsp = "2.2.0-1.0.30"
ktorfit = "2.3.0"
ktorfitKsp = "2.3.0-1.0.30"
ktorfitCompiler = "2.1.0-2.1.10"
ktorfitCallConverter = "2.2.0"
ktorfitFlowConverter = "2.2.0"
ktorfitResponseConverter = "2.2.0"
ktorfitGradle = "2.2.0"
ktorfitCallConverter = "2.3.0"
ktorfitFlowConverter = "2.3.0"
ktorfitResponseConverter = "2.3.0"
ktorfitGradle = "2.3.0"

ktorfitGradlePlugin = "2.2.0"
ktorVersion = "3.1.0"
Expand All @@ -26,6 +26,7 @@ mockito-kotlin = "4.1.0"
gradleMavenPublishPlugin = "0.28.0"
vannikMavenPublish = "0.28.0"
licensee = "1.12.0"

[libraries]
android-build-gradle = { module = "com.android.tools.build:gradle", version.ref = "abg" }
autoService = { module = "com.google.auto.service:auto-service", version.ref = "autoService" }
Expand Down
1 change: 0 additions & 1 deletion ktorfit-annotations/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class KtorfitGradlePlugin : Plugin<Project> {
const val GROUP_NAME = "de.jensklingenberg.ktorfit"
const val ARTIFACT_NAME = "compiler-plugin"
const val COMPILER_PLUGIN_ID = "ktorfitPlugin"
const val KTORFIT_KSP_PLUGIN_VERSION = "2.2.0" // remember to bump this version before any release!
const val KTORFIT_KSP_PLUGIN_VERSION = "2.3.0"
const val KTORFIT_COMPILER_PLUGIN_VERSION = "2.1.0"
const val SNAPSHOT = ""
const val MIN_KSP_VERSION = "1.0.27"
const val MIN_KOTLIN_VERSION = "2.0.0"
const val MIN_KSP_VERSION = "1.0.30"
const val MIN_KOTLIN_VERSION = "2.1.0"
}

override fun apply(project: Project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fun KSValueParameter.getParamAnnotationList(logger: KSPLogger): List<ParameterAn
}

ksValueParameter.getFieldMapAnnotation()?.let {
if (!ksValueParameter.type.toString().endsWith(KEY_MAP)) {
if (!ksValueParameter.type.toString().substringBefore("<").endsWith(KEY_MAP)) {
logger.error(KtorfitError.FIELD_MAP_PARAMETER_TYPE_MUST_BE_MAP, ksValueParameter)
}

Expand All @@ -182,7 +182,7 @@ fun KSValueParameter.getParamAnnotationList(logger: KSPLogger): List<ParameterAn
}

ksValueParameter.getPartMapAnnotation()?.let {
if (!ksValueParameter.type.toString().endsWith(KEY_MAP)) {
if (!ksValueParameter.type.toString().substringBefore("<").endsWith(KEY_MAP)) {
logger.error(KtorfitError.PART_MAP_PARAMETER_TYPE_MUST_BE_MAP, ksValueParameter)
}
paramAnnos.add(it)
Expand Down

0 comments on commit 3053312

Please sign in to comment.