Skip to content

Commit ce25020

Browse files
committed
Adds purchases-core
1 parent 94255ca commit ce25020

File tree

5 files changed

+82
-0
lines changed

5 files changed

+82
-0
lines changed

.circleci/config.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,13 +932,19 @@ workflows:
932932
build_type: "debug"
933933
requires:
934934
- prepare-tests
935+
# FIXME We only need read access here.
936+
context:
937+
- github-packages-publishing
935938
- test:
936939
name: test_defaults_bc7_release
937940
flavor: "defaults"
938941
bc_version: "bc7"
939942
build_type: "release"
940943
requires:
941944
- prepare-tests
945+
# FIXME We only need read access here.
946+
context:
947+
- github-packages-publishing
942948
- test:
943949
name: test_cec_<< matrix.build_type >>
944950
flavor: "customEntitlementComputation"
@@ -948,6 +954,9 @@ workflows:
948954
matrix:
949955
parameters:
950956
build_type: ["debug", "release"]
957+
# FIXME We only need read access here.
958+
context:
959+
- github-packages-publishing
951960
# Special case for defaults BC8 release with kover
952961
- test:
953962
name: test_defaults_bc8_release
@@ -957,45 +966,87 @@ workflows:
957966
run_kover: true
958967
requires:
959968
- prepare-tests
969+
# FIXME We only need read access here.
970+
context:
971+
- github-packages-publishing
960972
- verify-compatibility:
961973
requires:
962974
- prepare-tests
975+
# FIXME We only need read access here.
976+
context:
977+
- github-packages-publishing
963978
- lint:
964979
requires:
965980
- prepare-tests
981+
# FIXME We only need read access here.
982+
context:
983+
- github-packages-publishing
966984
- detekt:
967985
requires:
968986
- prepare-tests
987+
# FIXME We only need read access here.
988+
context:
989+
- github-packages-publishing
969990
- metalava:
970991
requires:
971992
- prepare-tests
993+
# FIXME We only need read access here.
994+
context:
995+
- github-packages-publishing
972996
- assemble-purchase-tester:
973997
requires:
974998
- prepare-tests
999+
# FIXME We only need read access here.
1000+
context:
1001+
- github-packages-publishing
9751002
- assemble-paywall-tester-release:
9761003
requires:
9771004
- prepare-tests
1005+
# FIXME We only need read access here.
1006+
context:
1007+
- github-packages-publishing
9781008
- test_dokka_hide_internal:
9791009
requires:
9801010
- prepare-tests
1011+
# FIXME We only need read access here.
1012+
context:
1013+
- github-packages-publishing
9811014
- run-backend-integration-tests:
9821015
requires:
9831016
- prepare-tests
1017+
# FIXME We only need read access here.
1018+
context:
1019+
- github-packages-publishing
9841020
- record-and-upload-paparazzi-revenuecatui-snapshots:
9851021
requires:
9861022
- prepare-tests
1023+
# FIXME We only need read access here.
1024+
context:
1025+
- github-packages-publishing
9871026
- run-revenuecatui-ui-tests:
9881027
requires:
9891028
- prepare-tests
1029+
# FIXME We only need read access here.
1030+
context:
1031+
- github-packages-publishing
9901032
- emerge_purchases_ui_snapshot_tests:
9911033
requires:
9921034
- prepare-tests
1035+
# FIXME We only need read access here.
1036+
context:
1037+
- github-packages-publishing
9931038
- emerge_size_analysis_tests:
9941039
requires:
9951040
- prepare-tests
1041+
# FIXME We only need read access here.
1042+
context:
1043+
- github-packages-publishing
9961044
- run-maestro-e2e-tests:
9971045
requires:
9981046
- prepare-tests
1047+
# FIXME We only need read access here.
1048+
context:
1049+
- github-packages-publishing
9991050
- integration-tests-build: *release-branches
10001051
- run-firebase-tests-purchases-custom-entitlement-computation-integration-test:
10011052
<<: *release-branches

purchases/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ dependencies {
169169
implementation(libs.tink)
170170
implementation(libs.playServices.ads.identifier)
171171
implementation(libs.coroutines.core)
172+
implementation("com.revenuecat.purchases:purchases-core:0.0.0-rust-SNAPSHOT")
172173
"bc8Api"(libs.billing.bc8)
173174
"bc7Api"(libs.billing.bc7)
174175

purchases/src/defaults/kotlin/com/revenuecat/purchases/Purchases.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import com.revenuecat.purchases.common.errorLog
1515
import com.revenuecat.purchases.common.events.FeatureEvent
1616
import com.revenuecat.purchases.common.infoLog
1717
import com.revenuecat.purchases.common.log
18+
import uniffi.purchases_core.add
1819
import com.revenuecat.purchases.customercenter.CustomerCenterListener
1920
import com.revenuecat.purchases.deeplinks.DeepLinkParser
2021
import com.revenuecat.purchases.interfaces.Callback
@@ -1172,6 +1173,10 @@ class Purchases internal constructor(
11721173
fun configure(
11731174
configuration: PurchasesConfiguration,
11741175
): Purchases {
1176+
// Call Rust add() function to verify integration
1177+
val rustResult = add(2uL, 3uL)
1178+
infoLog { "Rust add(2, 3) = $rustResult" }
1179+
11751180
if (isConfigured) {
11761181
if (backingFieldSharedInstance?.purchasesOrchestrator?.currentConfiguration == configuration) {
11771182
infoLog { ConfigureStrings.INSTANCE_ALREADY_EXISTS_WITH_SAME_CONFIG }

settings.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ dependencyResolutionManagement {
4949

5050
// fallback for the rest of the dependencies
5151
mavenCentral()
52+
53+
// GitHub Packages for purchases-core Rust library
54+
maven {
55+
name = "GitHubPackages"
56+
url = uri("https://maven.pkg.github.com/RevenueCat/purchases-core")
57+
credentials {
58+
username = System.getenv("GITHUB_ACTOR") ?: ""
59+
password = System.getenv("GITHUB_TOKEN") ?: ""
60+
}
61+
}
5262
}
5363
}
5464

test-apps/sdksizetesting/settings.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ dependencyResolutionManagement {
2121
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
2222
repositories {
2323
mavenLocal()
24+
// GitHub Packages for purchases-core Rust library (transitive dependency)
25+
maven {
26+
name = "GitHubPackages"
27+
url = uri("https://maven.pkg.github.com/RevenueCat/purchases-core")
28+
credentials {
29+
username = System.getenv("GITHUB_ACTOR") ?: ""
30+
password = System.getenv("GITHUB_TOKEN") ?: ""
31+
}
32+
content {
33+
// Only fetch purchases-core from GitHub Packages
34+
includeModule("com.revenuecat.purchases", "purchases-core")
35+
includeModule("com.revenuecat.purchases", "purchases-core-android")
36+
includeModule("com.revenuecat.purchases", "purchases-core-jvm")
37+
}
38+
}
2439
google {
2540
content {
2641
// Exclude to make sure we use dependency from mavenLocal

0 commit comments

Comments
 (0)