Skip to content

Commit

Permalink
Merge commit 'b8e8bdba951b1cb9beecabfc80433d848b2c921b' into release-…
Browse files Browse the repository at this point in the history
…ios12-compat

* commit 'b8e8bdba951b1cb9beecabfc80433d848b2c921b': (38 commits)
  release 3.8.5
  Fix mapping of the builtin Float scalar type (apollographql#6047)
  SqlNormalizedCacheFactory make sqldriver public to support Sqlcipher data encryption. (apollographql#5972)
  Update 08-add-a-details-view.mdx for additional state handling (apollographql#5975)
  adding checks for json end_document in http batching interceptors (apollographql#5892)
  adding checks for json end_document in http transport (apollographql#5894)
  [3.x] Bump okio to 3.9.0 (apollographql#5868)
  version is now 3.8.5-SNAPSHOT
  release 3.8.4
  Backport apollographql#5848 to the v3 branch (apollographql#5863)
  Backport apollographql#5840 to the v3 branch (apollographql#5861)
  Backport apollographql#5778 to the v3 branch (apollographql#5860)
  Update min version of Kotlin in README and doc (apollographql#5750)
  version is now 3.8.4-SNAPSHOT
  release 3.8.3
  Add deprecations on symbols that are getting removed in v4 (apollographql#5746)
  docs: Correct file name discrepancies in tutorial documentation (apollographql#5740)
  Ignore IOException when calling ApolloHttpCache.remove (apollographql#5730)
  Added an implementation of a missing NSURLSessionWebSocketDelegateProtocol method in the NSURLSessionWebSocketEngine that's required in order to get a web socket to successfully reopen. (apollographql#5704)
  Update plugin-configuration.mdx (apollographql#5673)
  ...

# Conflicts:
#	gradle.properties
#	libraries/apollo-runtime/src/appleMain/kotlin/com/apollographql/apollo3/network/ws/NSURLSessionWebSocketEngine.kt
  • Loading branch information
Adudouit committed Aug 19, 2024
2 parents 683768b + b8e8bdb commit 65a80fb
Show file tree
Hide file tree
Showing 378 changed files with 1,302 additions and 1,659 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

jobs:
tests-gradle:
runs-on: macos-11
runs-on: macos-latest
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
- uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 #v3
Expand All @@ -39,7 +39,7 @@ jobs:
path: diagnostics.zip

tests-no-gradle:
runs-on: macos-11
runs-on: macos-latest
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
- uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 #v3
Expand All @@ -65,7 +65,7 @@ jobs:
path: diagnostics.zip

tests-integration:
runs-on: macos-11
runs-on: macos-latest
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
- uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 #v3
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
deploy:
runs-on: macos-11
runs-on: macos-latest
if: github.repository == 'apollographql/apollo-kotlin'
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
Expand Down Expand Up @@ -43,9 +43,4 @@ jobs:
if: always()
with:
name: push.zip
path: push.zip
- name: Deploy Kdoc to github pages
uses: JamesIves/github-pages-deploy-action@830e6a4f7c81743c52f3fed0ac67428feff9620a #v4.2.5
with:
branch: gh-pages # The branch the action should deploy to.
folder: build/dokkaHtml # The folder the action should deploy.
path: diagnostics.zip
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
publish:
runs-on: macos-11
runs-on: macos-latest
if: github.repository == 'apollographql/apollo-kotlin'
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
Expand Down
8 changes: 0 additions & 8 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Apollo Kotlin is a [Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatf

Here's the current matrix of supported features per platform:

| | `jvm` | Apple¹ | `js` | `linuxX64`
| | `jvm` | `Apple¹` | `js` | `linuxX64`
| --- | :---: | :---: |:----:| :---: |
| `apollo-api` (models)|||||
| `apollo-runtime` (network, query batching, apq, ...) ||||🚫|
Expand Down Expand Up @@ -81,15 +81,15 @@ Add the plugin to your `build.gradle.kts`:

```kotlin
plugins {
id("com.apollographql.apollo3") version "3.8.1"
id("com.apollographql.apollo3").version("3.8.3")
}
```

Add the runtime dependency:

```kotlin
dependencies {
implementation("com.apollographql.apollo3:apollo-runtime:3.8.2")
implementation("com.apollographql.apollo3:apollo-runtime:3.8.5")
}
```

Expand Down Expand Up @@ -163,21 +163,21 @@ Releases are hosted on [Maven Central](https://repo1.maven.org/maven2/com/apollo

```kotlin
plugins {
id("com.apollographql.apollo3") version "3.8.1"
id("com.apollographql.apollo3").version("3.8.3")
}

repositories {
mavenCentral()
}

dependencies {
implementation("com.apollographql.apollo3:apollo-runtime:3.8.2")
implementation("com.apollographql.apollo3:apollo-runtime:3.8.5")

// optional: if you want to use the normalized cache
implementation("com.apollographql.apollo3:apollo-normalized-cache-sqlite:3.8.2")
implementation("com.apollographql.apollo3:apollo-normalized-cache-sqlite:3.8.5")
// optional: if you just want the generated models and parsers and write your own HTTP code/cache code, you can remove apollo-runtime
// and use apollo-api instead
implementation("com.apollographql.apollo3:apollo-api:3.8.2")
implementation("com.apollographql.apollo3:apollo-api:3.8.5")
}
```

Expand Down Expand Up @@ -208,7 +208,7 @@ pluginManagement {
}
```

And then use the `3.8.3-SNAPSHOT` version for the plugin and libraries.
And then use the `3.8.6-SNAPSHOT` version for the plugin and libraries.

## Requirements

Expand All @@ -221,7 +221,8 @@ Some platforms have specific requirements:
For building, it requires:

* Gradle 5.6
* Kotlin 1.5+ (1.7+ for native)
* Kotlin 1.8+ for JVM projects
* Kotlin 1.9+ for native projects

## Contributing

Expand Down
24 changes: 8 additions & 16 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import org.jetbrains.kotlin.samWithReceiver.gradle.SamWithReceiverExtension
import org.jetbrains.kotlin.samWithReceiver.gradle.SamWithReceiverGradleSubplugin

plugins {
`embedded-kotlin`
id("org.jetbrains.kotlin.jvm").version("1.9.21")
id("org.jetbrains.kotlin.plugin.sam.with.receiver").version("1.9.21")
id("java-gradle-plugin")
id("net.mbonnin.golatac").version("0.0.3")
}

plugins.apply(SamWithReceiverGradleSubplugin::class.java)
extensions.configure(SamWithReceiverExtension::class.java) {
annotations(HasImplicitReceiver::class.qualifiedName!!)
}
Expand All @@ -34,19 +33,12 @@ dependencies {

// We want the KSP plugin to use the version from the classpath and not force a newer version
// of the Gradle plugin
if (System.getProperty("idea.sync.active") == null) {
implementation(golatac.lib("kotlin.plugin"))
runtimeOnly(golatac.lib("ksp"))
// XXX: This is only needed for tests. We could have different build logic for different
// builds but this seems just overkill for now
runtimeOnly(golatac.lib("kotlin.allopen"))
runtimeOnly(golatac.lib("kotlinx.serialization.plugin"))
} else {
implementation(golatac.lib("kotlin.plugin.duringideasync"))
runtimeOnly(golatac.lib("ksp.duringideasync"))
runtimeOnly(golatac.lib("kotlin.allopen.duringideasync"))
runtimeOnly(golatac.lib("kotlinx.serialization.plugin.duringideasync"))
}
implementation(golatac.lib("kotlin.plugin"))
runtimeOnly(golatac.lib("ksp"))
// XXX: This is only needed for tests. We could have different build logic for different
// builds but this seems just overkill for now
runtimeOnly(golatac.lib("kotlin.allopen"))
runtimeOnly(golatac.lib("kotlinx.serialization.plugin"))

runtimeOnly(golatac.lib("sqldelight.plugin"))
runtimeOnly(golatac.lib("gradle.publish.plugin"))
Expand Down
3 changes: 2 additions & 1 deletion build-logic/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ kotlin.stdlib.default.dependency=false
# Enable the build cache
org.gradle.caching=true
# Enable the configuration cache
#org.gradle.unsafe.configuration-cache=true
#org.gradle.unsafe.configuration-cache=true
kotlin.mpp.applyDefaultHierarchyTemplate=false
12 changes: 11 additions & 1 deletion build-logic/src/main/kotlin/CompilerOptions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile

fun Project.configureJavaAndKotlinCompilers(treatWarningsAsErrors: Boolean = false) {
// For Kotlin JVM projects
Expand Down Expand Up @@ -32,9 +33,15 @@ fun Project.configureJavaAndKotlinCompilers(treatWarningsAsErrors: Boolean = fal
(project.extensions.findByName("kotlin")
as? org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension)?.run {
sourceSets.all {
languageSettings {
languageVersion = "1.5"
apiVersion = "1.5"
}
languageSettings.optIn("kotlin.RequiresOptIn")
languageSettings.optIn("com.apollographql.apollo3.annotations.ApolloExperimental")
languageSettings.optIn("com.apollographql.apollo3.annotations.ApolloInternal")
languageSettings.optIn("kotlinx.cinterop.UnsafeNumber")
languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi")
}
}

Expand All @@ -56,7 +63,10 @@ fun Project.configureJavaAndKotlinCompilers(treatWarningsAsErrors: Boolean = fal
private fun Project.treatWarningsAsErrors() {
tasks.withType(KotlinCompile::class.java) {
kotlinOptions {
allWarningsAsErrors = true
/**
* sadly languageVersion = 1.5 outputs a warning that we can't selectively disable
*/
//allWarningsAsErrors = true
}
}
}
10 changes: 2 additions & 8 deletions build-logic/src/main/kotlin/Mpp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fun Project.configureMpp(
fun Project.okio(): String {
val okioVersion = when (getKotlinPluginVersion()) {
"1.6.10" -> "3.0.0"
else -> "3.2.0"
else -> "3.9.0"
}

return "com.squareup.okio:okio:$okioVersion"
Expand All @@ -134,7 +134,7 @@ fun Project.okio(): String {
fun Project.okioNodeJs(): String {
val okioVersion = when (getKotlinPluginVersion()) {
"1.6.10" -> "3.0.0"
else -> "3.2.0"
else -> "3.9.0"
}

return "com.squareup.okio:okio-nodefilesystem:$okioVersion"
Expand All @@ -145,12 +145,6 @@ private fun KotlinMultiplatformExtension.createAndConfigureAppleTargets(presetNa
return
}

if (System.getProperty("idea.sync.active") != null) {
// Early return. Inside intelliJ, only configure one target
targetFromPreset(presets.getByName(hostTarget), "apple")
return
}

val appleMain = sourceSets.create("appleMain")
val appleTest = sourceSets.create("appleTest")

Expand Down
1 change: 0 additions & 1 deletion build-logic/src/main/kotlin/Node.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ fun Project.configureNode() {
// See https://youtrack.jetbrains.com/issue/KT-47215
plugins.withType(YarnPlugin::class.java).configureEach {
project.extensions.getByType(YarnRootExtension::class.java).apply {
disableGranularWorkspaces()
// Drop the patch version because there shouldn't be any dependency change
lockFileDirectory = projectDir.resolve("kotlin-js-store-${project.getKotlinPluginVersion().substringBeforeLast(".")}")
}
Expand Down
7 changes: 6 additions & 1 deletion build-logic/src/main/kotlin/Publishing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private fun Project.configurePublishingInternal() {
}
}

else -> {
components.findByName("java") != null -> {
/**
* Kotlin JVM do not create publications (yet?). Do it ourselves.
*/
Expand All @@ -195,6 +195,11 @@ private fun Project.configurePublishingInternal() {
artifactId = findProperty("POM_ARTIFACT_ID") as String?
}
}
else -> {
/**
* apollo-kdoc
*/
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class LibraryConventionPlugin : Plugin<Project> {
fun treatWarningsAsErrors(treatWarningsAsErrors: Boolean) {
project.tasks.withType(KotlinCompile::class.java).configureEach {
kotlinOptions {
allWarningsAsErrors = treatWarningsAsErrors
// allWarningsAsErrors = treatWarningsAsErrors
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/advanced/apollo-ast.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Add the `apollo-ast` dependency to your project:
dependencies {
// ...

implementation("com.apollographql.apollo3:apollo-ast:3.8.2")
implementation("com.apollographql.apollo3:apollo-ast:3.8.5")
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/source/advanced/multi-modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ And declare your schema module as a dependency of your feature module:
```kotlin
// feature/build.gradle.kts
dependencies {
implementation("com.apollographql.apollo3:apollo-runtime:3.8.2")
implementation("com.apollographql.apollo3:apollo-runtime:3.8.5")
// more regular dependencies

// Apollo dependencies
Expand Down
2 changes: 1 addition & 1 deletion docs/source/advanced/no-runtime.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Using the models without apollo-runtime
For this, remove the `com.apollographql.apollo3:apollo-runtime` dependency and replace it with:

```kotlin title="build.gradle"
implementation("com.apollographql.apollo3:apollo-api:3.8.2")
implementation("com.apollographql.apollo3:apollo-api:3.8.5")
```

## Composing an HTTP request body
Expand Down
Loading

0 comments on commit 65a80fb

Please sign in to comment.