diff --git a/demos/android-supabase-todolist/app/build.gradle.kts b/demos/android-supabase-todolist/app/build.gradle.kts index 38bd217d..581dcaaa 100644 --- a/demos/android-supabase-todolist/app/build.gradle.kts +++ b/demos/android-supabase-todolist/app/build.gradle.kts @@ -87,9 +87,11 @@ dependencies { androidTestImplementation(libs.androidx.ui.test.junit4) debugImplementation(libs.androidx.ui.tooling) debugImplementation(libs.androidx.ui.test.manifest) - implementation("com.powersync:core") - implementation("com.powersync:connector-supabase") - implementation("com.powersync:compose") + // To use a fixed version, replace "latest.release" with the latest version available at + // https://central.sonatype.com/artifact/com.powersync/core + implementation("com.powersync:core:latest.release") + implementation("com.powersync:connector-supabase:latest.release") + implementation("com.powersync:compose:latest.release") implementation(libs.uuid) implementation(libs.kermit) implementation(libs.androidx.material.icons.extended) diff --git a/demos/android-supabase-todolist/local.properties.example b/demos/android-supabase-todolist/local.properties.example index 82ea931f..0b8f0d04 100644 --- a/demos/android-supabase-todolist/local.properties.example +++ b/demos/android-supabase-todolist/local.properties.example @@ -12,3 +12,5 @@ sdk.dir=/Users/dominic/Library/Android/sdk SUPABASE_URL=https://foo.supabase.co SUPABASE_ANON_KEY=foo POWERSYNC_URL=https://foo.powersync.journeyapps.com +# Set to true to use released PowerSync packages instead of the ones built locally. +USE_RELEASED_POWERSYNC_VERSIONS=false diff --git a/demos/android-supabase-todolist/settings.gradle.kts b/demos/android-supabase-todolist/settings.gradle.kts index e358e07a..d9e18e1b 100644 --- a/demos/android-supabase-todolist/settings.gradle.kts +++ b/demos/android-supabase-todolist/settings.gradle.kts @@ -1,3 +1,5 @@ +import java.util.Properties + pluginManagement { repositories { google { @@ -15,7 +17,9 @@ dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() - maven("https://jitpack.io") + maven("https://jitpack.io") { + content { includeGroup("com.github.requery") } + } mavenCentral() } } @@ -23,15 +27,26 @@ dependencyResolutionManagement { rootProject.name = "PowersyncAndroidExample" include(":app") -includeBuild("../..") { - dependencySubstitution { - substitute(module("com.powersync:core")) - .using(project(":core")).because("we want to auto-wire up sample dependency") - substitute(module("com.powersync:connector-supabase")) - .using(project(":connectors:supabase")) - .because("we want to auto-wire up sample dependency") - substitute(module("com.powersync:compose")) - .using(project(":compose")) - .because("we want to auto-wire up sample dependency") +val localProperties = Properties().apply { + try { + load(file("local.properties").reader()) + } catch (ignored: java.io.IOException) { + // ignore } -} \ No newline at end of file +} +val useReleasedVersions = localProperties.getProperty("USE_RELEASED_POWERSYNC_VERSIONS") == "true" + +if (!useReleasedVersions) { + includeBuild("../..") { + dependencySubstitution { + substitute(module("com.powersync:core")) + .using(project(":core")).because("we want to auto-wire up sample dependency") + substitute(module("com.powersync:connector-supabase")) + .using(project(":connectors:supabase")) + .because("we want to auto-wire up sample dependency") + substitute(module("com.powersync:compose")) + .using(project(":compose")) + .because("we want to auto-wire up sample dependency") + } + } +} diff --git a/demos/supabase-todolist/settings.gradle.kts b/demos/supabase-todolist/settings.gradle.kts index e54b14ee..0a497510 100644 --- a/demos/supabase-todolist/settings.gradle.kts +++ b/demos/supabase-todolist/settings.gradle.kts @@ -1,5 +1,7 @@ import java.util.Properties +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + pluginManagement { repositories { maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") @@ -25,13 +27,6 @@ dependencyResolutionManagement { maven("https://jitpack.io") { content { includeGroup("com.github.requery") } } - maven { - url = uri("https://maven.pkg.github.com/powersync-ja/powersync-kotlin") - credentials { - username = localProperties.getProperty("GITHUB_USERNAME", "") - password = localProperties.getProperty("GITHUB_TOKEN", "") - } - } } } @@ -45,12 +40,18 @@ include(":androidApp") include(":shared") include(":desktopApp") -includeBuild("../..") { - dependencySubstitution { - substitute(module("com.powersync:core")) - .using(project(":core")).because("we want to auto-wire up sample dependency") - substitute(module("com.powersync:connector-supabase")) - .using(project(":connectors:supabase")) - .because("we want to auto-wire up sample dependency") +val useReleasedVersions = localProperties.getProperty("USE_RELEASED_POWERSYNC_VERSIONS") == "true" + +if (!useReleasedVersions) { + includeBuild("../..") { + dependencySubstitution { + substitute(module("com.powersync:core")) + .using(project(":core")).because("we want to auto-wire up sample dependency") + substitute(module("com.powersync:persistence")) + .using(project(":persistence")).because("we want to auto-wire up sample dependency") + substitute(module("com.powersync:connector-supabase")) + .using(project(":connectors:supabase")) + .because("we want to auto-wire up sample dependency") + } } -} \ No newline at end of file +} diff --git a/demos/supabase-todolist/shared/build.gradle.kts b/demos/supabase-todolist/shared/build.gradle.kts index 006f53f1..5c3e0618 100644 --- a/demos/supabase-todolist/shared/build.gradle.kts +++ b/demos/supabase-todolist/shared/build.gradle.kts @@ -40,8 +40,10 @@ kotlin { sourceSets { commonMain.dependencies { // Need to use api here otherwise Database driver can't be accessed - api("com.powersync:core") - implementation("com.powersync:connector-supabase") + // When copying this example, replace "latest.release" with the current version available + // at: https://central.sonatype.com/artifact/com.powersync/core + api("com.powersync:core:latest.release") + implementation("com.powersync:connector-supabase:latest.release") implementation(libs.uuid) implementation(compose.runtime) implementation(compose.foundation)