diff --git a/gradle-plugin/build.gradle.kts b/gradle-plugin/build.gradle.kts index bd300b2b9..759caef20 100644 --- a/gradle-plugin/build.gradle.kts +++ b/gradle-plugin/build.gradle.kts @@ -3,6 +3,7 @@ plugins { kotlin("kapt") version("1.9.10") id("java-gradle-plugin") `maven-publish` + `kotlin-dsl` id("com.gradle.plugin-publish") version "1.2.1" } @@ -26,6 +27,10 @@ java { } } +dependencies { + add("compileOnly", kotlin("gradle-plugin")) +} + tasks.withType { kotlinOptions.jvmTarget = "1.8" } @@ -41,7 +46,7 @@ gradlePlugin { create("ktorfitPlugin") { id = "de.jensklingenberg.ktorfit" // users will do `apply plugin: "de.jensklingenberg.ktorfit"` - implementationClass = "de.jensklingenberg.ktorfit.gradle.KtorfitGradleSubPlugin" // entry-point class + implementationClass = "de.jensklingenberg.ktorfit.gradle.KtorfitGradlePlugin" // entry-point class displayName = "Ktorfit Gradle Plugin" description = "Gradle Plugin for Ktorfit" tags.set(listOf("http","kotlin","kotlin-mpp","ktor","rest")) @@ -49,20 +54,13 @@ gradlePlugin { } } -tasks.register("sourcesJar", Jar::class) { - group = "build" - description = "Assembles Kotlin sources" - archiveClassifier.set("sources") - from(sourceSets.main.get().allSource) - dependsOn(tasks.classes) -} publishing { publications { create("default") { from(components["java"]) - artifact(tasks["sourcesJar"]) + pom { name.set("ktorfit-gradle-plugin") diff --git a/gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradleSubPlugin.kt b/gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitCompilerSubPlugin.kt similarity index 73% rename from gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradleSubPlugin.kt rename to gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitCompilerSubPlugin.kt index 95a51b1b4..817014105 100644 --- a/gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradleSubPlugin.kt +++ b/gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitCompilerSubPlugin.kt @@ -7,31 +7,12 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerPluginSupportPlugin import org.jetbrains.kotlin.gradle.plugin.SubpluginArtifact import org.jetbrains.kotlin.gradle.plugin.SubpluginOption -open class KtorfitGradleConfiguration { - /** - * If the compiler plugin should be active - */ - var enabled: Boolean = true - - /** - * version number of the compiler plugin - */ - var version: String = "1.7.0" // remember to bump this version before any release! - - /** - * used to get debug information from the compiler plugin - */ - var logging: Boolean = false -} - - -class KtorfitGradleSubPlugin : KotlinCompilerPluginSupportPlugin { +internal class KtorfitCompilerSubPlugin : KotlinCompilerPluginSupportPlugin { companion object { const val SERIALIZATION_GROUP_NAME = "de.jensklingenberg.ktorfit" const val ARTIFACT_NAME = "compiler-plugin" const val COMPILER_PLUGIN_ID = "ktorfitPlugin" - const val GRADLE_TASKNAME = "ktorfit" } private lateinit var myproject: Project @@ -52,10 +33,8 @@ class KtorfitGradleSubPlugin : KotlinCompilerPluginSupportPlugin { private fun Project.getKtorfitConfig() = this.extensions.findByType(KtorfitGradleConfiguration::class.java) ?: KtorfitGradleConfiguration() - override fun apply(target: Project) { - target.extensions.create(GRADLE_TASKNAME, KtorfitGradleConfiguration::class.java) - myproject = target - super.apply(target) + override fun apply(project: Project) { + myproject = project } override fun getCompilerPluginId(): String = COMPILER_PLUGIN_ID diff --git a/gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradleConfiguration.kt b/gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradleConfiguration.kt new file mode 100644 index 000000000..debf1332f --- /dev/null +++ b/gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradleConfiguration.kt @@ -0,0 +1,19 @@ +package de.jensklingenberg.ktorfit.gradle + +open class KtorfitGradleConfiguration { + /** + * If the compiler plugin should be active + */ + var enabled: Boolean = true + + /** + * version number of the compiler plugin + */ + @Deprecated("Update the this Gradle plugin instead of updating this version") + var version: String = "1.7.0" // remember to bump this version before any release! + + /** + * used to get debug information from the compiler plugin + */ + var logging: Boolean = false +} \ No newline at end of file diff --git a/gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradlePlugin.kt b/gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradlePlugin.kt new file mode 100644 index 000000000..3c2ac5916 --- /dev/null +++ b/gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradlePlugin.kt @@ -0,0 +1,48 @@ +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 + + + +class KtorfitGradlePlugin : Plugin { + companion object { + const val GRADLE_TASKNAME = "ktorfit" + } + + private val Project.kotlinExtension: KotlinProjectExtension? + get() = this.extensions.findByType() + + override fun apply(project: Project) { + + with(project) { + extensions.create(GRADLE_TASKNAME, KtorfitGradleConfiguration::class.java) + + val flowConverterDependencyNotation = "de.jensklingenberg.ktorfit:ktorfit-converters-flow:1.7.0" + when (kotlinExtension) { + is KotlinSingleTargetExtension<*> -> { + dependencies { + add("implementation", flowConverterDependencyNotation) + } + } + + is KotlinMultiplatformExtension -> { + dependencies { + add("commonMainImplementation", flowConverterDependencyNotation) + } + } + + else -> { /* Do nothing */ + } + } + } + project.pluginManager.apply(KtorfitCompilerSubPlugin::class.java) + } + + +} \ No newline at end of file diff --git a/ktorfit-converters/flow/.gitignore b/ktorfit-converters/flow/.gitignore new file mode 100644 index 000000000..1571bfe97 --- /dev/null +++ b/ktorfit-converters/flow/.gitignore @@ -0,0 +1,2 @@ +/build +/.gradle/ diff --git a/ktorfit-converters/flow/api/android/flow.api b/ktorfit-converters/flow/api/android/flow.api new file mode 100644 index 000000000..cf6b24f91 --- /dev/null +++ b/ktorfit-converters/flow/api/android/flow.api @@ -0,0 +1,20 @@ +public final class de/jensklingenberg/ktorfit/converter/builtin/FlowConverterFactory : de/jensklingenberg/ktorfit/converter/Converter$Factory { + public fun ()V + public fun requestParameterConverter (Lkotlin/reflect/KClass;Lkotlin/reflect/KClass;)Lde/jensklingenberg/ktorfit/converter/Converter$RequestParameterConverter; + public fun responseConverter (Lde/jensklingenberg/ktorfit/internal/TypeData;Lde/jensklingenberg/ktorfit/Ktorfit;)Lde/jensklingenberg/ktorfit/converter/Converter$ResponseConverter; + public fun suspendResponseConverter (Lde/jensklingenberg/ktorfit/internal/TypeData;Lde/jensklingenberg/ktorfit/Ktorfit;)Lde/jensklingenberg/ktorfit/converter/Converter$SuspendResponseConverter; +} + +public final class de/jensklingenberg/ktorfit/converter/builtin/FlowResponseConverter : de/jensklingenberg/ktorfit/converter/request/ResponseConverter { + public fun ()V + public fun supportedType (Lde/jensklingenberg/ktorfit/internal/TypeData;Z)Z + public fun wrapResponse (Lde/jensklingenberg/ktorfit/internal/TypeData;Lkotlin/jvm/functions/Function1;Lde/jensklingenberg/ktorfit/Ktorfit;)Ljava/lang/Object; +} + +public final class de/jensklingenberg/ktorfit/converters/flow/BuildConfig { + public static final field BUILD_TYPE Ljava/lang/String; + public static final field DEBUG Z + public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String; + public fun ()V +} + diff --git a/ktorfit-converters/flow/api/jvm/flow.api b/ktorfit-converters/flow/api/jvm/flow.api new file mode 100644 index 000000000..1b1952aa6 --- /dev/null +++ b/ktorfit-converters/flow/api/jvm/flow.api @@ -0,0 +1,13 @@ +public final class de/jensklingenberg/ktorfit/converter/builtin/FlowConverterFactory : de/jensklingenberg/ktorfit/converter/Converter$Factory { + public fun ()V + public fun requestParameterConverter (Lkotlin/reflect/KClass;Lkotlin/reflect/KClass;)Lde/jensklingenberg/ktorfit/converter/Converter$RequestParameterConverter; + public fun responseConverter (Lde/jensklingenberg/ktorfit/internal/TypeData;Lde/jensklingenberg/ktorfit/Ktorfit;)Lde/jensklingenberg/ktorfit/converter/Converter$ResponseConverter; + public fun suspendResponseConverter (Lde/jensklingenberg/ktorfit/internal/TypeData;Lde/jensklingenberg/ktorfit/Ktorfit;)Lde/jensklingenberg/ktorfit/converter/Converter$SuspendResponseConverter; +} + +public final class de/jensklingenberg/ktorfit/converter/builtin/FlowResponseConverter : de/jensklingenberg/ktorfit/converter/request/ResponseConverter { + public fun ()V + public fun supportedType (Lde/jensklingenberg/ktorfit/internal/TypeData;Z)Z + public fun wrapResponse (Lde/jensklingenberg/ktorfit/internal/TypeData;Lkotlin/jvm/functions/Function1;Lde/jensklingenberg/ktorfit/Ktorfit;)Ljava/lang/Object; +} + diff --git a/ktorfit-converters/flow/build.gradle.kts b/ktorfit-converters/flow/build.gradle.kts new file mode 100644 index 000000000..6c1ec33d2 --- /dev/null +++ b/ktorfit-converters/flow/build.gradle.kts @@ -0,0 +1,174 @@ +plugins { + kotlin("multiplatform") + id("maven-publish") + id("signing") + id("com.vanniktech.maven.publish") + id("com.android.library") + id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2" + id("app.cash.licensee") +} + +licensee { + allow("Apache-2.0") + allow("MIT") +} + + +val enableSigning = project.hasProperty("ORG_GRADLE_PROJECT_signingInMemoryKey") + +mavenPublishing { + + coordinates( + "de.jensklingenberg.ktorfit", + "ktorfit-converters-flow", + libs.versions.ktorfit.asProvider().get() + ) + publishToMavenCentral() + // publishToMavenCentral(SonatypeHost.S01) for publishing through s01.oss.sonatype.org + if (enableSigning) { + signAllPublications() + } +} + +tasks.withType { + kotlinOptions.jvmTarget = "1.8" +} + + +kotlin { + explicitApi() + jvm { + + } + js(IR) { + this.nodejs() + binaries.executable() // not applicable to BOTH, see details below + } + androidTarget { + publishLibraryVariants("release", "debug") + } + iosArm64() + iosX64() + iosSimulatorArm64() + + watchosArm32() + watchosArm64() + watchosX64() + watchosSimulatorArm64() + tvosArm64() + tvosX64() + tvosSimulatorArm64() + macosX64() + macosArm64() + linuxX64 { + binaries { + executable() + } + } + + ios("ios") { + binaries { + framework { + baseName = "library" + } + } + } + mingwX64() + sourceSets { + val commonMain by getting { + dependencies { + implementation(projects.ktorfitLibCommon) + } + } + val linuxX64Main by getting + val mingwX64Main by getting + val androidMain by getting + val jvmMain by getting + val iosX64Main by getting + val iosArm64Main by getting + val iosSimulatorArm64Main by getting + val jsMain by getting + val iosMain by getting { + dependsOn(commonMain) + iosX64Main.dependsOn(this) + iosArm64Main.dependsOn(this) + iosSimulatorArm64Main.dependsOn(this) + dependencies { + + } + } + } +} +val javadocJar by tasks.registering(Jar::class) { + archiveClassifier.set("javadoc") +} + +android { + compileSdk = 33 + sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") + defaultConfig { + minSdk = 21 + targetSdk = 33 + } + namespace = "de.jensklingenberg.ktorfit.converters.flow" +} + + + +publishing { + publications { + create("default") { + artifact(tasks["sourcesJar"]) + // artifact(tasks["javadocJar"]) + + pom { + name.set(project.name) + description.set("Flow Converter for Ktorfit") + url.set("https://github.com/Foso/Ktorfit") + + licenses { + license { + name.set("Apache License 2.0") + url.set("https://github.com/Foso/Ktorfit/blob/master/LICENSE.txt") + } + } + scm { + url.set("https://github.com/Foso/Ktorfit") + connection.set("scm:git:git://github.com/Foso/Ktorfit.git") + } + developers { + developer { + name.set("Jens Klingenberg") + url.set("https://github.com/Foso") + } + } + } + } + } + + repositories { + if ( + hasProperty("sonatypeUsername") && + hasProperty("sonatypePassword") && + hasProperty("sonatypeSnapshotUrl") && + hasProperty("sonatypeReleaseUrl") + ) { + maven { + val url = when { + "SNAPSHOT" in version.toString() -> property("sonatypeSnapshotUrl") + else -> property("sonatypeReleaseUrl") + } as String + setUrl(url) + credentials { + username = property("sonatypeUsername") as String + password = property("sonatypePassword") as String + } + } + } + + } +} + +rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class) { + rootProject.the(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension::class).nodeVersion = "18.0.0" +} diff --git a/ktorfit-converters/flow/gradle.properties b/ktorfit-converters/flow/gradle.properties new file mode 100644 index 000000000..91491e996 --- /dev/null +++ b/ktorfit-converters/flow/gradle.properties @@ -0,0 +1 @@ +kotlin.mpp.androidSourceSetLayoutVersion=2 \ No newline at end of file diff --git a/ktorfit-converters/flow/src/androidMain/AndroidManifest.xml b/ktorfit-converters/flow/src/androidMain/AndroidManifest.xml new file mode 100644 index 000000000..568741e54 --- /dev/null +++ b/ktorfit-converters/flow/src/androidMain/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ktorfit-lib-common/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/FlowConverterFactory.kt b/ktorfit-converters/flow/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/FlowConverterFactory.kt similarity index 100% rename from ktorfit-lib-common/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/FlowConverterFactory.kt rename to ktorfit-converters/flow/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/FlowConverterFactory.kt diff --git a/ktorfit-lib-common/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/FlowResponseConverter.kt b/ktorfit-converters/flow/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/FlowResponseConverter.kt similarity index 96% rename from ktorfit-lib-common/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/FlowResponseConverter.kt rename to ktorfit-converters/flow/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/FlowResponseConverter.kt index 6ad1cc1c4..9848ae34d 100644 --- a/ktorfit-lib-common/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/FlowResponseConverter.kt +++ b/ktorfit-converters/flow/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/FlowResponseConverter.kt @@ -11,6 +11,7 @@ import kotlinx.coroutines.flow.flow /** * Converter to enable the use of Flow<> as return type */ +@Deprecated("Use FlowConverterFactory") public class FlowResponseConverter : ResponseConverter { override fun supportedType(typeData: TypeData, isSuspend: Boolean): Boolean { diff --git a/ktorfit-lib-common/api/android/ktorfit-lib-common.api b/ktorfit-lib-common/api/android/ktorfit-lib-common.api index a6f1f7a6f..dd3fce3a7 100644 --- a/ktorfit-lib-common/api/android/ktorfit-lib-common.api +++ b/ktorfit-lib-common/api/android/ktorfit-lib-common.api @@ -136,19 +136,6 @@ public final class de/jensklingenberg/ktorfit/converter/builtin/CallResponseConv public fun wrapSuspendResponse (Lde/jensklingenberg/ktorfit/internal/TypeData;Lkotlin/jvm/functions/Function1;Lde/jensklingenberg/ktorfit/Ktorfit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } -public final class de/jensklingenberg/ktorfit/converter/builtin/FlowConverterFactory : de/jensklingenberg/ktorfit/converter/Converter$Factory { - public fun ()V - public fun requestParameterConverter (Lkotlin/reflect/KClass;Lkotlin/reflect/KClass;)Lde/jensklingenberg/ktorfit/converter/Converter$RequestParameterConverter; - public fun responseConverter (Lde/jensklingenberg/ktorfit/internal/TypeData;Lde/jensklingenberg/ktorfit/Ktorfit;)Lde/jensklingenberg/ktorfit/converter/Converter$ResponseConverter; - public fun suspendResponseConverter (Lde/jensklingenberg/ktorfit/internal/TypeData;Lde/jensklingenberg/ktorfit/Ktorfit;)Lde/jensklingenberg/ktorfit/converter/Converter$SuspendResponseConverter; -} - -public final class de/jensklingenberg/ktorfit/converter/builtin/FlowResponseConverter : de/jensklingenberg/ktorfit/converter/request/ResponseConverter { - public fun ()V - public fun supportedType (Lde/jensklingenberg/ktorfit/internal/TypeData;Z)Z - public fun wrapResponse (Lde/jensklingenberg/ktorfit/internal/TypeData;Lkotlin/jvm/functions/Function1;Lde/jensklingenberg/ktorfit/Ktorfit;)Ljava/lang/Object; -} - public abstract interface class de/jensklingenberg/ktorfit/converter/request/CoreResponseConverter { public abstract fun supportedType (Lde/jensklingenberg/ktorfit/internal/TypeData;Z)Z } diff --git a/ktorfit-lib-common/api/jvm/ktorfit-lib-common.api b/ktorfit-lib-common/api/jvm/ktorfit-lib-common.api index bcf049ecb..f15a6ebe8 100644 --- a/ktorfit-lib-common/api/jvm/ktorfit-lib-common.api +++ b/ktorfit-lib-common/api/jvm/ktorfit-lib-common.api @@ -129,19 +129,6 @@ public final class de/jensklingenberg/ktorfit/converter/builtin/CallResponseConv public fun wrapSuspendResponse (Lde/jensklingenberg/ktorfit/internal/TypeData;Lkotlin/jvm/functions/Function1;Lde/jensklingenberg/ktorfit/Ktorfit;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } -public final class de/jensklingenberg/ktorfit/converter/builtin/FlowConverterFactory : de/jensklingenberg/ktorfit/converter/Converter$Factory { - public fun ()V - public fun requestParameterConverter (Lkotlin/reflect/KClass;Lkotlin/reflect/KClass;)Lde/jensklingenberg/ktorfit/converter/Converter$RequestParameterConverter; - public fun responseConverter (Lde/jensklingenberg/ktorfit/internal/TypeData;Lde/jensklingenberg/ktorfit/Ktorfit;)Lde/jensklingenberg/ktorfit/converter/Converter$ResponseConverter; - public fun suspendResponseConverter (Lde/jensklingenberg/ktorfit/internal/TypeData;Lde/jensklingenberg/ktorfit/Ktorfit;)Lde/jensklingenberg/ktorfit/converter/Converter$SuspendResponseConverter; -} - -public final class de/jensklingenberg/ktorfit/converter/builtin/FlowResponseConverter : de/jensklingenberg/ktorfit/converter/request/ResponseConverter { - public fun ()V - public fun supportedType (Lde/jensklingenberg/ktorfit/internal/TypeData;Z)Z - public fun wrapResponse (Lde/jensklingenberg/ktorfit/internal/TypeData;Lkotlin/jvm/functions/Function1;Lde/jensklingenberg/ktorfit/Ktorfit;)Ljava/lang/Object; -} - public abstract interface class de/jensklingenberg/ktorfit/converter/request/CoreResponseConverter { public abstract fun supportedType (Lde/jensklingenberg/ktorfit/internal/TypeData;Z)Z } diff --git a/ktorfit-lib-common/build.gradle.kts b/ktorfit-lib-common/build.gradle.kts index 3ff6667c8..21dbf41b5 100644 --- a/ktorfit-lib-common/build.gradle.kts +++ b/ktorfit-lib-common/build.gradle.kts @@ -109,25 +109,10 @@ kotlin { implementation(libs.kotlin.test) } } - val linuxX64Main by getting { - dependencies { - } - } - val mingwX64Main by getting { - dependencies { - - } - } - val androidMain by getting { - dependencies { - - } - } - val jvmMain by getting { - dependencies { - - } - } + val linuxX64Main by getting + val mingwX64Main by getting + val androidMain by getting + val jvmMain by getting val jvmTest by getting { dependencies { kotlin.srcDir("build/generated/ksp/jvm/jvmTest/") @@ -143,20 +128,13 @@ kotlin { val iosX64Main by getting val iosArm64Main by getting val iosSimulatorArm64Main by getting - val jsMain by getting { - dependencies { - - } - } - + val jsMain by getting val iosMain by getting { dependsOn(commonMain) iosX64Main.dependsOn(this) iosArm64Main.dependsOn(this) iosSimulatorArm64Main.dependsOn(this) - dependencies { - - } + dependencies {} } } } diff --git a/ktorfit-lib-common/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/CallResponseConverter.kt b/ktorfit-lib-common/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/CallResponseConverter.kt index a9342a5c9..4f6b4c1d5 100644 --- a/ktorfit-lib-common/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/CallResponseConverter.kt +++ b/ktorfit-lib-common/src/commonMain/kotlin/de/jensklingenberg/ktorfit/converter/builtin/CallResponseConverter.kt @@ -12,6 +12,7 @@ import io.ktor.util.reflect.* import kotlinx.coroutines.async import kotlinx.coroutines.launch +@Deprecated("Use CallConverterFactory") public class CallResponseConverter : SuspendResponseConverter, ResponseConverter { override suspend fun wrapSuspendResponse( diff --git a/sandbox/build.gradle.kts b/sandbox/build.gradle.kts index 473febe7f..d0fd029f7 100644 --- a/sandbox/build.gradle.kts +++ b/sandbox/build.gradle.kts @@ -57,6 +57,7 @@ kotlin { dependencies { implementation(projects.ktorfitLibCommon) + implementation(projects.ktorfitConverters.flow) implementation(libs.kotlinx.coroutines.core) implementation(libs.ktor.client.serialization) implementation(libs.ktor.client.content.negotiation) diff --git a/sandbox/src/jvmMain/kotlin/de/jensklingenberg/ktorfit/demo/CreateIssue.kt b/sandbox/src/jvmMain/kotlin/de/jensklingenberg/ktorfit/demo/CreateIssue.kt index a360c5909..7dd341d72 100644 --- a/sandbox/src/jvmMain/kotlin/de/jensklingenberg/ktorfit/demo/CreateIssue.kt +++ b/sandbox/src/jvmMain/kotlin/de/jensklingenberg/ktorfit/demo/CreateIssue.kt @@ -2,7 +2,6 @@ package de.jensklingenberg.ktorfit.demo import com.example.api.GithubService import de.jensklingenberg.ktorfit.converter.builtin.FlowResponseConverter -import de.jensklingenberg.ktorfit.create import de.jensklingenberg.ktorfit.ktorfit import io.ktor.client.* import io.ktor.client.plugins.contentnegotiation.* diff --git a/sandbox/src/jvmMain/kotlin/de/jensklingenberg/ktorfit/demo/JvMMain.kt b/sandbox/src/jvmMain/kotlin/de/jensklingenberg/ktorfit/demo/JvMMain.kt index 0541e7950..3ca8577fa 100644 --- a/sandbox/src/jvmMain/kotlin/de/jensklingenberg/ktorfit/demo/JvMMain.kt +++ b/sandbox/src/jvmMain/kotlin/de/jensklingenberg/ktorfit/demo/JvMMain.kt @@ -4,7 +4,6 @@ package de.jensklingenberg.ktorfit.demo import com.example.UserFactory import com.example.api.JsonPlaceHolderApi import com.example.model.ExampleApi -import de.jensklingenberg.ktorfit.converter.builtin.CallResponseConverter import de.jensklingenberg.ktorfit.converter.builtin.FlowConverterFactory import de.jensklingenberg.ktorfit.ktorfit import io.ktor.client.* @@ -36,7 +35,6 @@ val jvmClient = HttpClient { val jvmKtorfit = ktorfit { baseUrl(JsonPlaceHolderApi.baseUrl) httpClient(jvmClient) - responseConverter(CallResponseConverter()) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 93eb31fc1..0d20b0ee3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -27,7 +27,7 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") rootProject.name = "Ktorfit" includeBuild("gradle-plugin") { dependencySubstitution { - substitute(module("de.jensklingenberg.ktorfit:gradle-plugin:1.0.0")).using(project(":")) + substitute(module("de.jensklingenberg.ktorfit:gradle-plugin:1.7.0")).using(project(":")) } } include(":sandbox") @@ -36,5 +36,6 @@ include(":compiler-plugin") include(":ktorfit-lib-common") include(":ktorfit-lib") include(":ktorfit-annotations") +include(":ktorfit-converters:flow") //./gradlew clean :ktorfit-annotations:publishToMavenLocal :ktorfit-ksp:publishToMavenLocal :ktorfit-lib:publishToMavenLocal :ktorfit-lib-common:publishToMavenLocal :compiler-plugin:publishToMavenLocal \ No newline at end of file