Skip to content

Commit

Permalink
Fix publishing (#5433)
Browse files Browse the repository at this point in the history
* fix publishing

* Revert "version is now 4.0.0-beta.4-SNAPSHOT (#5429)"

This reverts commit b69ed1c.

* fix ksp
  • Loading branch information
martinbonnin committed Dec 5, 2023
1 parent b69ed1c commit b6606e4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
18 changes: 18 additions & 0 deletions build-logic/src/main/kotlin/Publishing.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import com.android.build.api.dsl.LibraryExtension
import com.android.build.gradle.BaseExtension
import kotlinx.coroutines.runBlocking
Expand Down Expand Up @@ -270,6 +271,23 @@ private fun Project.configurePublishingInternal() {
tasks.withType(Sign::class.java).configureEach {
isEnabled = !System.getenv("GPG_PRIVATE_KEY").isNullOrBlank()
}

// https://github.com/gradle/gradle/issues/26132
afterEvaluate {
tasks.all {
if (name.startsWith("compileTestKotlin")) {
val target = name.substring("compileTestKotlin".length)
val sign = try {
tasks.named("sign${target}Publication")
} catch (e: Throwable) {
null
}
if (sign != null) {
dependsOn(sign)
}
}
}
}
}


Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Publishing defaults, could ultimately be moved to build scripts
GROUP=com.apollographql.apollo3
VERSION_NAME=4.0.0-beta.4-SNAPSHOT
VERSION_NAME=4.0.0-beta.3

POM_URL=https://github.com/apollographql/apollo-kotlin/
POM_SCM_URL=https://github.com/apollographql/apollo-kotlin/
Expand Down
2 changes: 1 addition & 1 deletion gradle/libraries.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android-sdkversion-benchmark-min = "24"
android-sdkversion-target = "30"
androidx-sqlite = "2.3.1"
# This is used by the gradle integration tests to get the artifacts locally
apollo = "4.0.0-beta.4-SNAPSHOT"
apollo = "4.0.0-beta.3"
# Used by the apollo-tooling project which uses a published version of Apollo
apollo-published = "4.0.0-beta.2"
cache = "2.0.2"
Expand Down
1 change: 1 addition & 0 deletions libraries/apollo-adapters/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ kotlin {
dependencies {
api(project(":apollo-api"))
api(libs.kotlinx.datetime)
api(project(":apollo-annotations"))
}
}
findByName("jsMain")?.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ internal class NormalizedCache(
internal class GraphQLRecord(
private val record: Record,
) {
fun key() = record.key
fun key(): String = record.key

fun fields() = record.fields
fun fields(): Map<String, Any?> = record.fields

fun sizeInBytes() = record.sizeInBytes
fun sizeInBytes(): Int = record.sizeInBytes
}

@GraphQLAdapter(forScalar = "Fields")
Expand Down

0 comments on commit b6606e4

Please sign in to comment.