Skip to content

Commit

Permalink
Release 2.0.0 (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso authored May 27, 2024
1 parent bb15128 commit 962e438
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 60 deletions.
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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.

2.0.0 - 2024-XX-XX
2.0.0 - 2024-05-27
========================================
### Changed
- Build with KSP 1.0.21, Kotlin 2.0.0, Ktor 2.3.11
Expand Down
21 changes: 9 additions & 12 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@ inspired by [Retrofit](https://square.github.io/retrofit/)

## Compatibility

| Ktorfit-version | Kotlin | KSP | Ktor |
|-------------------|:-------------:|:----------:|:----------:|
| **_2.0.0** | **2.0.0** | **1.0.20** | **2.3.11** |
| **_2.0.0-rc01_** | **2.0.0-RC3** | **1.0.20** | **2.3.11** |
| **_2.0.0-beta1_** | **2.0.0-RC1** | **1.0.20** | **2.3.10** |
| **_1.14.0_** | **2.0.0-RC1** | **1.0.20** | **2.3.10** |
| **_1.13.0_** | **1.9.23** | **1.0.20** | **2.3.10** |
| **_1.12.0_** | **1.9.22** | **1.0.16** | **2.3.6** |
| **_1.11.0_** | **1.9.21** | **1.0.15** | **2.3.6** |
| **_1.10.2_** | **1.9.20** | **1.0.14** | **2.3.6** |
| **_1.10.1_** | **1.9.20** | **1.0.14** | **2.3.4** |
| **_1.10.0_** | **1.9.20** | **1.0.14** | **2.3.4** |
| Ktorfit-version | Kotlin | KSP | Ktor |
|-------------------|:-------------:|:------------:|:----------:|
| **_2.0.0** | **>=2.0.0** | **>=1.0.21** | **2.3.11** |
| **_2.0.0-rc01_** | **2.0.0-RC3** | **1.0.20** | **2.3.11** |
| **_2.0.0-beta1_** | **2.0.0-RC1** | **1.0.20** | **2.3.10** |
| **_1.14.0_** | **2.0.0-RC1** | **1.0.20** | **2.3.10** |
| **_1.13.0_** | **1.9.23** | **1.0.20** | **2.3.10** |
| **_1.12.0_** | **1.9.22** | **1.0.16** | **2.3.6** |



# Installation
Expand Down
14 changes: 6 additions & 8 deletions example/AndroidOnlyExample/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp") version "1.9.23-1.0.20"
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.23"
id("de.jensklingenberg.ktorfit") version "2.0.0-beta2-SNAPSHOT"
id("com.google.devtools.ksp") version "2.0.0-1.0.21"
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.0"
id("de.jensklingenberg.ktorfit") version "2.0.0"
id("org.jetbrains.kotlin.plugin.compose") version "2.0.0"

}


Expand Down Expand Up @@ -40,9 +42,6 @@ android {
buildFeatures {
compose = (true)
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.11"
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
Expand All @@ -51,11 +50,10 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach
}
}

val ktorfit = "2.0.0-beta2-SNAPSHOT"
val ktorfit = "2.0.0"
val ktor = "2.3.10"
val compose_ui_version = "1.5.1"
dependencies {
ksp("de.jensklingenberg.ktorfit:ktorfit-ksp:$ktorfit")
implementation("de.jensklingenberg.ktorfit:ktorfit-lib:$ktorfit")
implementation("io.ktor:ktor-client-serialization:$ktor")
implementation("io.ktor:ktor-client-content-negotiation:$ktor")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ val ktorfit = ktorfit {
)

}
val api = ktorfit.createStarWarsApi()

class MainActivity : ComponentActivity() {

Expand All @@ -57,8 +58,9 @@ class MainActivity : ComponentActivity() {
}
}


lifecycleScope.launch {
peopleState.value = ktorfit.create<StarWarsApi>().getPerson(1)
peopleState.value = api.getPerson(1)
}
}
}
2 changes: 1 addition & 1 deletion example/AndroidOnlyExample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
plugins {
id 'com.android.application' version '8.0.2' apply false
id 'com.android.library' version '8.0.2' apply false
id 'org.jetbrains.kotlin.android' version '1.9.23' apply false
id 'org.jetbrains.kotlin.android' version '2.0.0' apply false
}
27 changes: 6 additions & 21 deletions example/MultiplatformExample/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ plugins {
id("com.android.library")
id("com.google.devtools.ksp") version "2.0.0-1.0.21"
id("kotlinx-serialization")
id("de.jensklingenberg.ktorfit") version "2.0.0-SNAPSHOT"
id("de.jensklingenberg.ktorfit") version "2.0.0"
}

ktorfit {
errorCheckingMode = ErrorCheckingMode.WARNING
generateQualifiedTypeName = false
}

version = "1.0"
val ktorVersion = "2.3.10"
val ktorfitVersion = "2.0.0-beta2-SNAPSHOT"
val ktorfitVersion = "2.0.0"

kotlin {
jvmToolchain(8)
Expand Down Expand Up @@ -76,25 +80,6 @@ android {
}
}

dependencies {
with("de.jensklingenberg.ktorfit:ktorfit-ksp:$ktorfitVersion") {
add("kspCommonMainMetadata", this)
add("kspJvm", this)
add("kspJvmTest", this)
add("kspAndroid", this)
add("kspAndroidTest", this)
add("kspIosX64", this)
add("kspIosX64Test", this)
add("kspIosArm64", this)
add("kspIosArm64Test", this)
add("kspIosSimulatorArm64", this)
add("kspIosSimulatorArm64Test", this)
add("kspMacosX64", this)
add("kspMacosX64Test", this)
add("kspJs", this)
add("kspJsTest", this)
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ package com.example.ktorfittest
import de.jensklingenberg.ktorfit.converter.CallConverterFactory
import de.jensklingenberg.ktorfit.converter.FlowConverterFactory
import de.jensklingenberg.ktorfit.ktorfit
import io.ktor.client.HttpClient
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
import io.ktor.serialization.kotlinx.json.json
import io.ktor.client.*
import io.ktor.client.plugins.contentnegotiation.*
import io.ktor.serialization.kotlinx.json.*
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
Expand All @@ -26,7 +26,7 @@ val ktorfit = ktorfit {
}


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

class Greeting {
fun greeting(): String {
Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ kotlin = "2.0.0"
kotlinPoet = "1.16.0"
kspVersion = "2.0.0-1.0.21"

ktorfit = "2.0.0-rc01"
ktorfit = "2.0.0"
ktorfitKsp = "2.0.0-1.0.21"
ktorfitCompiler = "2.0.0-2.0.0"
ktorfitCallConverter = "2.0.0-rc01"
ktorfitFlowConverter = "2.0.0-rc01"
ktorfitResponseConverter = "2.0.0-rc01"
ktorfitGradle = "2.0.0-SNAPSHOT"
ktorfitCallConverter = "2.0.0"
ktorfitFlowConverter = "2.0.0"
ktorfitResponseConverter = "2.0.0"
ktorfitGradle = "2.0.0"

ktorfitGradlePlugin = "1.14.0"
ktorVersion = "2.3.11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package de.jensklingenberg.ktorfit.gradle
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.findByType
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinSingleTargetExtension
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
Expand All @@ -18,7 +16,7 @@ class KtorfitGradlePlugin : Plugin<Project> {
const val ARTIFACT_NAME = "compiler-plugin"
const val COMPILER_PLUGIN_ID = "ktorfitPlugin"
const val KTORFIT_VERSION = "2.0.0" // remember to bump this version before any release!
const val SNAPSHOT = "-SNAPSHOT"
const val SNAPSHOT = ""
const val MIN_KSP_VERSION = "1.0.21"
const val MIN_KOTLIN_VERSION = "2.0.0"
}
Expand Down Expand Up @@ -79,6 +77,16 @@ class KtorfitGradlePlugin : Plugin<Project> {
}
}", dependency
)

dependencies.add(
"ksp${
targetName.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(
US
) else it.toString()
}
}Test", dependency
)
}

kotlinExtension.sourceSets.named("commonMain").configure {
Expand Down Expand Up @@ -108,8 +116,5 @@ class KtorfitGradlePlugin : Plugin<Project> {

}

private val Project.kotlinExtension: KotlinProjectExtension?
get() = this.extensions.findByType<KotlinProjectExtension>()

internal fun Project.getKtorfitConfig() =
this.extensions.findByType(KtorfitGradleConfiguration::class.java) ?: KtorfitGradleConfiguration()
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extra:
site:
images: '../../images'
ktorfit:
release: "2.0.0-rc01"
release: "2.0.0"
ktor:
release: "2.3.11"
social:
Expand Down

0 comments on commit 962e438

Please sign in to comment.