Skip to content
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

Default new project to the ios-signing-cert development team #90021

Merged
merged 4 commits into from
Oct 7, 2021

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Sep 14, 2021

Set DEVELOPMENT_TEAM Xcode build setting if the Developer Team is already saved in flutter config.

Fixes #90020

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. t: xcode "xcodebuild" on iOS and general Xcode project management labels Sep 14, 2021
@jmagman jmagman self-assigned this Sep 14, 2021
@google-cla google-cla bot added the cla: yes label Sep 14, 2021
@jmagman jmagman marked this pull request as draft September 14, 2021 22:51
@jmagman jmagman force-pushed the developer-team branch 2 times, most recently from 8ae5e5c to 8966162 Compare September 15, 2021 02:15
@jmagman jmagman force-pushed the developer-team branch 2 times, most recently from f15c3f1 to c54464b Compare September 16, 2021 00:47
@jmagman jmagman marked this pull request as ready for review September 16, 2021 01:29
required Terminal terminal,
bool shouldExitOnNoCerts = false,
}) async {
if (!platform.isMacOS) {
Copy link
Member

Choose a reason for hiding this comment

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

should this be an exception?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member Author

Choose a reason for hiding this comment

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

Or not...

[plugin_dependencies_test] [STDOUT] Executing: /b/s/w/ir/x/w/recipe_cleanup/tmpbKETFw/flutter sdk/bin/flutter create --org io.flutter.devicelab.plugin_a --template=plugin --platforms=android,ios /b/s/w/ir/x/t/flutter_plugin_dependencies.FXIOVA/plugin_a in /b/s/w/ir/x/t/flutter_plugin_dependencies.FXIOVA with environment {BOT: true, LANG: en_US.UTF-8}
[plugin_dependencies_test] [STDOUT] stderr: 
[plugin_dependencies_test] [STDOUT] stderr: Exception: Codesigning identity lookup is only supported on macOS.

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8834084345731287777/+/u/run_plugin_dependencies_test/test_stdout

Let's keep this null, flutter create follows this code path on non-macOS as well, you should be able to create an iOS app on any platform (and presumably check it in and later test on macOS).

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

LGTM % some nits

@@ -231,6 +232,17 @@ class CreateCommand extends CreateBase {
}

final String dartSdk = globals.cache.dartSdkBuild;
final bool includeIos = featureFlags.isIOSEnabled && platforms.contains('ios');
String developmentTeam;
Copy link
Contributor

Choose a reason for hiding this comment

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

How about init it with '', so later, we only need to check if (iosDevelopmentTeam.isNotEmpty), it would also fit better with NNBD, and make the migration easier.

And nits: maybe iosDevelopmentTeam would be a better name as it was only used for iOS.

Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer if we left it as uninitialized, so we can differentiate between explicitly set as an empty string and never set.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a specific meaning of development team explicitly set as empty string? @jmagman Might be able to answer that. I was looking at the line below 'iosDevelopmentTeam': iosDevelopmentTeam ?? '', thinking that they should be the same.

Copy link
Member Author

Choose a reason for hiding this comment

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

In terms of build settings, '' overrides the project setting and sets it to nothing. Null should inherit from the project setting.

Copy link
Member Author

Choose a reason for hiding this comment

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

And generally, null means uninitialized, empty string means set to something, and that thing is the empty string. We shouldn't have the empty string mean "not set" in some places and not others.

@@ -375,6 +376,8 @@ abstract class CreateBase extends FlutterCommand {
'withPluginHook': withPluginHook,
'androidLanguage': androidLanguage,
'iosLanguage': iosLanguage,
'hasIosDevelopmentTeam': iosDevelopmentTeam != null && iosDevelopmentTeam.isNotEmpty,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can just be 'hasIosDevelopmentTeam': iosDevelopmentTeam.isNotEmpty if taking my suggestion above.

@@ -375,6 +376,8 @@ abstract class CreateBase extends FlutterCommand {
'withPluginHook': withPluginHook,
'androidLanguage': androidLanguage,
'iosLanguage': iosLanguage,
'hasIosDevelopmentTeam': iosDevelopmentTeam != null && iosDevelopmentTeam.isNotEmpty,
'iosDevelopmentTeam': iosDevelopmentTeam ?? '',
Copy link
Contributor

Choose a reason for hiding this comment

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

Can just be 'iosDevelopmentTeam': iosDevelopmentTeam, if taking my suggestion above.

packages/flutter_tools/lib/src/ios/code_signing.dart Outdated Show resolved Hide resolved
@@ -437,6 +443,9 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
{{#hasIosDevelopmentTeam}}
DEVELOPMENT_TEAM = {{iosDevelopmentTeam}};
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, what happens for DEVELOPMENT_TEAM = "";, would it be cleaner that DEVELOPMENT_TEAM is set to an empty string if the developer didn't set it?

Copy link
Member Author

Choose a reason for hiding this comment

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

If DEVELOPMENT_TEAM = ""; then the user could set it at the project level (say they have multiple executable targets, like notification extensions, etc) but it would be set to nothing at the target level. If we don't have something good to put here we should leave it off.

@cyanglaz
Copy link
Contributor

cyanglaz commented Oct 6, 2021

@jmagman Do you think you will land this soon? If so I can start the project-name work after you land this so I can directly use the new flags etc.

@jmagman
Copy link
Member Author

jmagman commented Oct 6, 2021

@jmagman Do you think you will land this soon? If so I can start the project-name work after you land this so I can directly use the new flags etc.

Sorry, this fell down the list a bit. I will work on this today.

@cyanglaz
Copy link
Contributor

cyanglaz commented Oct 6, 2021

@jmagman Do you think you will land this soon? If so I can start the project-name work after you land this so I can directly use the new flags etc.

Sorry, this fell down the list a bit. I will work on this today.

Awesome, then I'll hold off coding the project-name thing until we land this one so I can directly use your code :)

Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

@fluttergithubbot fluttergithubbot merged commit 91d1e3e into flutter:master Oct 7, 2021
@jmagman jmagman deleted the developer-team branch October 7, 2021 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default new iOS Xcode projects to the Developer Team saved in config "ios-signing-cert"
4 participants