diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 122556ca..107319d8 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 }}" \ @@ -77,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..409b938d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,11 +38,12 @@ 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: | ./gradlew \ - -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} \ ${{ matrix.targets }} shell: bash 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 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..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 @@ -1,11 +1,14 @@ 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 +import javax.inject.Inject @DisableCachingByDefault(because = "not worth caching") abstract class CreateSqliteCInterop: DefaultTask() { @@ -15,6 +18,9 @@ abstract class CreateSqliteCInterop: DefaultTask() { @get:OutputFile abstract val definitionFile: RegularFileProperty + @get:Inject + abstract val layout: ProjectLayout + @TaskAction fun run() { val archive = archiveFile.get().asFile @@ -26,7 +32,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(), ) }