Skip to content
Draft
Show file tree
Hide file tree
Changes from 9 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
3 changes: 2 additions & 1 deletion Examples/MagicWeather/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ProjectDescriptionHelpers
let project = Project(
name: "MagicWeatherApp",
organizationName: .revenueCatOrgName,
packages: .projectPackages,
settings: .appProject,
targets: [
.target(
Expand Down Expand Up @@ -34,4 +35,4 @@ let project = Project(
settings: .appTarget
)
]
)
)
3 changes: 2 additions & 1 deletion Examples/MagicWeatherSwiftUI/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ProjectDescriptionHelpers
let project = Project(
name: "MagicWeatherSwiftUI",
organizationName: .revenueCatOrgName,
packages: .projectPackages,
settings: .appProject,
targets: [
.target(
Expand Down Expand Up @@ -34,4 +35,4 @@ let project = Project(
settings: .appTarget
)
],
)
)
3 changes: 2 additions & 1 deletion Examples/PurchaseTester/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ let allDestinations = destinations + [.appleWatch]
let project = Project(
name: "PurchaseTester",
organizationName: .revenueCatOrgName,
packages: .projectPackages,
settings: .appProject,
targets: [
.target(
Expand Down Expand Up @@ -115,4 +116,4 @@ let project = Project(
)
)
]
)
)
3 changes: 2 additions & 1 deletion Examples/rc-maestro/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Foundation
let project = Project(
name: "Maestro",
organizationName: .revenueCatOrgName,
packages: .projectPackages,
settings: .appProject,
targets: [
.target(
Expand Down Expand Up @@ -53,4 +54,4 @@ let project = Project(
)
)
]
)
)
1 change: 1 addition & 0 deletions Examples/testCustomEntitlementsComputation/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let allDestinations: Destinations = [
let project = Project(
name: "testCustomEntitlementsComputation",
organizationName: .revenueCatOrgName,
packages: .projectPackages,
settings: .appProject,
targets: [
.target(
Expand Down
1 change: 1 addition & 0 deletions Projects/APITesters/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ let allDeploymentTargets: DeploymentTargets = .multiplatform(
let project = Project(
name: "APITesters",
organizationName: .revenueCatOrgName,
packages: .projectPackages,
settings: .framework,
targets: [
.target(
Expand Down
1 change: 1 addition & 0 deletions Projects/PaywallValidationTester/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ let allDeploymentTargets: DeploymentTargets = .multiplatform(
let project = Project(
name: "PaywallValidationTester",
organizationName: .revenueCatOrgName,
packages: .projectPackages,
settings: .appProject,
targets: [
.target(
Expand Down
1 change: 1 addition & 0 deletions Projects/PaywallsTester/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ let allDeploymentTargets: DeploymentTargets = .multiplatform(
let project = Project(
name: "PaywallsTester",
organizationName: .revenueCatOrgName,
packages: .projectPackages,
settings: .appProject,
targets: [
.target(
Expand Down
1 change: 1 addition & 0 deletions Projects/RevenueCatUI/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let allDeploymentTargets: DeploymentTargets = .multiplatform(
let project = Project(
name: "RevenueCatUI",
organizationName: .revenueCatOrgName,
packages: .projectPackages,
settings: .framework,
targets: [
.target(
Expand Down
91 changes: 0 additions & 91 deletions Projects/v3LoadShedderIntegration/Project.swift

This file was deleted.

6 changes: 3 additions & 3 deletions Tests/BackendIntegrationTests/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import Foundation

enum Constants {

static let apiKey = "REVENUECAT_API_KEY"
static let loadShedderApiKey = "REVENUECAT_LOAD_SHEDDER_API_KEY"
static let apiKey = "rGogYWEdzrENUEzEoYXZNUkzoPEbEvfb"
static let loadShedderApiKey = "appl_aRfhwrmSlzrSrQagvIipFKcFLKv"
static let customEntitlementComputationApiKey = "REVENUECAT_CUSTOM_ENTITLEMENT_COMPUTATION_API_KEY"

// Server URL for the tests. If set to empty string, we'll use the default URL.
static let proxyURL = "REVENUECAT_PROXY_URL"
static let proxyURL = ""

static let userDefaultsSuiteName = "BackendIntegrationTests"
static let storeKitConfigFileName = "RevenueCat_IntegrationPurchaseTesterConfiguration"
Expand Down
20 changes: 1 addition & 19 deletions Tuist/Package.resolved

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

8 changes: 0 additions & 8 deletions Tuist/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ let package = Package(
url: "https://github.com/pointfreeco/swift-snapshot-testing",
revision: "26ed3a2b4a2df47917ca9b790a57f91285b923fb"
),
.package(
url: "https://github.com/RevenueCat/purchases-ios",
branch: "main"
Comment on lines -32 to -34
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tuist/ProjectDescriptionHelpers/ProjectDescriptionPackages.swift already handles local vs remote packages based on dependencyMode, so this dependency is redundant

),
.package(
url: "https://github.com/RevenueCat/purchases-ios-spm",
revision: "3.14.4"
),
Comment on lines -36 to -39
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was only needed for v3LoadShedderIntegration, which has been removed from tuist

.package(
url: "https://github.com/AliSoftware/OHHTTPStubs",
revision: "9.1.0"
Expand Down
43 changes: 34 additions & 9 deletions Tuist/ProjectDescriptionHelpers/Environment.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
import ProjectDescription

public enum DependencyMode {
/// The dependency is a local Swift Package Manager package.
case localSwiftPackage

/// The dependency is a local Xcode project. Tuist's default behavior.
case localXcodeProject

/// The dependency is a remote Swift Package Manager package.
case remoteSwiftPackage

/// The dependency is a remote Xcode project.
case remoteXcodeProject
}

extension Environment {
/// Returns whether the current environment is local.
/// This is determined by the `rcLocal` environment variable, defaulting to `true` if not set.
///
/// Returns the dependency mode for RevenueCat/RevenueCatUI.
///
/// Example usage:
/// ```bash
/// # Generate project with local environment (default)
/// # Generate project with local Swift Package dependency (default)
/// tuist generate
///
/// # Generate project with non-local environment
/// TUIST_RC_LOCAL=false tuist generate
///
/// # Generate project with Xcode project dependency (instead of Swift Package)
/// TUIST_RC_XCODE_PROJECT=true tuist generate
///
/// # Generate project with remote dependency (instead of local dependency)
/// TUIST_RC_REMOTE=true tuist generate
/// ```
public static var local: Bool {
Environment.rcLocal.getBoolean(default: true)
public static var dependencyMode: DependencyMode {
// Note: Environment variable names are prefixed with TUIST_ automatically, therefore:
// rcRemote reads TUIST_RC_REMOTE
// rcXcodeProject reads TUIST_RC_XCODE_PROJECT
let remote = Environment.rcRemote.getBoolean(default: false)
let xcodeProject = Environment.rcXcodeProject.getBoolean(default: false)
if remote {
return xcodeProject ? .remoteXcodeProject : .remoteSwiftPackage
} else {
return xcodeProject ? .localXcodeProject : .localSwiftPackage
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import ProjectDescription

extension Array<ProjectDescription.Package> {

public static var projectPackages: [ProjectDescription.Package] {
if Environment.dependencyMode == .localSwiftPackage {
return [.package(path: "../..")]
} else if Environment.dependencyMode == .remoteSwiftPackage {
return [.package(url: "https://github.com/RevenueCat/purchases-ios", .branch("main"))]
} else {
return []
}
}
}
Loading