Skip to content

Commit e5300be

Browse files
authored
Enable configuration cache (#195)
1 parent 383ba30 commit e5300be

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
- name: Gradle publish
5050
run: |
5151
./gradlew \
52+
--no-configuration-cache \
5253
-PGITHUB_PUBLISH_TOKEN="${{ secrets.GITHUB_TOKEN }}" \
5354
-PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" \
5455
-PsigningInMemoryKeyId="${{ secrets.SIGNING_KEY_ID }}" \
@@ -77,6 +78,8 @@ jobs:
7778
distribution: 'temurin'
7879
- name: Set up Gradle
7980
uses: gradle/actions/setup-gradle@v4
81+
with:
82+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
8083
- name: Build frameworks
8184
run: "./gradlew PowerSyncKotlin:buildRelease"
8285

.github/workflows/docs-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- name: Build Docs
3131
run: |
3232
./gradlew \
33+
--no-configuration-cache \
3334
-PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} \
3435
dokkaGenerate
3536
shell: bash

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ jobs:
3838
distribution: 'temurin'
3939
- name: Set up Gradle
4040
uses: gradle/actions/setup-gradle@v4
41+
with:
42+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
4143

4244
- name: Build and run tests with Gradle
4345
run: |
4446
./gradlew \
45-
-PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} \
4647
${{ matrix.targets }}
4748
shell: bash
4849

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ kotlin.code.style=official
22
# Gradle
33
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
44
org.gradle.caching=true
5+
org.gradle.configuration-cache=true
56
# Compose
67
org.jetbrains.compose.experimental.uikit.enabled=true
78
# Android

plugins/build-plugin/src/main/kotlin/com/powersync/compile/CreateSqliteCInterop.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
package com.powersync.compile
22

33
import org.gradle.api.DefaultTask
4+
import org.gradle.api.file.ProjectLayout
45
import org.gradle.api.file.RegularFileProperty
56
import org.gradle.api.tasks.InputFile
7+
import org.gradle.api.tasks.Internal
68
import org.gradle.api.tasks.OutputFile
79
import org.gradle.api.tasks.TaskAction
810
import org.gradle.work.DisableCachingByDefault
11+
import javax.inject.Inject
912

1013
@DisableCachingByDefault(because = "not worth caching")
1114
abstract class CreateSqliteCInterop: DefaultTask() {
@@ -15,6 +18,9 @@ abstract class CreateSqliteCInterop: DefaultTask() {
1518
@get:OutputFile
1619
abstract val definitionFile: RegularFileProperty
1720

21+
@get:Inject
22+
abstract val layout: ProjectLayout
23+
1824
@TaskAction
1925
fun run() {
2026
val archive = archiveFile.get().asFile
@@ -26,7 +32,7 @@ abstract class CreateSqliteCInterop: DefaultTask() {
2632
linkerOpts.linux_x64 = -lpthread -ldl
2733
linkerOpts.macos_x64 = -lpthread -ldl
2834
staticLibraries=${archive.name}
29-
libraryPaths=${parent.relativeTo(project.layout.projectDirectory.asFile.canonicalFile)}
35+
libraryPaths=${parent.relativeTo(layout.projectDirectory.asFile.canonicalFile)}
3036
""".trimIndent(),
3137
)
3238
}

0 commit comments

Comments
 (0)