From 883f15eba7edf1a05f8e88280e0b1cb99460a946 Mon Sep 17 00:00:00 2001 From: Jens Klingenberg Date: Tue, 10 May 2022 17:26:59 +0200 Subject: [PATCH] v1.0.0-beta06 --- CHANGELOG.md | 4 ++++ example/AndroidOnlyExample/app/build.gradle | 4 ++-- example/MultiplatformExample/shared/build.gradle.kts | 4 ++-- ktorfit-ksp/build.gradle.kts | 2 +- .../de/jensklingenberg/ktorfit/parser/ClassParser.kt | 9 +++++++-- ktorfit-lib/build.gradle.kts | 2 +- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f03697ca8..4802edd18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +1.0.0-beta05 +======================================== +- fix issue with KSP 1.0.5 #19 + 1.0.0-beta05 ======================================== - fixed: Custom Http Method with @Body is now possible #6 diff --git a/example/AndroidOnlyExample/app/build.gradle b/example/AndroidOnlyExample/app/build.gradle index 9c4196258..8abde017d 100644 --- a/example/AndroidOnlyExample/app/build.gradle +++ b/example/AndroidOnlyExample/app/build.gradle @@ -50,8 +50,8 @@ android { } dependencies { - ksp('de.jensklingenberg.ktorfit:ktorfit-ksp:1.0.0-beta05') - implementation("de.jensklingenberg.ktorfit:ktorfit-lib:1.0.0-beta05") + ksp('de.jensklingenberg.ktorfit:ktorfit-ksp:1.0.0-beta06') + implementation("de.jensklingenberg.ktorfit:ktorfit-lib:1.0.0-beta06") implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1' implementation 'androidx.activity:activity-compose:1.4.0' diff --git a/example/MultiplatformExample/shared/build.gradle.kts b/example/MultiplatformExample/shared/build.gradle.kts index 9db710b7a..d4a89a9b3 100644 --- a/example/MultiplatformExample/shared/build.gradle.kts +++ b/example/MultiplatformExample/shared/build.gradle.kts @@ -2,14 +2,14 @@ plugins { kotlin("multiplatform") kotlin("native.cocoapods") id("com.android.library") - id("com.google.devtools.ksp") version "1.6.20-1.0.4" + id("com.google.devtools.ksp") version "1.6.21-1.0.5" id("kotlinx-serialization") } version = "1.0" val ktorVersion = "2.0.1" -val ktorfitVersion = "1.0.0-beta05" +val ktorfitVersion = "1.0.0-beta06" kotlin { android() diff --git a/ktorfit-ksp/build.gradle.kts b/ktorfit-ksp/build.gradle.kts index 819008b25..4898144a0 100644 --- a/ktorfit-ksp/build.gradle.kts +++ b/ktorfit-ksp/build.gradle.kts @@ -15,7 +15,7 @@ tasks.withType { group = "de.jensklingenberg.ktorfit" -version = "1.0.0-beta05" +version = "1.0.0-beta06" dependencies { implementation("com.google.devtools.ksp:symbol-processing-api:$kspVersion") diff --git a/ktorfit-ksp/src/main/kotlin/de/jensklingenberg/ktorfit/parser/ClassParser.kt b/ktorfit-ksp/src/main/kotlin/de/jensklingenberg/ktorfit/parser/ClassParser.kt index bfdf2c91b..ad5559464 100644 --- a/ktorfit-ksp/src/main/kotlin/de/jensklingenberg/ktorfit/parser/ClassParser.kt +++ b/ktorfit-ksp/src/main/kotlin/de/jensklingenberg/ktorfit/parser/ClassParser.kt @@ -7,6 +7,7 @@ import de.jensklingenberg.ktorfit.ktorfitError import de.jensklingenberg.ktorfit.model.ClassData import de.jensklingenberg.ktorfit.model.FunctionData import de.jensklingenberg.ktorfit.model.KtorfitError.Companion.INTERFACE_NEEDS_TO_HAVE_A_PACKAGE +import de.jensklingenberg.ktorfit.resolveTypeName import java.io.File @@ -40,14 +41,18 @@ private fun MutableList.addIfAbsent(text: String) { fun toClassData(ksClassDeclaration: KSClassDeclaration, logger: KSPLogger): ClassData { - val functionDataList: List = getFunctionDataList(ksClassDeclaration.getDeclaredFunctions().toList(), logger) + val functionDataList: List = + getFunctionDataList(ksClassDeclaration.getDeclaredFunctions().toList(), logger) val imports = getImports(ksClassDeclaration) val packageName = ksClassDeclaration.packageName.asString() val className = ksClassDeclaration.simpleName.asString() val supertypes = - ksClassDeclaration.superTypes.toList().mapNotNull { it.resolve().declaration.qualifiedName?.asString() } + ksClassDeclaration.superTypes.toList().filterNot { + /** In KSP Any is a supertype of an interface */ + it.resolve().resolveTypeName() == "Any" + }.mapNotNull { it.resolve().declaration.qualifiedName?.asString() } val properties = ksClassDeclaration.getAllProperties().toList() if (packageName.isEmpty()) { diff --git a/ktorfit-lib/build.gradle.kts b/ktorfit-lib/build.gradle.kts index 2fe22d416..5c4779ca4 100644 --- a/ktorfit-lib/build.gradle.kts +++ b/ktorfit-lib/build.gradle.kts @@ -14,7 +14,7 @@ tasks.withType { kotlinOptions.jvmTarget = "1.8" } -version = "1.0.0-beta05" +version = "1.0.0-beta06" val ktorVersion = "2.0.1" kotlin {