-
Notifications
You must be signed in to change notification settings - Fork 98
Add StoreKit Configuration support to Xcode Schemes. #3185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -590,6 +590,7 @@ def info_constructors_test_suite(name): | |
env_include_defaults = "1", | ||
launch_target = xcscheme_infos_testable.make_launch_target(), | ||
xcode_configuration = "", | ||
storekit_configuration = "", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, and everywhere. |
||
), | ||
) | ||
|
||
|
@@ -622,6 +623,7 @@ def info_constructors_test_suite(name): | |
env_include_defaults = "0", | ||
launch_target = xcscheme_infos_testable.make_launch_target("L"), | ||
xcode_configuration = "Run", | ||
storekit_configuration = "", | ||
), | ||
|
||
# Expected | ||
|
@@ -652,6 +654,7 @@ def info_constructors_test_suite(name): | |
id = "L", | ||
), | ||
xcode_configuration = "Run", | ||
storekit_configuration = "", | ||
), | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,26 @@ | ||||||||
import Foundation | ||||||||
extension URL { | ||||||||
func relativize(from source: URL) -> String { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We haven’t needed this until now. I question if we still need it. Is there a way to make sure it comes in correctly from Starlark instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I struggled with this a lot. I suppose I could relativize this within starlark and provide a relative path there, but there is no great way to get a true path to the file via the rule itself. The schemes are encoded via json and supplied here: https://github.com/MobileNativeFoundation/rules_xcodeproj/blob/main/xcodeproj/internal/xcodeproj_incremental_rule.bzl#L835 And other things within the scheme match up based on identifier encodings, but this requires a path that is relative to the resultant scheme directory itself in the generated xcodeproj from what I can tell. I am happy to do it differently, but I think the outcome ends up being something considerably more complex. I'm not particularly experienced in working with rules_xcodeproj, so after banging my head on this for a little bit I threw up my hands and went with this. Open to suggestions! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mainly we want to be able to "cache" things in Bazel. Doing this work in the generator means it's re-done every time the generator runs. I'll leave it up to the other @MobileNativeFoundation/rules_xcodeproj-maintainers on what they think about this. |
||||||||
let sourceComponents = source.deletingLastPathComponent().pathComponents | ||||||||
let destComponents = self.pathComponents | ||||||||
|
||||||||
// Find common prefix | ||||||||
var commonPrefixCount = 0 | ||||||||
while commonPrefixCount < sourceComponents.count && | ||||||||
commonPrefixCount < destComponents.count && | ||||||||
sourceComponents[commonPrefixCount] == destComponents[commonPrefixCount] { | ||||||||
commonPrefixCount += 1 | ||||||||
} | ||||||||
|
||||||||
// Build relative path | ||||||||
var result = [String]() | ||||||||
|
||||||||
// Add "../" for each level to go up | ||||||||
result.append(contentsOf: Array(repeating: "..", count: sourceComponents.count - commonPrefixCount)) | ||||||||
|
||||||||
// Add remaining destination components | ||||||||
result.append(contentsOf: destComponents[commonPrefixCount...]) | ||||||||
|
||||||||
return result.joined(separator: "/") | ||||||||
} | ||||||||
} | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this alphabetical.