-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Makes scheme and target optional parameter when getting universal lin… #134571
Changes from 1 commit
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'base/common.dart'; | ||
import 'base/error_handling_io.dart'; | ||
import 'base/file_system.dart'; | ||
import 'base/utils.dart'; | ||
|
@@ -221,9 +222,12 @@ class IosProject extends XcodeBasedProject { | |
/// The return future will resolve to string path to the output file. | ||
Future<String> outputsUniversalLinkSettings({ | ||
required String configuration, | ||
required String scheme, | ||
required String target, | ||
String? scheme, | ||
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. Actually I am not sure if we should support scheme at all. My understanding of scheme is that it contains a set of targets. I am not sure what does it mean to get build settings for a scheme. 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. @andrewkolos can you review this PR? I'm still fuzzy on the relationship between targets and schemes. 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. Hah, I hardly know the difference myself, but—no worries—I'll take a look. 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. As I understand, projects and targets can have Build Settings, while schemes can have a Build Configuration. Settings are applied in this order: project settings, build configuration settings, then target settings1. FootnotesThere 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.
Running 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. So So @andrewkolos Also, Build Configuration is not per scheme but per project, although in flutter tooling we use the scheme to determine the configuration for flavors. When So if I ran
When 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. Looking at our code, seems like we don't really handle multiple targets per scheme. It operates under the assumption that there's only one target per scheme. I think there are improvements that could be made here, but probably out of scope for this PR. I filed an issue to follow up on that: #134669 For your PR, since If 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. Sounds good, thanks for explanation. I will update the code. |
||
String? target, | ||
}) async { | ||
if ((scheme != null) == (target != null)) { | ||
throwToolExit('Only one of scheme or target must be provide but not both'); | ||
} | ||
final XcodeProjectBuildContext context = XcodeProjectBuildContext( | ||
configuration: configuration, | ||
scheme: scheme, | ||
|
@@ -233,6 +237,7 @@ class IosProject extends XcodeBasedProject { | |
.childDirectory('deeplink_data') | ||
.childFile('universal-link-settings-$configuration-$scheme-$target.json') | ||
.create(recursive: true); | ||
|
||
await file.writeAsString(jsonEncode(<String, Object?>{ | ||
'bundleIdentifier': await _productBundleIdentifierWithBuildContext(context), | ||
'teamIdentifier': await _getTeamIdentifier(context), | ||
|
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.
nit: grammar
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.
On second thought, "one of" is fine too. Feel free to ignore.