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
62febaa1
Unverified
Commit
62febaa1
authored
May 30, 2018
by
Jacob Richman
Committed by
GitHub
May 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for --track-widget-creation back to ios build rules. (#18046)
parent
b921fdc5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
3 deletions
+56
-3
xcode_backend.sh
packages/flutter_tools/bin/xcode_backend.sh
+9
-2
build_info.dart
packages/flutter_tools/lib/src/build_info.dart
+1
-1
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+1
-0
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+4
-0
xcodeproj_test.dart
packages/flutter_tools/test/ios/xcodeproj_test.dart
+41
-0
No files found.
packages/flutter_tools/bin/xcode_backend.sh
View file @
62febaa1
...
...
@@ -109,6 +109,11 @@ BuildApp() {
preview_dart_2_flag
=
"--no-preview-dart-2"
fi
local
track_widget_creation_flag
=
""
if
[[
-n
"
$TRACK_WIDGET_CREATION
"
]]
;
then
track_widget_creation_flag
=
"--track-widget-creation"
fi
if
[[
"
${
build_mode
}
"
!=
"debug"
]]
;
then
StreamOutput
" ├─Building Dart code..."
# Transform ARCHS to comma-separated list of target architectures.
...
...
@@ -122,7 +127,8 @@ BuildApp() {
--
${
build_mode
}
\
--ios-arch
=
"
${
archs
}
"
\
${
local_engine_flag
}
\
${
preview_dart_2_flag
}
${
preview_dart_2_flag
}
\
${
track_widget_creation_flag
}
if
[[
$?
-ne
0
]]
;
then
EchoError
"Failed to build
${
project_path
}
."
...
...
@@ -166,7 +172,8 @@ BuildApp() {
--asset-dir
=
"
${
derived_dir
}
/flutter_assets"
\
${
precompilation_flag
}
\
${
local_engine_flag
}
\
${
preview_dart_2_flag
}
${
preview_dart_2_flag
}
\
${
track_widget_creation_flag
}
if
[[
$?
-ne
0
]]
;
then
EchoError
"Failed to package
${
project_path
}
."
...
...
packages/flutter_tools/lib/src/build_info.dart
View file @
62febaa1
...
...
@@ -12,7 +12,7 @@ import 'globals.dart';
class
BuildInfo
{
const
BuildInfo
(
this
.
mode
,
this
.
flavor
,
{
this
.
previewDart2
:
false
,
this
.
trackWidgetCreation
,
this
.
trackWidgetCreation
:
false
,
this
.
extraFrontEndOptions
,
this
.
extraGenSnapshotOptions
,
this
.
preferSharedLibrary
,
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
62febaa1
...
...
@@ -363,6 +363,7 @@ class IOSSimulator extends Device {
final
BuildInfo
debugBuildInfo
=
new
BuildInfo
(
BuildMode
.
debug
,
buildInfo
.
flavor
,
previewDart2:
buildInfo
.
previewDart2
,
trackWidgetCreation:
buildInfo
.
trackWidgetCreation
,
extraFrontEndOptions:
buildInfo
.
extraFrontEndOptions
,
extraGenSnapshotOptions:
buildInfo
.
extraGenSnapshotOptions
,
preferSharedLibrary:
buildInfo
.
preferSharedLibrary
);
...
...
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
62febaa1
...
...
@@ -117,6 +117,10 @@ Future<void> updateGeneratedXcodeProperties({
localsBuffer
.
writeln
(
'PREVIEW_DART_2=true'
);
}
if
(
buildInfo
.
trackWidgetCreation
)
{
localsBuffer
.
writeln
(
'TRACK_WIDGET_CREATION=true'
);
}
final
File
localsFile
=
fs
.
file
(
_generatedXcodePropertiesPath
(
projectPath
));
localsFile
.
createSync
(
recursive:
true
);
localsFile
.
writeAsStringSync
(
localsBuffer
.
toString
());
...
...
packages/flutter_tools/test/ios/xcodeproj_test.dart
View file @
62febaa1
...
...
@@ -301,6 +301,47 @@ Information about project "Runner":
expect
(
contents
.
contains
(
'ARCHS=armv7'
),
isTrue
);
});
testUsingOsxContext
(
'sets TRACK_WIDGET_CREATION=true when trackWidgetCreation is true'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
const
BuildInfo
buildInfo
=
const
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
,
trackWidgetCreation:
true
,
targetPlatform:
TargetPlatform
.
ios
,
);
await
updateGeneratedXcodeProperties
(
projectPath:
'path/to/project'
,
buildInfo:
buildInfo
,
previewDart2:
true
,
);
final
File
config
=
fs
.
file
(
'path/to/project/ios/Flutter/Generated.xcconfig'
);
expect
(
config
.
existsSync
(),
isTrue
);
final
String
contents
=
config
.
readAsStringSync
();
expect
(
contents
.
contains
(
'TRACK_WIDGET_CREATION=true'
),
isTrue
);
});
testUsingOsxContext
(
'does not set TRACK_WIDGET_CREATION when trackWidgetCreation is false'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
const
BuildInfo
buildInfo
=
const
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
,
targetPlatform:
TargetPlatform
.
ios
,
);
await
updateGeneratedXcodeProperties
(
projectPath:
'path/to/project'
,
buildInfo:
buildInfo
,
previewDart2:
true
,
);
final
File
config
=
fs
.
file
(
'path/to/project/ios/Flutter/Generated.xcconfig'
);
expect
(
config
.
existsSync
(),
isTrue
);
final
String
contents
=
config
.
readAsStringSync
();
expect
(
contents
.
contains
(
'TRACK_WIDGET_CREATION=true'
),
isFalse
);
});
testUsingOsxContext
(
'sets ARCHS=armv7 when armv7 local engine is set'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile'
));
...
...
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