Skip to content

Commit a224896

Browse files
committed
Allow using released packages for Android demo
1 parent b054885 commit a224896

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

demos/android-supabase-todolist/app/build.gradle.kts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ dependencies {
8787
androidTestImplementation(libs.androidx.ui.test.junit4)
8888
debugImplementation(libs.androidx.ui.tooling)
8989
debugImplementation(libs.androidx.ui.test.manifest)
90-
implementation("com.powersync:core")
91-
implementation("com.powersync:connector-supabase")
92-
implementation("com.powersync:compose")
90+
// To use a fixed version, replace "latest.release" with the latest version available at
91+
// https://central.sonatype.com/artifact/com.powersync/core
92+
implementation("com.powersync:core:latest.release")
93+
implementation("com.powersync:connector-supabase:latest.release")
94+
implementation("com.powersync:compose:latest.release")
9395
implementation(libs.uuid)
9496
implementation(libs.kermit)
9597
implementation(libs.androidx.material.icons.extended)

demos/android-supabase-todolist/local.properties.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ sdk.dir=/Users/dominic/Library/Android/sdk
1212
SUPABASE_URL=https://foo.supabase.co
1313
SUPABASE_ANON_KEY=foo
1414
POWERSYNC_URL=https://foo.powersync.journeyapps.com
15+
# Set to true to use released PowerSync packages instead of the ones built locally.
16+
USE_RELEASED_POWERSYNC_VERSIONS=false
Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import java.util.Properties
2+
13
pluginManagement {
24
repositories {
35
google {
@@ -15,23 +17,36 @@ dependencyResolutionManagement {
1517
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
1618
repositories {
1719
google()
18-
maven("https://jitpack.io")
20+
maven("https://jitpack.io") {
21+
content { includeGroup("com.github.requery") }
22+
}
1923
mavenCentral()
2024
}
2125
}
2226

2327
rootProject.name = "PowersyncAndroidExample"
2428
include(":app")
2529

26-
includeBuild("../..") {
27-
dependencySubstitution {
28-
substitute(module("com.powersync:core"))
29-
.using(project(":core")).because("we want to auto-wire up sample dependency")
30-
substitute(module("com.powersync:connector-supabase"))
31-
.using(project(":connectors:supabase"))
32-
.because("we want to auto-wire up sample dependency")
33-
substitute(module("com.powersync:compose"))
34-
.using(project(":compose"))
35-
.because("we want to auto-wire up sample dependency")
30+
val localProperties = Properties().apply {
31+
try {
32+
load(file("local.properties").reader())
33+
} catch (ignored: java.io.IOException) {
34+
// ignore
3635
}
37-
}
36+
}
37+
val useReleasedVersions = localProperties.getProperty("USE_RELEASED_POWERSYNC_VERSIONS") == "true"
38+
39+
if (!useReleasedVersions) {
40+
includeBuild("../..") {
41+
dependencySubstitution {
42+
substitute(module("com.powersync:core"))
43+
.using(project(":core")).because("we want to auto-wire up sample dependency")
44+
substitute(module("com.powersync:connector-supabase"))
45+
.using(project(":connectors:supabase"))
46+
.because("we want to auto-wire up sample dependency")
47+
substitute(module("com.powersync:compose"))
48+
.using(project(":compose"))
49+
.because("we want to auto-wire up sample dependency")
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)