1- import com.android.build.gradle.internal.tasks.factory.dependsOn
21import com.powersync.plugins.sonatype.setupGithubRepository
32import de.undercouch.gradle.tasks.download.Download
43import org.gradle.internal.os.OperatingSystem
@@ -22,53 +21,6 @@ plugins {
2221 alias(libs.plugins.kotlin.atomicfu)
2322}
2423
25- val sqliteVersion = " 3450200"
26- val sqliteReleaseYear = " 2024"
27-
28- val sqliteSrcFolder =
29- project.layout.buildDirectory
30- .dir(" native/sqlite" )
31- .get()
32-
33- val downloadSQLiteSources by tasks.registering(Download ::class ) {
34- val zipFileName = " sqlite-amalgamation-$sqliteVersion .zip"
35- val destination = sqliteSrcFolder.file(zipFileName).asFile
36- src(" https://www.sqlite.org/$sqliteReleaseYear /$zipFileName " )
37- dest(destination)
38- onlyIfNewer(true )
39- overwrite(false )
40- }
41-
42- val unzipSQLiteSources by tasks.registering(Copy ::class ) {
43- dependsOn(downloadSQLiteSources)
44-
45- from(
46- zipTree(downloadSQLiteSources.get().dest).matching {
47- include(" */sqlite3.*" )
48- exclude {
49- it.isDirectory
50- }
51- eachFile {
52- this .path = this .name
53- }
54- },
55- )
56- into(sqliteSrcFolder)
57- }
58-
59- val compileSqliteForTesting by tasks.registering(Exec ::class ) {
60- dependsOn(unzipSQLiteSources)
61-
62- val input = sqliteSrcFolder.file(" sqlite3.c" )
63- inputs.file(input)
64- inputs.file(sqliteSrcFolder.file(" sqlite3.h" ))
65-
66- val output = sqliteSrcFolder.file(" libsqlite3.dylib" )
67- outputs.file(output)
68-
69- commandLine(" clang" , " -shared" , " -o" , output.asFile.path, input.asFile.path)
70- }
71-
7224val binariesFolder = project.layout.buildDirectory.dir(" binaries/desktop" )
7325val downloadPowersyncDesktopBinaries by tasks.registering(Download ::class ) {
7426 description = " Download PowerSync core extensions for JVM builds and releases"
@@ -227,6 +179,7 @@ kotlin {
227179
228180 if (konanTarget.family == Family .IOS && konanTarget.name.contains(" simulator" )) {
229181 binaries.withType<TestExecutable >().configureEach {
182+ /*
230183 linkTaskProvider.dependsOn(unzipPowersyncFramework)
231184 linkerOpts("-framework", "powersync-sqlite-core")
232185 val frameworkRoot =
@@ -236,7 +189,7 @@ kotlin {
236189 .asFile.path
237190
238191 linkerOpts("-F", frameworkRoot)
239- linkerOpts(" -rpath" , frameworkRoot)
192+ linkerOpts("-rpath", frameworkRoot)*/
240193 }
241194 }
242195 /*
@@ -284,7 +237,7 @@ kotlin {
284237 implementation(libs.kotlinx.datetime)
285238 implementation(libs.stately.concurrency)
286239 implementation(libs.configuration.annotations)
287- api(project( " : persistence" ) )
240+ api(projects. persistence)
288241 api(libs.kermit)
289242 }
290243
@@ -352,17 +305,6 @@ android {
352305 .get()
353306 .toInt()
354307 consumerProguardFiles(" proguard-rules.pro" )
355-
356- @Suppress(" UnstableApiUsage" )
357- externalNativeBuild {
358- cmake {
359- arguments.addAll(
360- listOf (
361- " -DSQLITE3_SRC_DIR=${sqliteSrcFolder.asFile.absolutePath} " ,
362- ),
363- )
364- }
365- }
366308 }
367309
368310 sourceSets {
0 commit comments