Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 36 additions & 50 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ commands:
name: Install Android SDK platform tools
command: sdkmanager "platform-tools"

install-cocoapods-on-macos:
steps:
- run:
name: Install CocoaPods
command: bundle exec pod install --repo-update
working_directory: iosApp

save-kotlin-native-compiler-to-cache:
steps:
- run:
Expand Down Expand Up @@ -92,7 +85,7 @@ commands:
- persist_to_workspace:
name: Save incremental Gradle build to workspace
root: ./
paths:
paths:
- .gradle
# This doesn't support directory glob patterns (**), unfortunately.
- build
Expand All @@ -105,17 +98,24 @@ commands:
name: Attach workspace at working directory
at: ./

checkout-submodule:
description: "Checks out a git submodule."
parameters:
path:
type: string
default: ""
steps:
- run:
name: Check out submodule << parameters.path >>
command: |
git submodule init << parameters.path >>
git submodule update << parameters.path >>

parameters:
action:
type: enum
enum: [ build, upgrade-hybrid-common, bump ]
enum: [ build, bump ]
default: build
automatic:
type: boolean
default: false
version:
type: string
default: ''

executors:
android202409:
Expand All @@ -138,24 +138,6 @@ executors:
HOMEBREW_NO_AUTO_UPDATE: 1

jobs:
update-purchases-hybrid-common-version:
description: "Opens a PR updating the purchases-hybrid-common dependency to the latest version."
executor: xcode16
steps:
- checkout
- pin-ruby-version
- revenuecat/install-gem-mac-dependencies:
cache-version: v1
- revenuecat/trust-github-key
- revenuecat/setup-git-credentials
- run:
name: Update purchases-hybrid-common to << pipeline.parameters.version >>
command: |
bundle exec fastlane update_hybrid_common \
version:<< pipeline.parameters.version >> \
open_pr:true \
automatic_release:<< pipeline.parameters.automatic >>

prepare-next-snapshot-version:
description: "Opens a PR updating the SDK version to the next minor, appending -SNAPSHOT."
executor: ruby3
Expand All @@ -170,9 +152,10 @@ jobs:
command: bundle exec fastlane prepare_next_snapshot_version

detekt:
executor: jdk17
executor: xcode16
steps:
- checkout
- checkout-submodule
- restore-gradle-user-home-directory-from-cache
- run:
name: Run Detekt on commonMain
Expand All @@ -190,6 +173,7 @@ jobs:
steps:
- install-android-sdk-on-macos
- checkout
- checkout-submodule
- restore-gradle-user-home-directory-from-cache
- restore-kotlin-native-compiler-from-cache
- attach-workspace-at-working-directory
Expand All @@ -210,7 +194,7 @@ jobs:
name: Build libraries for Android
command: |
tasks=()
for module in core revenuecatui datetime either result; do
for module in core revenuecatui either result; do
for buildType in Debug Release; do
tasks+=(":$module:compile${buildType}KotlinAndroid")
done
Expand All @@ -223,18 +207,18 @@ jobs:
executor: xcode16
steps:
- checkout
- checkout-submodule
- restore-gradle-user-home-directory-from-cache
- restore-kotlin-native-compiler-from-cache
- attach-workspace-at-working-directory
- pin-ruby-version
- revenuecat/install-gem-mac-dependencies:
cache-version: v1
- install-cocoapods-on-macos
- run:
name: Build libraries for iOS
command: |
tasks=()
for module in core revenuecatui datetime either result; do
for module in core revenuecatui either result; do
for arch in Arm64 SimulatorArm64 X64; do
tasks+=(":$module:compileKotlinIos$arch")
done
Expand Down Expand Up @@ -265,21 +249,30 @@ jobs:
executor: xcode16
steps:
- checkout
- checkout-submodule
- restore-gradle-user-home-directory-from-cache
- restore-kotlin-native-compiler-from-cache
- attach-workspace-at-working-directory
- pin-ruby-version
- revenuecat/install-gem-mac-dependencies:
cache-version: v1
- install-cocoapods-on-macos
- run:
name: Build sample app for iOS
name: Build Kotlin code for iOS sample app for every architecture
command: |
tasks=()
for arch in Arm64 SimulatorArm64 X64; do
tasks+=(":composeApp:compileKotlinIos$arch")
done
./gradlew "${tasks[@]}"
- run:
name: Build iOS sample app
command: |
xcodebuild \
-project iosApp/iosApp.xcodeproj \
-scheme iosApp \
-configuration Debug \
-sdk iphonesimulator \
build;
- save-gradle-user-home-directory-to-cache
- save-kotlin-native-compiler-to-cache
- save-incremental-gradle-build-to-workspace
Expand All @@ -305,13 +298,13 @@ jobs:
executor: xcode16
steps:
- checkout
- checkout-submodule
- restore-gradle-user-home-directory-from-cache
- restore-kotlin-native-compiler-from-cache
- attach-workspace-at-working-directory
- pin-ruby-version
- revenuecat/install-gem-mac-dependencies:
cache-version: v1
- install-cocoapods-on-macos
- run:
name: Test public API for iOS
command: |
Expand Down Expand Up @@ -345,6 +338,7 @@ jobs:
executor: xcode16
steps:
- checkout
- checkout-submodule
- restore-gradle-user-home-directory-from-cache
- restore-kotlin-native-compiler-from-cache
- attach-workspace-at-working-directory
Expand All @@ -364,6 +358,7 @@ jobs:
executor: xcode16
steps:
- checkout
- checkout-submodule
- restore-gradle-user-home-directory-from-cache
- attach-workspace-at-working-directory
- run:
Expand All @@ -383,11 +378,11 @@ jobs:
type: boolean
steps:
- checkout
- checkout-submodule
- install-android-sdk-on-macos
- pin-ruby-version
- revenuecat/install-gem-mac-dependencies:
cache-version: v1
- install-cocoapods-on-macos
- restore-gradle-user-home-directory-from-cache
- restore-kotlin-native-compiler-from-cache
- when:
Expand Down Expand Up @@ -418,15 +413,6 @@ jobs:
command: bundle exec fastlane github_release_current_version

workflows:
on-action-upgrade-hybrid-common:
when:
equal: [ upgrade-hybrid-common, << pipeline.parameters.action >> ]
jobs:
- update-purchases-hybrid-common-version:
context:
- git-user-ops
- github-bot-public

# This workflow runs for any commit to main, as well as for any other
# branch with an open PR, except for release branches. This is controlled
# by the "Only build pull requests" setting on CircleCI.
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.iml
.gradle
.idea
**/.idea/*
.DS_Store
build
captures
Expand All @@ -21,4 +21,8 @@ vendor/
.bundle/

# Share IssueNavigationConfiguration
!.idea/vcs.xml
!/.idea/vcs.xml
# Ensure iosApp run configuration works
!/.idea/xcode.xml
!/.idea/purchases-kmp.iosApp.iml
!/.idea/modules.xml
17 changes: 17 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/purchases-kmp.iosApp.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/xcode.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .run/iosApp.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="iosApp" type="AppleRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="iosApp" TARGET_NAME="iosApp" CONFIG_NAME="Debug" IS_LOCATION_SIMULATION_SUPPORTED="true" SCHEME_NAME="iosApp" IS_LOCATION_SIMULATION_ALLOWED="true" LOCATION_SCENARIO_ID="com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier" LOCATION_SCENARIO_TYPE="1" APPLICATION_LANGUAGE="IDELaunchSchemeLanguageUseSystemLanguage" APPLICATION_REGION="" DEVELOPMENT_TEAM="8SXR2327BM" RUN_TARGET_PROJECT_NAME="iosApp" RUN_TARGET_NAME="iosApp" MAKE_ACTIVE="TRUE" SHOULD_DEBUG_EXTENSIONS="false">
<embedded_app_extension_list />
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
1 change: 0 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ purchases-kmp/
├── models/ # Shared data models and domain objects
├── mappings/ # Platform-specific mappings
├── revenuecatui/ # Jetpack Compose UI components for paywalls
├── datetime/ # KMP datetime utilities
├── either/ # Either/Result type implementations
├── result/ # Result wrapper types
├── build-logic/ # Custom Gradle build convention plugins
Expand Down
1 change: 0 additions & 1 deletion apiTester/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ kotlin {
implementation(compose.foundation)
implementation(compose.ui)
implementation(projects.core)
implementation(projects.datetime)
implementation(projects.either)
implementation(projects.revenuecatui)
implementation(projects.result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@

package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.datetime.allExpirationInstants
import com.revenuecat.purchases.kmp.datetime.allPurchaseInstants
import com.revenuecat.purchases.kmp.datetime.firstSeenInstant
import com.revenuecat.purchases.kmp.datetime.latestExpirationInstant
import com.revenuecat.purchases.kmp.datetime.originalPurchaseInstant
import com.revenuecat.purchases.kmp.datetime.requestInstant
import com.revenuecat.purchases.kmp.models.CustomerInfo
import com.revenuecat.purchases.kmp.models.EntitlementInfos
import com.revenuecat.purchases.kmp.models.SubscriptionInfo
import com.revenuecat.purchases.kmp.models.Transaction
import kotlin.time.ExperimentalTime
import kotlin.time.Instant

private class CustomerInfoAPI {
@OptIn(ExperimentalTime::class)
Expand All @@ -22,27 +17,21 @@ private class CustomerInfoAPI {
val asubs = activeSubscriptions
val productIds: Set<String> = allPurchasedProductIdentifiers
val ledm: Long? = latestExpirationDateMillis
val lei: kotlinx.datetime.Instant? = latestExpirationInstant
val led: kotlin.time.Instant? = latestExpirationDate
val led: Instant? = latestExpirationDate
val si: Map<String, SubscriptionInfo> = subscriptionsByProductIdentifier
val nst: List<Transaction> = nonSubscriptionTransactions
val opdm: Long? = originalPurchaseDateMillis
val opi: kotlinx.datetime.Instant? = originalPurchaseInstant
val opd: kotlin.time.Instant? = originalPurchaseDate
val opd: Instant? = originalPurchaseDate
val rdm: Long = requestDateMillis
val ri: kotlinx.datetime.Instant = requestInstant
val rd: kotlin.time.Instant = requestDate
val rd: Instant = requestDate
val fsm: Long = firstSeenMillis
val fsi: kotlinx.datetime.Instant = firstSeenInstant
val fs: kotlin.time.Instant = firstSeen
val fs: Instant = firstSeen
val oaui: String = originalAppUserId
val mu: String? = managementUrlString
val allExpirationMillisByProduct: Map<String, Long?> = allExpirationDateMillis
val allExpirationInstantsByProduct: Map<String, kotlinx.datetime.Instant?> = allExpirationInstants
val allExpirationDatesByProduct: Map<String, kotlin.time.Instant?> = allExpirationDates
val allExpirationDatesByProduct: Map<String, Instant?> = allExpirationDates
val allPurchaseMillisByProduct: Map<String, Long?> = allPurchaseDateMillis
val allPurchaseInstantsByProduct: Map<String, kotlinx.datetime.Instant?> = allPurchaseInstants
val allPurchaseDatesByProduct: Map<String, kotlin.time.Instant?> = allPurchaseDates
val allPurchaseDatesByProduct: Map<String, Instant?> = allPurchaseDates
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package com.revenuecat.purchases.kmp.apitester

import com.revenuecat.purchases.kmp.datetime.billingIssueDetectedAtInstant
import com.revenuecat.purchases.kmp.datetime.expirationInstant
import com.revenuecat.purchases.kmp.datetime.latestPurchaseInstant
import com.revenuecat.purchases.kmp.datetime.originalPurchaseInstant
import com.revenuecat.purchases.kmp.datetime.unsubscribeDetectedAtInstant

import com.revenuecat.purchases.kmp.models.EntitlementInfo
import kotlin.time.ExperimentalTime
import kotlin.time.Instant

@Suppress("unused", "UNUSED_VARIABLE")
private class EntitlementInfoAPI {
Expand All @@ -19,25 +16,20 @@ private class EntitlementInfoAPI {
// FIXME re-enable in SDK-3530
// val periodType: PeriodType = periodType
val latestPurchaseDateMillis: Long? = latestPurchaseDateMillis
val latestPurchaseInstant: kotlinx.datetime.Instant? = latestPurchaseInstant
val latestPurchaseDate: kotlin.time.Instant? = latestPurchaseDate
val latestPurchaseDate: Instant? = latestPurchaseDate
val originalPurchaseDateMillis: Long? = originalPurchaseDateMillis
val originalPurchaseInstant: kotlinx.datetime.Instant? = originalPurchaseInstant
val originalPurchaseDate: kotlin.time.Instant? = originalPurchaseDate
val originalPurchaseDate: Instant? = originalPurchaseDate
val expirationDateMillis: Long? = expirationDateMillis
val expirationInstant: kotlinx.datetime.Instant? = expirationInstant
val expirationDate: kotlin.time.Instant? = expirationDate
val expirationDate: Instant? = expirationDate
// FIXME re-enable in SDK-3530
// val store: Store = store
val productIdentifier: String = productIdentifier
val productPlanIdentifier: String? = productPlanIdentifier
val sandbox: Boolean = isSandbox
val unsubscribeDetectedAtMillis: Long? = unsubscribeDetectedAtMillis
val unsubscribeDetectedAtInstant: kotlinx.datetime.Instant? = unsubscribeDetectedAtInstant
val unsubscribeDetectedAt: kotlin.time.Instant? = unsubscribeDetectedAt
val unsubscribeDetectedAt: Instant? = unsubscribeDetectedAt
val billingIssueDetectedAtMillis: Long? = billingIssueDetectedAtMillis
val billingIssueDetectedAtInstant: kotlinx.datetime.Instant? = billingIssueDetectedAtInstant
val billingIssueDetectedAt: kotlin.time.Instant? = billingIssueDetectedAt
val billingIssueDetectedAt: Instant? = billingIssueDetectedAt
// FIXME re-enable in SDK-3530
// val ownershipType: OwnershipType = ownershipType
// FIXME re-enable in SDK-3530
Expand Down
Loading