Skip to content

Conversation

facumenzella
Copy link
Contributor

@facumenzella facumenzella commented Jul 7, 2025

Motivation

While testing the maestro app I realized the xcconfig files were not being picked.

Description

  • Add build configurations to project
  • Extract configurations to be reused
  • Reuse workspace xcconfig files for maestro app
  • Use recommended project settings for those projects
  • Add abstractions for target settings, project settings
  • Remove run action from RevenueCat
  • Add xctestplans to Workspace

Copy link
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

Looks good but I have one question before approving. Would it work without the Local.xcconfig file being present?

Comment on lines 26 to 28
if FileManager.default.fileExists(atPath: "Local.xcconfig") {
additionalFiles.append(.glob(pattern: "../../Local.xcconfig"))
}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe not for this PR, but would it be possible/make sense to have this be reused from the main Project.swift instead of repeated in every Project.swift file?
Maybe something similar to xcconfigFileConfigurations below. E.g. commonFiles.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so, let me re-do this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll tackle this in another PR, but I think that since we're adding those files to the workspace it should be ok if we remove them from each project.

@facumenzella facumenzella requested a review from ajpallares July 8, 2025 10:22
Copy link
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

Looks good but I have one concern/doubt about the Local.xcconfig file being added to the PaywallTester target, which I think is unnecessary

@@ -49,6 +47,9 @@ let project = Project(
sources: [
"../../Tests/TestingApps/PaywallsTester/PaywallsTester/**/*.swift"
],
resources: [
additionalFiles.count == 2 ? "../../Local.xcconfig" : ""
Copy link
Member

Choose a reason for hiding this comment

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

This looks dangerous. And I don't really understand why this is needed? I don't think xcconfig files need to be added to the targets

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed additionalFilesfrom the project definition. Now those are declared in the workspace.

@facumenzella facumenzella requested a review from ajpallares July 8, 2025 17:17
Comment on lines 33 to 37
settings: .settings(
base: [:].automaticCodeSigning(devTeam: .revenueCatTeamID),
configurations: .xcconfigFileConfigurations,
defaultSettings: .essential
),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this can probably be generalized even further (for another PR)

@facumenzella
Copy link
Contributor Author

@RCGitBot please test

public static var xcconfigFileConfigurations: [Configuration] {
[
.debug(name: "Debug", xcconfig: .relativeToRoot("Global.xcconfig")),
.release(name: "Release", xcconfig: .relativeToRoot("Global.xcconfig")),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure about this, I think it shouldn't point to the Global.xcconfig right @ajpallares ?

@facumenzella
Copy link
Contributor Author

@RCGitBot please test

Copy link
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

Great job! We keep iterating on this 💪

Comment on lines +22 to +24
"REVENUECAT_API_KEY": "$(REVENUECAT_API_KEY)",
"REVENUECAT_PROXY_URL_SCHEME": "$(REVENUECAT_PROXY_URL_SCHEME)",
"REVENUECAT_PROXY_URL_HOST": "$(REVENUECAT_PROXY_URL_HOST)"
Copy link
Member

Choose a reason for hiding this comment

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

Question: wouldn't this be covered by the xcconfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mmm good question, I'll try it out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just tested it out, and we need it. Otherwise it's not picked by the bundle

@facumenzella facumenzella merged commit 721d2b1 into main Jul 11, 2025
41 checks passed
@facumenzella facumenzella deleted the fix/add-xcconfig-properly branch July 11, 2025 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants