Unverified Commit 8642a9c0 authored by Zachary Anderson's avatar Zachary Anderson Committed by GitHub

Quote arguments to flutter assemble in xcode_backend.sh (#86534)

parent 8c5ed2fd
#include "ephemeral/Flutter-Generated.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "hello_world.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "hello_world.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "hello_world.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "hello_world.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
// 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 Cocoa
import FlutterMacOS
@NSApplicationMain
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
}
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "app_icon_16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "app_icon_32.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "app_icon_32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "app_icon_64.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "app_icon_128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "app_icon_256.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "app_icon_256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "app_icon_512.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "app_icon_512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "app_icon_1024.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
This diff is collapsed.
// Application-level settings for the Runner target.
//
// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
// future. If not, the values below would default to using the project name when this becomes a
// 'flutter create' template.
// The application's name. By default this is also the title of the Flutter window.
PRODUCT_NAME = hello_world
// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = io.flutter.examples.helloWorld
// The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2021 io.flutter.examples. All rights reserved.
#include "../../Flutter/Flutter-Debug.xcconfig"
#include "Warnings.xcconfig"
#include "../../Flutter/Flutter-Release.xcconfig"
#include "Warnings.xcconfig"
WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
GCC_WARN_UNDECLARED_SELECTOR = YES
CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
CLANG_WARN_PRAGMA_PACK = YES
CLANG_WARN_STRICT_PROTOTYPES = YES
CLANG_WARN_COMMA = YES
GCC_WARN_STRICT_SELECTOR_MATCH = YES
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
GCC_WARN_SHADOW = YES
CLANG_WARN_UNREACHABLE_CODE = YES
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>$(PRODUCT_COPYRIGHT)</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
// 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 Cocoa
import FlutterMacOS
class MainFlutterWindow: NSWindow {
override func awakeFromNib() {
let flutterViewController = FlutterViewController.init()
let windowFrame = self.frame
self.contentViewController = flutterViewController
self.setFrame(windowFrame, display: true)
RegisterGeneratedPlugins(registry: flutterViewController)
super.awakeFromNib()
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
</dict>
</plist>
......@@ -22,22 +22,12 @@ BuildApp() {
local project_path="${SOURCE_ROOT}/.."
RunCommand pushd "${project_path}" > /dev/null
# Set the verbose flag.
local verbose_flag=""
if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then
verbose_flag="--verbose"
fi
# Set the target file.
local target_path="lib/main.dart"
if [[ -n "$FLUTTER_TARGET" ]]; then
target_path="${FLUTTER_TARGET}"
fi
if [[ -n "$FLUTTER_ENGINE" ]]; then
flutter_engine_flag="--local-engine-src-path=${FLUTTER_ENGINE}"
fi
# Set the build mode
local build_mode="$(echo "${FLUTTER_BUILD_MODE:-${CONFIGURATION}}" | tr "[:upper:]" "[:lower:]")"
......@@ -54,7 +44,6 @@ BuildApp() {
EchoError "========================================================================"
exit -1
fi
local_engine_flag="--local-engine=${LOCAL_ENGINE}"
fi
# The path where the input/output xcfilelists are stored. These are used by xcode
......@@ -63,45 +52,50 @@ BuildApp() {
local build_inputs_path="${ephemeral_dir}/FlutterInputs.xcfilelist"
local build_outputs_path="${ephemeral_dir}/FlutterOutputs.xcfilelist"
local performance_measurement_option=""
# Construct the "flutter assemble" argument array. Arguments should be added
# as quoted string elements of the flutter_args array, otherwise an argument
# (like a path) with spaces in it might be interpreted as two separate
# arguments.
local flutter_args=("${FLUTTER_ROOT}/bin/flutter")
if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then
flutter_args+=('--verbose')
fi
if [[ -n "$FLUTTER_ENGINE" ]]; then
flutter_args+=("--local-engine-src-path=${FLUTTER_ENGINE}")
fi
if [[ -n "$LOCAL_ENGINE" ]]; then
flutter_args+=("--local-engine=${LOCAL_ENGINE}")
fi
flutter_args+=(
"assemble"
"--no-version-check"
"-dTargetPlatform=darwin"
"-dDarwinArchs=x86_64"
"-dTargetFile=${target_path}"
"-dBuildMode=${build_mode}"
"-dTreeShakeIcons=${TREE_SHAKE_ICONS}"
"-dDartObfuscation=${DART_OBFUSCATION}"
"-dSplitDebugInfo=${SPLIT_DEBUG_INFO}"
"-dTrackWidgetCreation=${TRACK_WIDGET_CREATION}"
"--DartDefines=${DART_DEFINES}"
"--ExtraGenSnapshotOptions=${EXTRA_GEN_SNAPSHOT_OPTIONS}"
"--ExtraFrontEndOptions=${EXTRA_FRONT_END_OPTIONS}"
"--build-inputs=${build_inputs_path}"
"--build-outputs=${build_outputs_path}"
"--output=${BUILT_PRODUCTS_DIR}"
)
if [[ -n "$PERFORMANCE_MEASUREMENT_FILE" ]]; then
performance_measurement_option="--performance-measurement-file=${PERFORMANCE_MEASUREMENT_FILE}"
flutter_args+=("--performance-measurement-file=${PERFORMANCE_MEASUREMENT_FILE}")
fi
local bundle_sksl_path=""
if [[ -n "$BUNDLE_SKSL_PATH" ]]; then
bundle_sksl_path="-dBundleSkSLPath=${BUNDLE_SKSL_PATH}"
flutter_args+=("-dBundleSkSLPath=${BUNDLE_SKSL_PATH}")
fi
local code_size_directory=""
if [[ -n "$CODE_SIZE_DIRECTORY" ]]; then
code_size_directory="-dCodeSizeDirectory=${CODE_SIZE_DIRECTORY}"
flutter_args+=("-dCodeSizeDirectory=${CODE_SIZE_DIRECTORY}")
fi
flutter_args+=("${build_mode}_macos_bundle_flutter_assets")
RunCommand "${FLUTTER_ROOT}/bin/flutter" \
${verbose_flag} \
${flutter_engine_flag} \
${local_engine_flag} \
assemble \
--no-version-check \
${performance_measurement_option} \
-dTargetPlatform=darwin \
-dDarwinArchs=x86_64 \
-dTargetFile="${target_path}" \
-dBuildMode="${build_mode}" \
-dTreeShakeIcons="${TREE_SHAKE_ICONS}" \
-dDartObfuscation="${DART_OBFUSCATION}" \
-dSplitDebugInfo="${SPLIT_DEBUG_INFO}" \
-dTrackWidgetCreation="${TRACK_WIDGET_CREATION}" \
${bundle_sksl_path} \
${code_size_directory} \
--DartDefines="${DART_DEFINES}" \
--ExtraGenSnapshotOptions="${EXTRA_GEN_SNAPSHOT_OPTIONS}" \
--ExtraFrontEndOptions="${EXTRA_FRONT_END_OPTIONS}" \
--build-inputs="${build_inputs_path}" \
--build-outputs="${build_outputs_path}" \
--output="${BUILT_PRODUCTS_DIR}" \
"${build_mode}_macos_bundle_flutter_assets"
RunCommand "${flutter_args[@]}"
}
# Adds the App.framework as an embedded binary and the flutter_assets as
......
......@@ -80,11 +80,6 @@ BuildApp() {
derived_dir="${project_path}/.ios/Flutter"
fi
local bundle_sksl_path=""
if [[ -n "$BUNDLE_SKSL_PATH" ]]; then
bundle_sksl_path="-dBundleSkSLPath=${BUNDLE_SKSL_PATH}"
fi
# Default value of assets_path is flutter_assets
local assets_path="flutter_assets"
# The value of assets_path can set by add FLTAssetsPath to
......@@ -113,14 +108,8 @@ is set to release or run \"flutter build ios --release\", then re-run Archive fr
fi
local framework_path="${FLUTTER_ROOT}/bin/cache/artifacts/engine/${artifact_variant}"
local flutter_engine_flag=""
local local_engine_flag=""
local flutter_framework="${framework_path}/Flutter.xcframework"
if [[ -n "$FLUTTER_ENGINE" ]]; then
flutter_engine_flag="--local-engine-src-path=${FLUTTER_ENGINE}"
fi
if [[ -n "$LOCAL_ENGINE" ]]; then
if [[ $(echo "$LOCAL_ENGINE" | tr "[:upper:]" "[:lower:]") != *"$build_mode"* ]]; then
EchoError "========================================================================"
......@@ -134,7 +123,6 @@ is set to release or run \"flutter build ios --release\", then re-run Archive fr
EchoError "========================================================================"
exit -1
fi
local_engine_flag="--local-engine=${LOCAL_ENGINE}"
flutter_framework="${FLUTTER_ENGINE}/out/${LOCAL_ENGINE}/Flutter.xcframework"
fi
local bitcode_flag=""
......@@ -149,51 +137,53 @@ is set to release or run \"flutter build ios --release\", then re-run Archive fr
RunCommand pushd "${project_path}" > /dev/null
local verbose_flag=""
# Construct the "flutter assemble" argument array. Arguments should be added
# as quoted string elements of the flutter_args array, otherwise an argument
# (like a path) with spaces in it might be interpreted as two separate
# arguments.
local flutter_args=("${FLUTTER_ROOT}/bin/flutter")
if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then
verbose_flag="--verbose"
flutter_args+=('--verbose')
fi
local performance_measurement_option=""
if [[ -n "$PERFORMANCE_MEASUREMENT_FILE" ]]; then
performance_measurement_option="--performance-measurement-file=${PERFORMANCE_MEASUREMENT_FILE}"
if [[ -n "$FLUTTER_ENGINE" ]]; then
flutter_args+=("--local-engine-src-path=${FLUTTER_ENGINE}")
fi
local code_size_directory=""
if [[ -n "$CODE_SIZE_DIRECTORY" ]]; then
code_size_directory="-dCodeSizeDirectory=${CODE_SIZE_DIRECTORY}"
if [[ -n "$LOCAL_ENGINE" ]]; then
flutter_args+=("--local-engine=${LOCAL_ENGINE}")
fi
flutter_args+=(
"assemble"
"--no-version-check"
"--output=${BUILT_PRODUCTS_DIR}/"
"-dTargetPlatform=ios"
"-dTargetFile=${target_path}"
"-dBuildMode=${build_mode}"
"-dIosArchs=${ARCHS}"
"-dSdkRoot=${SDKROOT}"
"-dSplitDebugInfo=${SPLIT_DEBUG_INFO}"
"-dTreeShakeIcons=${TREE_SHAKE_ICONS}"
"-dTrackWidgetCreation=${TRACK_WIDGET_CREATION}"
"-dDartObfuscation=${DART_OBFUSCATION}"
"-dEnableBitcode=${bitcode_flag}"
"--ExtraGenSnapshotOptions=${EXTRA_GEN_SNAPSHOT_OPTIONS}"
"--DartDefines=${DART_DEFINES}"
"--ExtraFrontEndOptions=${EXTRA_FRONT_END_OPTIONS}"
)
if [[ -n "$PERFORMANCE_MEASUREMENT_FILE" ]]; then
flutter_args+=("--performance-measurement-file=${PERFORMANCE_MEASUREMENT_FILE}")
fi
local codesign_identity_flag=""
if [[ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" && "${CODE_SIGNING_REQUIRED:-}" != "NO" ]]; then
codesign_identity_flag="-dCodesignIdentity=${EXPANDED_CODE_SIGN_IDENTITY}"
flutter_args+=("-dCodesignIdentity=${EXPANDED_CODE_SIGN_IDENTITY}")
fi
if [[ -n "$BUNDLE_SKSL_PATH" ]]; then
flutter_args+=("-dBundleSkSLPath=${BUNDLE_SKSL_PATH}")
fi
if [[ -n "$CODE_SIZE_DIRECTORY" ]]; then
flutter_args+=("-dCodeSizeDirectory=${CODE_SIZE_DIRECTORY}")
fi
flutter_args+=("${build_mode}_ios_bundle_flutter_assets")
RunCommand "${FLUTTER_ROOT}/bin/flutter" \
${verbose_flag} \
${flutter_engine_flag} \
${local_engine_flag} \
assemble \
--no-version-check \
--output="${BUILT_PRODUCTS_DIR}/" \
${performance_measurement_option} \
-dTargetPlatform=ios \
-dTargetFile="${target_path}" \
-dBuildMode=${build_mode} \
-dIosArchs="${ARCHS}" \
-dSdkRoot="${SDKROOT}" \
-dSplitDebugInfo="${SPLIT_DEBUG_INFO}" \
-dTreeShakeIcons="${TREE_SHAKE_ICONS}" \
-dTrackWidgetCreation="${TRACK_WIDGET_CREATION}" \
-dDartObfuscation="${DART_OBFUSCATION}" \
-dEnableBitcode="${bitcode_flag}" \
${codesign_identity_flag} \
${bundle_sksl_path} \
${code_size_directory} \
--ExtraGenSnapshotOptions="${EXTRA_GEN_SNAPSHOT_OPTIONS}" \
--DartDefines="${DART_DEFINES}" \
--ExtraFrontEndOptions="${EXTRA_FRONT_END_OPTIONS}" \
"${build_mode}_ios_bundle_flutter_assets"
RunCommand "${flutter_args[@]}"
if [[ $? -ne 0 ]]; then
EchoError "Failed to package ${project_path}."
......
......@@ -16,6 +16,7 @@ import 'test_utils.dart';
const String apkDebugMessage = 'A summary of your APK analysis can be found at: ';
const String iosDebugMessage = 'A summary of your iOS bundle analysis can be found at: ';
const String macOSDebugMessage = 'A summary of your macOS bundle analysis can be found at: ';
const String runDevToolsMessage = 'flutter pub global activate devtools; flutter pub global run devtools ';
void main() {
......@@ -55,11 +56,14 @@ void main() {
testWithoutContext('--analyze-size flag produces expected output on hello_world for iOS', () async {
final String workingDirectory = fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world');
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
final Directory tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_size_test.');
final Directory codeSizeDir = tempDir.childDirectory('code size dir')..createSync();
final ProcessResult result = await processManager.run(<String>[
flutterBin,
'build',
'ios',
'--analyze-size',
'--code-size-directory=${codeSizeDir.path}',
'--no-codesign',
], workingDirectory: workingDirectory);
......@@ -79,10 +83,58 @@ void main() {
.firstWhere((String line) => line.contains(runDevToolsMessage));
final String commandArguments = devToolsCommand.split(runDevToolsMessage).last.trim();
final String relativeAppSizePath = outputFilePath.split('.flutter-devtools/').last.trim();
expect(commandArguments.contains('--appSizeBase=$relativeAppSizePath'), isTrue);
expect(codeSizeDir.existsSync(), true);
expect(result.exitCode, 0);
tempDir.deleteSync(recursive: true);
}, skip: !platform.isMacOS);
testWithoutContext('--analyze-size flag produces expected output on hello_world for macOS', () async {
final String workingDirectory = fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world');
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
final Directory tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_size_test.');
final Directory codeSizeDir = tempDir.childDirectory('code size dir')..createSync();
final ProcessResult configResult = await processManager.run(<String>[
flutterBin,
'config',
'--enable-macos-desktop',
], workingDirectory: workingDirectory);
print(configResult.stdout);
print(configResult.stderr);
final ProcessResult result = await processManager.run(<String>[
flutterBin,
'build',
'macos',
'--analyze-size',
'--code-size-directory=${codeSizeDir.path}',
], workingDirectory: workingDirectory);
print(result.stdout);
print(result.stderr);
expect(result.stdout.toString(), contains('Dart AOT symbols accounted decompressed size'));
final String line = result.stdout.toString()
.split('\n')
.firstWhere((String line) => line.contains(macOSDebugMessage));
final String outputFilePath = line.split(macOSDebugMessage).last.trim();
expect(fileSystem.file(fileSystem.path.join(workingDirectory, outputFilePath)), exists);
final String devToolsCommand = result.stdout.toString()
.split('\n')
.firstWhere((String line) => line.contains(runDevToolsMessage));
final String commandArguments = devToolsCommand.split(runDevToolsMessage).last.trim();
final String relativeAppSizePath = outputFilePath.split('.flutter-devtools/').last.trim();
expect(commandArguments.contains('--appSizeBase=$relativeAppSizePath'), isTrue);
expect(codeSizeDir.existsSync(), true);
expect(result.exitCode, 0);
}, skip: true); // Extremely flaky due to https://github.com/flutter/flutter/issues/68144
tempDir.deleteSync(recursive: true);
}, skip: !platform.isMacOS);
testWithoutContext('--analyze-size is only supported in release mode', () async {
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
......
......@@ -66,7 +66,7 @@ void main() {
'--no-codesign',
'--${buildMode.name}',
'--obfuscate',
'--split-debug-info=foo/',
'--split-debug-info=foo debug info/',
], workingDirectory: projectRoot);
buildPath = fileSystem.directory(fileSystem.path.join(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment