forked from firka/flutter
[macos] add flavor options to commands in the flutter_tool (#118421)
* Add new macos target configured for flavors * Rename Free App copy-Info.plist to Free App Info.plist * Remove bogus entitlements * Remove Generated.xcconfig * Audit project.pbxproj * Remove unused configs * share one info.plist * Modify scheme so that paid app works * Codesign automatic * Pipe flavor as scheme into xcodebuild * Ignore incoming flavor string * pipe flavor for flutter run to work * Add devicelab tests * Error if host and target device are same for flutter install desktop * Avoid bang (!) by promoting a local. Co-authored-by: Jenn Magder <magder@google.com> * Add supportsInstall property * Override in test classes * Add install test on macOS * Refactor application_package and add tests for package directory Co-authored-by: a-wallen <stephenwallen@google.com> Co-authored-by: Jenn Magder <magder@google.com>
This commit is contained in:
39
dev/devicelab/bin/tasks/flavors_test_macos.dart
Normal file
39
dev/devicelab/bin/tasks/flavors_test_macos.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter_devicelab/framework/devices.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/task_result.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.macos;
|
||||
await task(() async {
|
||||
await createFlavorsTest().call();
|
||||
await createIntegrationTestFlavorsTest().call();
|
||||
|
||||
await inDirectory('${flutterDirectory.path}/dev/integration_tests/flavors', () async {
|
||||
final StringBuffer stderr = StringBuffer();
|
||||
|
||||
await evalFlutter(
|
||||
'install',
|
||||
canFail: true,
|
||||
stderr: stderr,
|
||||
options: <String>[
|
||||
'--d', 'macos',
|
||||
'--flavor', 'free'
|
||||
],
|
||||
);
|
||||
|
||||
final String stderrString = stderr.toString();
|
||||
if (!stderrString.contains('Host and target are the same. Nothing to install.')) {
|
||||
print(stderrString);
|
||||
return TaskResult.failure('Installing a macOS app on macOS should no-op');
|
||||
}
|
||||
});
|
||||
|
||||
return TaskResult.success(null);
|
||||
});
|
||||
}
|
||||
@@ -651,6 +651,7 @@
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors.free;
|
||||
PRODUCT_FLAVOR = free;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
@@ -673,6 +674,7 @@
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors.free;
|
||||
PRODUCT_FLAVOR = free;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
Reference in New Issue
Block a user