Skip to content

Commit

Permalink
Set Snapshot version
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso committed Apr 27, 2024
1 parent ce3ef2e commit 56adf91
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 19 deletions.
2 changes: 0 additions & 2 deletions ktorfit-annotations/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ kotlin {
tvosArm64()
tvosX64()
tvosSimulatorArm64()
@OptIn(ExperimentalWasmDsl::class)
wasmJs()
macosX64()
macosArm64()
linuxX64 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ internal class KtorfitCompilerSubPlugin : KotlinCompilerPluginSupportPlugin {
private fun Project.getKtorfitConfig() =
this.extensions.findByType(KtorfitGradleConfiguration::class.java) ?: KtorfitGradleConfiguration()

override fun apply(project: Project) {
myproject = project
override fun apply(target: Project) {
myproject = target
}

override fun getCompilerPluginId(): String = COMPILER_PLUGIN_ID
Expand All @@ -43,10 +43,11 @@ internal class KtorfitCompilerSubPlugin : KotlinCompilerPluginSupportPlugin {
}

override fun getPluginArtifact(): SubpluginArtifact {
myproject.getKtorfitConfig()
return SubpluginArtifact(
groupId = SERIALIZATION_GROUP_NAME,
artifactId = ARTIFACT_NAME,
version = myproject.getKtorfitConfig().version
version = "2.0.0-SNAPSHOT" // remember to bump this version before any release!
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ open class KtorfitGradleConfiguration {
*/
internal var enabled: Boolean = true

/**
* version number of the compiler plugin
*/
internal var version: String = "2.0.0-SNAPSHOT" // remember to bump this version before any release!

/**
* used to get debug information from the compiler plugin
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@ package de.jensklingenberg.ktorfit.gradle

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.findByType
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension

class KtorfitGradlePlugin : Plugin<Project> {
companion object {
const val GRADLE_TASKNAME = "ktorfit"
}

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

private fun Project.getKtorfitConfig() =
this.extensions.findByType(KtorfitGradleConfiguration::class.java) ?: KtorfitGradleConfiguration()

override fun apply(project: Project) {
project.pluginManager.apply(KtorfitCompilerSubPlugin::class.java)
}
Expand Down
3 changes: 2 additions & 1 deletion sandbox/src/commonMain/kotlin/com/example/UserFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import de.jensklingenberg.ktorfit.Ktorfit
import de.jensklingenberg.ktorfit.converter.Converter
import de.jensklingenberg.ktorfit.converter.KtorfitResult
import de.jensklingenberg.ktorfit.converter.TypeData
import de.jensklingenberg.ktorfit.internal.KtorfitConverterHelper
import io.ktor.client.call.*
import io.ktor.client.statement.*

Expand All @@ -19,7 +20,7 @@ class UserFactory : Converter.Factory {
return object : Converter.SuspendResponseConverter<HttpResponse, Any> {

override suspend fun convert(result: KtorfitResult): Any {
return when (result) {
when (result) {
is KtorfitResult.Success -> {
val response = result.response
val envelope = response.body<Envelope>()
Expand Down

0 comments on commit 56adf91

Please sign in to comment.