Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
82410a5a
Unverified
Commit
82410a5a
authored
Feb 07, 2020
by
Jonah Williams
Committed by
GitHub
Feb 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] support iOS and macOS with split-debug-info and tree-shake-icons (#50296)
parent
8c398a8d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
7 deletions
+44
-7
macos_assemble.sh
packages/flutter_tools/bin/macos_assemble.sh
+2
-1
xcode_backend.sh
packages/flutter_tools/bin/xcode_backend.sh
+2
-1
build.dart
packages/flutter_tools/lib/src/base/build.dart
+2
-2
assets.dart
...es/flutter_tools/lib/src/build_system/targets/assets.dart
+1
-1
ios.dart
packages/flutter_tools/lib/src/build_system/targets/ios.dart
+2
-0
build_ios.dart
packages/flutter_tools/lib/src/commands/build_ios.dart
+1
-0
build_macos.dart
packages/flutter_tools/lib/src/commands/build_macos.dart
+1
-0
build_macos.dart
packages/flutter_tools/lib/src/macos/build_macos.dart
+0
-2
build_test.dart
...ges/flutter_tools/test/general.shard/base/build_test.dart
+33
-0
No files found.
packages/flutter_tools/bin/macos_assemble.sh
View file @
82410a5a
...
@@ -75,7 +75,8 @@ RunCommand "${FLUTTER_ROOT}/bin/flutter" --suppress-analytics \
...
@@ -75,7 +75,8 @@ RunCommand "${FLUTTER_ROOT}/bin/flutter" --suppress-analytics \
-dTargetPlatform
=
darwin-x64
\
-dTargetPlatform
=
darwin-x64
\
-dTargetFile
=
"
${
target_path
}
"
\
-dTargetFile
=
"
${
target_path
}
"
\
-dBuildMode
=
"
${
build_mode
}
"
\
-dBuildMode
=
"
${
build_mode
}
"
\
-dFontSubset
=
"
${
icon_tree_shaker_flag
}
"
\
-dTreeShakeIcons
=
"
${
icon_tree_shaker_flag
}
"
\
-dSplitDebugInfo
=
"
${
SPLIT_DEBUG_INFO
}
"
\
--build-inputs
=
"
${
build_inputs_path
}
"
\
--build-inputs
=
"
${
build_inputs_path
}
"
\
--build-outputs
=
"
${
build_outputs_path
}
"
\
--build-outputs
=
"
${
build_outputs_path
}
"
\
--output
=
"
${
ephemeral_dir
}
"
\
--output
=
"
${
ephemeral_dir
}
"
\
...
...
packages/flutter_tools/bin/xcode_backend.sh
View file @
82410a5a
...
@@ -171,7 +171,8 @@ BuildApp() {
...
@@ -171,7 +171,8 @@ BuildApp() {
-dTargetFile
=
"
${
target_path
}
"
\
-dTargetFile
=
"
${
target_path
}
"
\
-dBuildMode
=
${
build_mode
}
\
-dBuildMode
=
${
build_mode
}
\
-dIosArchs
=
"
${
ARCHS
}
"
\
-dIosArchs
=
"
${
ARCHS
}
"
\
-dFontSubset
=
"
${
icon_tree_shaker_flag
}
"
\
-dSplitDebugInfo
=
"
${
SPLIT_DEBUG_INFO
}
"
\
-dTreeShakeIcons
=
"
${
icon_tree_shaker_flag
}
"
\
-dTrackWidgetCreation
=
"
${
track_widget_creation_flag
}
"
\
-dTrackWidgetCreation
=
"
${
track_widget_creation_flag
}
"
\
-dEnableBitcode
=
"
${
bitcode_flag
}
"
\
-dEnableBitcode
=
"
${
bitcode_flag
}
"
\
"
${
build_mode
}
_ios_bundle_flutter_assets"
"
${
build_mode
}
_ios_bundle_flutter_assets"
...
...
packages/flutter_tools/lib/src/base/build.dart
View file @
82410a5a
...
@@ -147,7 +147,7 @@ class AOTSnapshotter {
...
@@ -147,7 +147,7 @@ class AOTSnapshotter {
// multiple debug files.
// multiple debug files.
final
String
archName
=
getNameForTargetPlatform
(
platform
,
darwinArch:
darwinArch
);
final
String
archName
=
getNameForTargetPlatform
(
platform
,
darwinArch:
darwinArch
);
final
String
debugFilename
=
'app.
$archName
.symbols'
;
final
String
debugFilename
=
'app.
$archName
.symbols'
;
if
(
splitDebugInfo
!=
null
)
{
if
(
splitDebugInfo
?.
isNotEmpty
??
false
)
{
globals
.
fs
.
directory
(
splitDebugInfo
)
globals
.
fs
.
directory
(
splitDebugInfo
)
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
}
}
...
@@ -157,7 +157,7 @@ class AOTSnapshotter {
...
@@ -157,7 +157,7 @@ class AOTSnapshotter {
// Faster async/await
// Faster async/await
'--no-causal-async-stacks'
,
'--no-causal-async-stacks'
,
'--lazy-async-stacks'
,
'--lazy-async-stacks'
,
if
(
splitDebugInfo
!=
null
)
...<
String
>[
if
(
splitDebugInfo
?.
isNotEmpty
??
false
)
...<
String
>[
'--dwarf-stack-traces'
,
'--dwarf-stack-traces'
,
'--save-debugging-info=
${globals.fs.path.join(splitDebugInfo, debugFilename)}
'
'--save-debugging-info=
${globals.fs.path.join(splitDebugInfo, debugFilename)}
'
]
]
...
...
packages/flutter_tools/lib/src/build_system/targets/assets.dart
View file @
82410a5a
...
@@ -49,7 +49,7 @@ Future<Depfile> copyAssets(Environment environment, Directory outputDirectory) a
...
@@ -49,7 +49,7 @@ Future<Depfile> copyAssets(Environment environment, Directory outputDirectory) a
try
{
try
{
// This will result in strange looking files, for example files with `/`
// This will result in strange looking files, for example files with `/`
// on Windows or files that end up getting URI encoded such as `#.ext`
// on Windows or files that end up getting URI encoded such as `#.ext`
// to `%23.ext`.
However, we have to keep it this way since the
// to `%23.ext`. However, we have to keep it this way since the
// platform channels in the framework will URI encode these values,
// platform channels in the framework will URI encode these values,
// and the native APIs will look for files this way.
// and the native APIs will look for files this way.
final
File
file
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
outputDirectory
.
path
,
entry
.
key
));
final
File
file
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
outputDirectory
.
path
,
entry
.
key
));
...
...
packages/flutter_tools/lib/src/build_system/targets/ios.dart
View file @
82410a5a
...
@@ -17,6 +17,7 @@ import '../depfile.dart';
...
@@ -17,6 +17,7 @@ import '../depfile.dart';
import
'../exceptions.dart'
;
import
'../exceptions.dart'
;
import
'assets.dart'
;
import
'assets.dart'
;
import
'dart.dart'
;
import
'dart.dart'
;
import
'icon_tree_shaker.dart'
;
/// Supports compiling a dart kernel file to an assembly file.
/// Supports compiling a dart kernel file to an assembly file.
///
///
...
@@ -237,6 +238,7 @@ abstract class IosAssetBundle extends Target {
...
@@ -237,6 +238,7 @@ abstract class IosAssetBundle extends Target {
List
<
Source
>
get
inputs
=>
const
<
Source
>[
List
<
Source
>
get
inputs
=>
const
<
Source
>[
Source
.
pattern
(
'{BUILD_DIR}/App'
),
Source
.
pattern
(
'{BUILD_DIR}/App'
),
Source
.
pattern
(
'{PROJECT_DIR}/pubspec.yaml'
),
Source
.
pattern
(
'{PROJECT_DIR}/pubspec.yaml'
),
...
IconTreeShaker
.
inputs
,
];
];
@override
@override
...
...
packages/flutter_tools/lib/src/commands/build_ios.dart
View file @
82410a5a
...
@@ -19,6 +19,7 @@ import 'build.dart';
...
@@ -19,6 +19,7 @@ import 'build.dart';
class
BuildIOSCommand
extends
BuildSubCommand
{
class
BuildIOSCommand
extends
BuildSubCommand
{
BuildIOSCommand
()
{
BuildIOSCommand
()
{
addTreeShakeIconsFlag
();
addTreeShakeIconsFlag
();
addSplitDebugInfoOption
();
addBuildModeFlags
(
defaultToRelease:
false
);
addBuildModeFlags
(
defaultToRelease:
false
);
usesTargetOption
();
usesTargetOption
();
usesFlavorOption
();
usesFlavorOption
();
...
...
packages/flutter_tools/lib/src/commands/build_macos.dart
View file @
82410a5a
...
@@ -18,6 +18,7 @@ import 'build.dart';
...
@@ -18,6 +18,7 @@ import 'build.dart';
class
BuildMacosCommand
extends
BuildSubCommand
{
class
BuildMacosCommand
extends
BuildSubCommand
{
BuildMacosCommand
()
{
BuildMacosCommand
()
{
addTreeShakeIconsFlag
();
addTreeShakeIconsFlag
();
addSplitDebugInfoOption
();
usesTargetOption
();
usesTargetOption
();
addBuildModeFlags
();
addBuildModeFlags
();
}
}
...
...
packages/flutter_tools/lib/src/macos/build_macos.dart
View file @
82410a5a
...
@@ -85,8 +85,6 @@ Future<void> buildMacOS({
...
@@ -85,8 +85,6 @@ Future<void> buildMacOS({
'OBJROOT=
${globals.fs.path.join(flutterBuildDir.absolute.path, 'Build', 'Intermediates.noindex')}
'
,
'OBJROOT=
${globals.fs.path.join(flutterBuildDir.absolute.path, 'Build', 'Intermediates.noindex')}
'
,
'SYMROOT=
${globals.fs.path.join(flutterBuildDir.absolute.path, 'Build', 'Products')}
'
,
'SYMROOT=
${globals.fs.path.join(flutterBuildDir.absolute.path, 'Build', 'Products')}
'
,
'COMPILER_INDEX_STORE_ENABLE=NO'
,
'COMPILER_INDEX_STORE_ENABLE=NO'
,
if
(
buildInfo
.
treeShakeIcons
)
'TREE_SHAKE_ICONS=true'
,
...
environmentVariablesAsXcodeBuildSettings
(
globals
.
platform
)
...
environmentVariablesAsXcodeBuildSettings
(
globals
.
platform
)
],
trace:
true
);
],
trace:
true
);
}
finally
{
}
finally
{
...
...
packages/flutter_tools/test/general.shard/base/build_test.dart
View file @
82410a5a
...
@@ -715,6 +715,39 @@ void main() {
...
@@ -715,6 +715,39 @@ void main() {
]);
]);
},
overrides:
contextOverrides
);
},
overrides:
contextOverrides
);
testUsingContext
(
'builds shared library for android-arm without dwarf stack traces due to empty string'
,
()
async
{
globals
.
fs
.
file
(
'main.dill'
).
writeAsStringSync
(
'binary magic'
);
final
String
outputPath
=
globals
.
fs
.
path
.
join
(
'build'
,
'foo'
);
globals
.
fs
.
directory
(
outputPath
).
createSync
(
recursive:
true
);
final
int
genSnapshotExitCode
=
await
snapshotter
.
build
(
platform:
TargetPlatform
.
android_arm
,
buildMode:
BuildMode
.
release
,
mainPath:
'main.dill'
,
packagesPath:
'.packages'
,
outputPath:
outputPath
,
bitcode:
false
,
splitDebugInfo:
''
,
);
expect
(
genSnapshotExitCode
,
0
);
expect
(
genSnapshot
.
callCount
,
1
);
expect
(
genSnapshot
.
snapshotType
.
platform
,
TargetPlatform
.
android_arm
);
expect
(
genSnapshot
.
snapshotType
.
mode
,
BuildMode
.
release
);
expect
(
genSnapshot
.
additionalArgs
,
<
String
>[
'--deterministic'
,
'--snapshot_kind=app-aot-elf'
,
'--elf=build/foo/app.so'
,
'--strip'
,
'--no-sim-use-hardfp'
,
'--no-use-integer-division'
,
'--no-causal-async-stacks'
,
'--lazy-async-stacks'
,
'main.dill'
,
]);
},
overrides:
contextOverrides
);
testUsingContext
(
'builds shared library for android-arm64'
,
()
async
{
testUsingContext
(
'builds shared library for android-arm64'
,
()
async
{
globals
.
fs
.
file
(
'main.dill'
).
writeAsStringSync
(
'binary magic'
);
globals
.
fs
.
file
(
'main.dill'
).
writeAsStringSync
(
'binary magic'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment