From e5f1de98b64eaa9c1e6b0307d99c38a4362dd7a7 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Tue, 1 Jul 2025 10:55:06 -0600 Subject: [PATCH 1/5] Enable configuration cache --- .github/workflows/deploy.yml | 1 + gradle.properties | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 122556ca..b72c55ff 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -49,6 +49,7 @@ jobs: - name: Gradle publish run: | ./gradlew \ + --no-configuration-cache \ -PGITHUB_PUBLISH_TOKEN="${{ secrets.GITHUB_TOKEN }}" \ -PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" \ -PsigningInMemoryKeyId="${{ secrets.SIGNING_KEY_ID }}" \ diff --git a/gradle.properties b/gradle.properties index 774e2a2e..db7ae621 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,7 @@ kotlin.code.style=official # Gradle org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M" org.gradle.caching=true +org.gradle.configuration-cache=true # Compose org.jetbrains.compose.experimental.uikit.enabled=true # Android From 544e1640fe69a5a9665367a124a9d81586301515 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Tue, 1 Jul 2025 11:00:48 -0600 Subject: [PATCH 2/5] Set encryption key for configuration cache --- .github/workflows/deploy.yml | 2 ++ .github/workflows/docs-deploy.yml | 1 + .github/workflows/test.yml | 2 ++ 3 files changed, 5 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b72c55ff..107319d8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -78,6 +78,8 @@ jobs: distribution: 'temurin' - name: Set up Gradle uses: gradle/actions/setup-gradle@v4 + with: + cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: Build frameworks run: "./gradlew PowerSyncKotlin:buildRelease" diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index 68806cf6..53c137b0 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -30,6 +30,7 @@ jobs: - name: Build Docs run: | ./gradlew \ + --no-configuration-cache \ -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} \ dokkaGenerate shell: bash diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 764a333c..4cea2ddc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,6 +38,8 @@ jobs: distribution: 'temurin' - name: Set up Gradle uses: gradle/actions/setup-gradle@v4 + with: + cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} - name: Build and run tests with Gradle run: | From 90a1eb6e8673a54b8e03d4dc6e8d429d54c540e8 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Tue, 1 Jul 2025 11:07:48 -0600 Subject: [PATCH 3/5] Fix configuration cache issue with C interop task --- .../kotlin/com/powersync/compile/CreateSqliteCInterop.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt b/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt index d4b19ad4..bbc173bf 100644 --- a/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt +++ b/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt @@ -1,8 +1,10 @@ package com.powersync.compile import org.gradle.api.DefaultTask +import org.gradle.api.file.ProjectLayout import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.Internal import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault @@ -15,6 +17,9 @@ abstract class CreateSqliteCInterop: DefaultTask() { @get:OutputFile abstract val definitionFile: RegularFileProperty + @get:Internal + abstract val layout: ProjectLayout + @TaskAction fun run() { val archive = archiveFile.get().asFile @@ -26,7 +31,7 @@ abstract class CreateSqliteCInterop: DefaultTask() { linkerOpts.linux_x64 = -lpthread -ldl linkerOpts.macos_x64 = -lpthread -ldl staticLibraries=${archive.name} - libraryPaths=${parent.relativeTo(project.layout.projectDirectory.asFile.canonicalFile)} + libraryPaths=${parent.relativeTo(layout.projectDirectory.asFile.canonicalFile)} """.trimIndent(), ) } From 3307ce97f8017933a95028e931ff90b5f3ecb5c8 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Tue, 1 Jul 2025 11:14:33 -0600 Subject: [PATCH 4/5] Enable build scans --- .github/workflows/test.yml | 2 +- .../main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4cea2ddc..f3033271 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: - name: Build and run tests with Gradle run: | ./gradlew \ - -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} \ + --scan \ ${{ matrix.targets }} shell: bash diff --git a/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt b/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt index bbc173bf..89b2c5ea 100644 --- a/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt +++ b/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt @@ -8,6 +8,7 @@ import org.gradle.api.tasks.Internal import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault +import javax.inject.Inject @DisableCachingByDefault(because = "not worth caching") abstract class CreateSqliteCInterop: DefaultTask() { @@ -18,6 +19,7 @@ abstract class CreateSqliteCInterop: DefaultTask() { abstract val definitionFile: RegularFileProperty @get:Internal + @get:Inject abstract val layout: ProjectLayout @TaskAction From 658b5a3da3f17a1e24bf1c3be7598832e26adaf2 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Tue, 1 Jul 2025 11:20:44 -0600 Subject: [PATCH 5/5] Fix more configuration cache issues --- .github/workflows/test.yml | 1 - .../main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3033271..409b938d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,6 @@ jobs: - name: Build and run tests with Gradle run: | ./gradlew \ - --scan \ ${{ matrix.targets }} shell: bash diff --git a/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt b/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt index 89b2c5ea..fd93a4ad 100644 --- a/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt +++ b/plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt @@ -18,7 +18,6 @@ abstract class CreateSqliteCInterop: DefaultTask() { @get:OutputFile abstract val definitionFile: RegularFileProperty - @get:Internal @get:Inject abstract val layout: ProjectLayout