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
584fd5f9
Unverified
Commit
584fd5f9
authored
Jun 16, 2020
by
Michael Goderbauer
Committed by
GitHub
Jun 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Word substitutions (#59484)
* Word substitutions * ++
parent
1bb40aee
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
73 additions
and
71 deletions
+73
-71
analyze.dart
dev/bots/analyze.dart
+9
-9
test.dart
dev/bots/test.dart
+3
-3
analyze_test.dart
dev/bots/test/analyze_test.dart
+2
-2
technical_debt__cost.dart
dev/devicelab/bin/tasks/technical_debt__cost.dart
+4
-4
debug.dart
packages/flutter/lib/src/foundation/debug.dart
+3
-1
binding.dart
packages/flutter/lib/src/rendering/binding.dart
+1
-1
object.dart
packages/flutter/lib/src/rendering/object.dart
+3
-3
view.dart
packages/flutter/lib/src/rendering/view.dart
+1
-1
binding.dart
packages/flutter/lib/src/scheduler/binding.dart
+2
-2
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+3
-3
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+4
-4
process.dart
packages/flutter_tools/lib/src/base/process.dart
+10
-10
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+3
-3
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+1
-1
process_test.dart
...s/flutter_tools/test/general.shard/base/process_test.dart
+8
-8
forbidden_imports_test.dart
...tter_tools/test/general.shard/forbidden_imports_test.dart
+16
-16
No files found.
dev/bots/analyze.dart
View file @
584fd5f9
...
...
@@ -145,8 +145,8 @@ final RegExp _deprecationPattern4 = RegExp(r'^ *\)$');
/// the regexp just above...)
const
String
_ignoreDeprecation
=
' // ignore: flutter_deprecation_syntax (see analyze.dart)'
;
/// Some deprecation notices are
grand-fathered in for now
. They must have an issue listed.
final
RegExp
_
grandfathered
Deprecation
=
RegExp
(
r' // ignore: flutter_deprecation_syntax, https://github.com/flutter/flutter/issues/[0-9]+$'
);
/// Some deprecation notices are
exempt for historical reasons
. They must have an issue listed.
final
RegExp
_
legacy
Deprecation
=
RegExp
(
r' // ignore: flutter_deprecation_syntax, https://github.com/flutter/flutter/issues/[0-9]+$'
);
Future
<
void
>
verifyDeprecations
(
String
workingDirectory
,
{
int
minimumMatches
=
2000
})
async
{
final
List
<
String
>
errors
=
<
String
>[];
...
...
@@ -157,7 +157,7 @@ Future<void> verifyDeprecations(String workingDirectory, { int minimumMatches =
for
(
final
String
line
in
lines
)
{
if
(
line
.
contains
(
_findDeprecationPattern
)
&&
!
line
.
endsWith
(
_ignoreDeprecation
)
&&
!
line
.
contains
(
_
grandfathered
Deprecation
))
{
!
line
.
contains
(
_
legacy
Deprecation
))
{
linesWithDeprecations
.
add
(
lineNumber
);
}
lineNumber
+=
1
;
...
...
@@ -691,7 +691,7 @@ class Hash256 {
// If you are adding/changing template images, use the flutter_template_images
// package and a .img.tmpl placeholder instead.
// If you have other binaries to add, please consult Hixie for advice.
final
Set
<
Hash256
>
_
grandfathered
Binaries
=
<
Hash256
>{
final
Set
<
Hash256
>
_
legacy
Binaries
=
<
Hash256
>{
// DEFAULT ICON IMAGES
// packages/flutter_tools/templates/app/android.tmpl/app/src/main/res/mipmap-hdpi/ic_launcher.png
...
...
@@ -1046,18 +1046,18 @@ final Set<Hash256> _grandfatheredBinaries = <Hash256>{
const
Hash256
(
0x63D2ABD0041C3E3B
,
0x4B52AD8D382353B5
,
0x3C51C6785E76CE56
,
0xED9DACAD2D2E31C4
),
};
Future
<
void
>
verifyNoBinaries
(
String
workingDirectory
,
{
Set
<
Hash256
>
grandfathered
Binaries
})
async
{
// Please do not add anything to the _
grandfathered
Binaries set above.
Future
<
void
>
verifyNoBinaries
(
String
workingDirectory
,
{
Set
<
Hash256
>
legacy
Binaries
})
async
{
// Please do not add anything to the _
legacy
Binaries set above.
// We have a policy of not checking in binaries into this repository.
// If you are adding/changing template images, use the flutter_template_images
// package and a .img.tmpl placeholder instead.
// If you have other binaries to add, please consult Hixie for advice.
assert
(
_
grandfathered
Binaries
_
legacy
Binaries
.
expand
<
int
>((
Hash256
hash
)
=>
<
int
>[
hash
.
a
,
hash
.
b
,
hash
.
c
,
hash
.
d
])
.
reduce
((
int
value
,
int
element
)
=>
value
^
element
)
==
0x606B51C908B40BFA
// Please do not modify this line.
);
grandfatheredBinaries
??=
_grandfathered
Binaries
;
legacyBinaries
??=
_legacy
Binaries
;
if
(!
Platform
.
isWindows
)
{
// TODO(ianh): Port this to Windows
final
EvalResult
evalResult
=
await
_evalCommand
(
'git'
,
<
String
>[
'ls-files'
,
'-z'
],
...
...
@@ -1087,7 +1087,7 @@ Future<void> verifyNoBinaries(String workingDirectory, { Set<Hash256> grandfathe
utf8
.
decode
(
bytes
);
}
on
FormatException
catch
(
error
)
{
final
Digest
digest
=
sha256
.
convert
(
bytes
);
if
(!
grandfathered
Binaries
.
contains
(
Hash256
.
fromDigest
(
digest
)))
if
(!
legacy
Binaries
.
contains
(
Hash256
.
fromDigest
(
digest
)))
problems
.
add
(
'
${file.path}
:
${error.offset}
: file is not valid UTF-8'
);
}
}
...
...
dev/bots/test.dart
View file @
584fd5f9
...
...
@@ -82,8 +82,8 @@ int get webShardCount => Platform.environment.containsKey('WEB_SHARD_COUNT')
/// Tests that we don't run on Web for various reasons.
//
// TODO(yjbanov): we're getting rid of this
blacklist
as part of https://github.com/flutter/flutter/projects/60
const
List
<
String
>
kWebTestFile
Blacklist
=
<
String
>[
// TODO(yjbanov): we're getting rid of this as part of https://github.com/flutter/flutter/projects/60
const
List
<
String
>
kWebTestFile
KnownFailures
=
<
String
>[
// This test doesn't compile because it depends on code outside the flutter package.
'test/examples/sector_layout_test.dart'
,
// This test relies on widget tracking capability in the VM.
...
...
@@ -699,7 +699,7 @@ Future<void> _runWebUnitTests() async {
)
.
whereType
<
File
>()
.
map
<
String
>((
File
file
)
=>
path
.
relative
(
file
.
path
,
from:
flutterPackageDirectory
.
path
))
.
where
((
String
filePath
)
=>
!
kWebTestFile
Blacklist
.
contains
(
filePath
))
.
where
((
String
filePath
)
=>
!
kWebTestFile
KnownFailures
.
contains
(
filePath
))
.
toList
()
// Finally we shuffle the list because we want the average cost per file to be uniformly
// distributed. If the list is not sorted then different shards and batches may have
...
...
dev/bots/test/analyze_test.dart
View file @
584fd5f9
...
...
@@ -95,7 +95,7 @@ void main() {
test
(
'analyze.dart - verifyNoBinaries - positive'
,
()
async
{
final
String
result
=
await
capture
(()
=>
verifyNoBinaries
(
testRootPath
,
grandfathered
Binaries:
<
Hash256
>{
const
Hash256
(
0x39A050CD69434936
,
0
,
0
,
0
)},
legacy
Binaries:
<
Hash256
>{
const
Hash256
(
0x39A050CD69434936
,
0
,
0
,
0
)},
),
exitCode:
Platform
.
isWindows
?
0
:
1
);
if
(!
Platform
.
isWindows
)
{
// The output starts with the call to git ls-files, the details of which
...
...
@@ -116,7 +116,7 @@ void main() {
test
(
'analyze.dart - verifyNoBinaries - negative'
,
()
async
{
await
capture
(()
=>
verifyNoBinaries
(
testRootPath
,
grandfathered
Binaries:
<
Hash256
>{
legacy
Binaries:
<
Hash256
>{
const
Hash256
(
0xA8100AE6AA1940D0
,
0xB663BB31CD466142
,
0xEBBDBD5187131B92
,
0xD93818987832EB89
),
// sha256("\xff")
const
Hash256
(
0x155644D3F13D98BF
,
0
,
0
,
0
),
},
...
...
dev/devicelab/bin/tasks/technical_debt__cost.dart
View file @
584fd5f9
...
...
@@ -18,7 +18,7 @@ const double skipCost = 2473.0; // 20 hours: 5 to fix the issue we're ignoring,
const
double
ignoreForFileCost
=
2477.0
;
// similar thinking as skipCost
const
double
asDynamicCost
=
2011.0
;
// a few days to refactor the code.
const
double
deprecationCost
=
233.0
;
// a few hours to remove the old code.
const
double
grandfathered
DeprecationCost
=
9973.0
;
// a couple of weeks.
const
double
legacy
DeprecationCost
=
9973.0
;
// a couple of weeks.
final
RegExp
todoPattern
=
RegExp
(
r'(?://|#) *TODO'
);
final
RegExp
ignorePattern
=
RegExp
(
r'// *ignore:'
);
...
...
@@ -26,7 +26,7 @@ final RegExp ignoreForFilePattern = RegExp(r'// *ignore_for_file:');
final
RegExp
asDynamicPattern
=
RegExp
(
r'\bas dynamic\b'
);
final
RegExp
deprecationPattern
=
RegExp
(
r'^ *@[dD]eprecated'
);
const
Pattern
globalsPattern
=
'globals.'
;
const
String
grandfathered
DeprecationPattern
=
'// ignore: flutter_deprecation_syntax, https'
;
const
String
legacy
DeprecationPattern
=
'// ignore: flutter_deprecation_syntax, https'
;
Future
<
double
>
findCostsForFile
(
File
file
)
async
{
if
(
path
.
extension
(
file
.
path
)
==
'.py'
)
...
...
@@ -48,8 +48,8 @@ Future<double> findCostsForFile(File file) async {
total
+=
asDynamicCost
;
if
(
line
.
contains
(
deprecationPattern
))
total
+=
deprecationCost
;
if
(
line
.
contains
(
grandfathered
DeprecationPattern
))
total
+=
grandfathered
DeprecationCost
;
if
(
line
.
contains
(
legacy
DeprecationPattern
))
total
+=
legacy
DeprecationCost
;
if
(
isTest
&&
line
.
contains
(
'skip:'
))
total
+=
skipCost
;
}
...
...
packages/flutter/lib/src/foundation/debug.dart
View file @
584fd5f9
...
...
@@ -72,11 +72,13 @@ Future<T> debugInstrumentAction<T>(String description, Future<T> action()) {
/// Argument passed to [Timeline] events in order to cause those events to be
/// shown in the developer-centric version of the Observatory Timeline.
///
/// Generally these indicate landmark events such as the build phase or layout.
///
/// See also:
///
/// * [Timeline.startSync], which typically takes this value as its `arguments`
/// argument.
const
Map
<
String
,
String
>
timeline
WhitelistArguments
=
<
String
,
String
>{
const
Map
<
String
,
String
>
timeline
ArgumentsIndicatingLandmarkEvent
=
<
String
,
String
>{
'mode'
:
'basic'
,
};
...
...
packages/flutter/lib/src/rendering/binding.dart
View file @
584fd5f9
...
...
@@ -414,7 +414,7 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
@override
Future
<
void
>
performReassemble
()
async
{
await
super
.
performReassemble
();
Timeline
.
startSync
(
'Dirty Render Tree'
,
arguments:
timeline
WhitelistArguments
);
Timeline
.
startSync
(
'Dirty Render Tree'
,
arguments:
timeline
ArgumentsIndicatingLandmarkEvent
);
try
{
renderView
.
reassemble
();
}
finally
{
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
584fd5f9
...
...
@@ -173,7 +173,7 @@ class PaintingContext extends ClipContext {
void
paintChild
(
RenderObject
child
,
Offset
offset
)
{
assert
(()
{
if
(
debugProfilePaintsEnabled
)
Timeline
.
startSync
(
'
${child.runtimeType}
'
,
arguments:
timeline
WhitelistArguments
);
Timeline
.
startSync
(
'
${child.runtimeType}
'
,
arguments:
timeline
ArgumentsIndicatingLandmarkEvent
);
if
(
debugOnProfilePaint
!=
null
)
debugOnProfilePaint
(
child
);
return
true
;
...
...
@@ -873,7 +873,7 @@ class PipelineOwner {
/// See [RendererBinding] for an example of how this function is used.
void
flushLayout
()
{
if
(!
kReleaseMode
)
{
Timeline
.
startSync
(
'Layout'
,
arguments:
timeline
WhitelistArguments
);
Timeline
.
startSync
(
'Layout'
,
arguments:
timeline
ArgumentsIndicatingLandmarkEvent
);
}
assert
(()
{
_debugDoingLayout
=
true
;
...
...
@@ -965,7 +965,7 @@ class PipelineOwner {
/// See [RendererBinding] for an example of how this function is used.
void
flushPaint
()
{
if
(!
kReleaseMode
)
{
Timeline
.
startSync
(
'Paint'
,
arguments:
timeline
WhitelistArguments
);
Timeline
.
startSync
(
'Paint'
,
arguments:
timeline
ArgumentsIndicatingLandmarkEvent
);
}
assert
(()
{
_debugDoingPaint
=
true
;
...
...
packages/flutter/lib/src/rendering/view.dart
View file @
584fd5f9
...
...
@@ -226,7 +226,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
///
/// Actually causes the output of the rendering pipeline to appear on screen.
void
compositeFrame
()
{
Timeline
.
startSync
(
'Compositing'
,
arguments:
timeline
WhitelistArguments
);
Timeline
.
startSync
(
'Compositing'
,
arguments:
timeline
ArgumentsIndicatingLandmarkEvent
);
try
{
final
ui
.
SceneBuilder
builder
=
ui
.
SceneBuilder
();
final
ui
.
Scene
scene
=
layer
.
buildScene
(
builder
);
...
...
packages/flutter/lib/src/scheduler/binding.dart
View file @
584fd5f9
...
...
@@ -994,7 +994,7 @@ mixin SchedulerBinding on BindingBase {
/// statements printed during a frame from those printed between frames (e.g.
/// in response to events or timers).
void
handleBeginFrame
(
Duration
rawTimeStamp
)
{
Timeline
.
startSync
(
'Frame'
,
arguments:
timeline
WhitelistArguments
);
Timeline
.
startSync
(
'Frame'
,
arguments:
timeline
ArgumentsIndicatingLandmarkEvent
);
_firstRawTimeStampInEpoch
??=
rawTimeStamp
;
_currentFrameTimeStamp
=
_adjustForEpoch
(
rawTimeStamp
??
_lastRawTimeStamp
);
if
(
rawTimeStamp
!=
null
)
...
...
@@ -1021,7 +1021,7 @@ mixin SchedulerBinding on BindingBase {
_hasScheduledFrame
=
false
;
try
{
// TRANSIENT FRAME CALLBACKS
Timeline
.
startSync
(
'Animate'
,
arguments:
timeline
WhitelistArguments
);
Timeline
.
startSync
(
'Animate'
,
arguments:
timeline
ArgumentsIndicatingLandmarkEvent
);
_schedulerPhase
=
SchedulerPhase
.
transientCallbacks
;
final
Map
<
int
,
_FrameCallbackEntry
>
callbacks
=
_transientCallbacks
;
_transientCallbacks
=
<
int
,
_FrameCallbackEntry
>{};
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
584fd5f9
...
...
@@ -2603,7 +2603,7 @@ class BuildOwner {
_debugBuilding
=
true
;
return
true
;
}());
Timeline
.
startSync
(
'Build'
,
arguments:
timeline
WhitelistArguments
);
Timeline
.
startSync
(
'Build'
,
arguments:
timeline
ArgumentsIndicatingLandmarkEvent
);
try
{
_scheduledFlushDirtyElements
=
true
;
if
(
callback
!=
null
)
{
...
...
@@ -2748,7 +2748,7 @@ class BuildOwner {
/// After the current call stack unwinds, a microtask that notifies listeners
/// about changes to global keys will run.
void
finalizeTree
()
{
Timeline
.
startSync
(
'Finalize tree'
,
arguments:
timeline
WhitelistArguments
);
Timeline
.
startSync
(
'Finalize tree'
,
arguments:
timeline
ArgumentsIndicatingLandmarkEvent
);
try
{
lockState
(()
{
_inactiveElements
.
_unmountAll
();
// this unregisters the GlobalKeys
...
...
@@ -4534,7 +4534,7 @@ abstract class ComponentElement extends Element {
@override
void
performRebuild
()
{
if
(!
kReleaseMode
&&
debugProfileBuildsEnabled
)
Timeline
.
startSync
(
'
${widget.runtimeType}
'
,
arguments:
timeline
WhitelistArguments
);
Timeline
.
startSync
(
'
${widget.runtimeType}
'
,
arguments:
timeline
ArgumentsIndicatingLandmarkEvent
);
assert
(
_debugSetAllowIgnoredCallsToMarkNeedsBuild
(
true
));
Widget
built
;
...
...
packages/flutter_tools/lib/src/android/android_device.dart
View file @
584fd5f9
...
...
@@ -270,7 +270,7 @@ class AndroidDevice extends Device {
workingDirectory:
workingDirectory
,
allowReentrantFlutter:
allowReentrantFlutter
,
environment:
environment
,
whiteList
Failures:
(
int
value
)
=>
allowHeapCorruptionOnWindows
(
value
,
_platform
),
allowed
Failures:
(
int
value
)
=>
allowHeapCorruptionOnWindows
(
value
,
_platform
),
).
stdout
.
trim
();
}
...
...
@@ -284,7 +284,7 @@ class AndroidDevice extends Device {
throwOnError:
true
,
workingDirectory:
workingDirectory
,
allowReentrantFlutter:
allowReentrantFlutter
,
whiteList
Failures:
(
int
value
)
=>
allowHeapCorruptionOnWindows
(
value
,
_platform
),
allowed
Failures:
(
int
value
)
=>
allowHeapCorruptionOnWindows
(
value
,
_platform
),
);
}
...
...
@@ -1077,7 +1077,7 @@ class AdbLogReader extends DeviceLogReader {
// 'W/ActivityManager(pid): '
static
final
RegExp
_logFormat
=
RegExp
(
r'^[VDIWEF]\/.*?\(\s*(\d+)\):\s'
);
static
final
List
<
RegExp
>
_
whitelist
edTags
=
<
RegExp
>[
static
final
List
<
RegExp
>
_
allow
edTags
=
<
RegExp
>[
RegExp
(
r'^[VDIWEF]\/flutter[^:]*:\s+'
,
caseSensitive:
false
),
RegExp
(
r'^[IE]\/DartVM[^:]*:\s+'
),
RegExp
(
r'^[WEF]\/AndroidRuntime:\s+'
),
...
...
@@ -1149,7 +1149,7 @@ class AdbLogReader extends DeviceLogReader {
}
}
else
{
// Filter on approved names and levels.
acceptLine
=
_
whitelist
edTags
.
any
((
RegExp
re
)
=>
re
.
hasMatch
(
line
));
acceptLine
=
_
allow
edTags
.
any
((
RegExp
re
)
=>
re
.
hasMatch
(
line
));
}
if
(
acceptLine
)
{
...
...
packages/flutter_tools/lib/src/base/process.dart
View file @
584fd5f9
...
...
@@ -198,9 +198,9 @@ abstract class ProcessUtils {
/// When [throwOnError] is `true`, if the child process finishes with a non-zero
/// exit code, a [ProcessException] is thrown.
///
/// If [throwOnError] is `true`, and [
whiteList
Failures] is supplied,
/// If [throwOnError] is `true`, and [
allowed
Failures] is supplied,
/// a [ProcessException] is only thrown on a non-zero exit code if
/// [
whiteList
Failures] returns false when passed the exit code.
/// [
allowed
Failures] returns false when passed the exit code.
///
/// When [workingDirectory] is set, it is the working directory of the child
/// process.
...
...
@@ -219,7 +219,7 @@ abstract class ProcessUtils {
Future
<
RunResult
>
run
(
List
<
String
>
cmd
,
{
bool
throwOnError
=
false
,
RunResultChecker
whiteList
Failures
,
RunResultChecker
allowed
Failures
,
String
workingDirectory
,
bool
allowReentrantFlutter
=
false
,
Map
<
String
,
String
>
environment
,
...
...
@@ -231,7 +231,7 @@ abstract class ProcessUtils {
RunResult
runSync
(
List
<
String
>
cmd
,
{
bool
throwOnError
=
false
,
RunResultChecker
whiteList
Failures
,
RunResultChecker
allowed
Failures
,
bool
hideStdout
=
false
,
String
workingDirectory
,
Map
<
String
,
String
>
environment
,
...
...
@@ -292,7 +292,7 @@ class _DefaultProcessUtils implements ProcessUtils {
Future
<
RunResult
>
run
(
List
<
String
>
cmd
,
{
bool
throwOnError
=
false
,
RunResultChecker
whiteList
Failures
,
RunResultChecker
allowed
Failures
,
String
workingDirectory
,
bool
allowReentrantFlutter
=
false
,
Map
<
String
,
String
>
environment
,
...
...
@@ -318,7 +318,7 @@ class _DefaultProcessUtils implements ProcessUtils {
final
RunResult
runResult
=
RunResult
(
results
,
cmd
);
_logger
.
printTrace
(
runResult
.
toString
());
if
(
throwOnError
&&
runResult
.
exitCode
!=
0
&&
(
whiteListFailures
==
null
||
!
whiteList
Failures
(
runResult
.
exitCode
)))
{
(
allowedFailures
==
null
||
!
allowed
Failures
(
runResult
.
exitCode
)))
{
runResult
.
throwException
(
'Process exited abnormally:
\n
$runResult
'
);
}
return
runResult
;
...
...
@@ -382,7 +382,7 @@ class _DefaultProcessUtils implements ProcessUtils {
if
(
exitCode
!=
null
)
{
_logger
.
printTrace
(
runResult
.
toString
());
if
(
throwOnError
&&
runResult
.
exitCode
!=
0
&&
(
whiteListFailures
==
null
||
!
whiteList
Failures
(
exitCode
)))
{
(
allowedFailures
==
null
||
!
allowed
Failures
(
exitCode
)))
{
runResult
.
throwException
(
'Process exited abnormally:
\n
$runResult
'
);
}
return
runResult
;
...
...
@@ -407,7 +407,7 @@ class _DefaultProcessUtils implements ProcessUtils {
RunResult
runSync
(
List
<
String
>
cmd
,
{
bool
throwOnError
=
false
,
RunResultChecker
whiteList
Failures
,
RunResultChecker
allowed
Failures
,
bool
hideStdout
=
false
,
String
workingDirectory
,
Map
<
String
,
String
>
environment
,
...
...
@@ -424,8 +424,8 @@ class _DefaultProcessUtils implements ProcessUtils {
_logger
.
printTrace
(
'Exit code
${runResult.exitCode}
from:
${cmd.join(' ')}
'
);
bool
failedExitCode
=
runResult
.
exitCode
!=
0
;
if
(
whiteList
Failures
!=
null
&&
failedExitCode
)
{
failedExitCode
=
!
whiteList
Failures
(
runResult
.
exitCode
);
if
(
allowed
Failures
!=
null
&&
failedExitCode
)
{
failedExitCode
=
!
allowed
Failures
(
runResult
.
exitCode
);
}
if
(
runResult
.
stdout
.
isNotEmpty
&&
!
hideStdout
)
{
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
584fd5f9
...
...
@@ -363,10 +363,10 @@ class IOSSimulator extends Device {
return
false
;
}
// Check if the device is part of a bl
acklist
ed category.
// Check if the device is part of a bl
ock
ed category.
// We do not yet support WatchOS or tvOS devices.
final
RegExp
bl
a
cklist
=
RegExp
(
r'Apple (TV|Watch)'
,
caseSensitive:
false
);
if
(
bl
a
cklist
.
hasMatch
(
name
))
{
final
RegExp
bl
o
cklist
=
RegExp
(
r'Apple (TV|Watch)'
,
caseSensitive:
false
);
if
(
bl
o
cklist
.
hasMatch
(
name
))
{
_supportMessage
=
'Flutter does not support Apple TV or Apple Watch.'
;
return
false
;
}
...
...
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
584fd5f9
...
...
@@ -385,7 +385,7 @@ class XcodeProjectInterpreter {
if
(
projectFilename
!=
null
)
...<
String
>[
'-project'
,
projectFilename
],
],
throwOnError:
true
,
whiteList
Failures:
(
int
c
)
=>
c
==
missingProjectExitCode
,
allowed
Failures:
(
int
c
)
=>
c
==
missingProjectExitCode
,
workingDirectory:
projectPath
,
);
if
(
result
.
exitCode
==
missingProjectExitCode
)
{
...
...
packages/flutter_tools/test/general.shard/base/process_test.dart
View file @
584fd5f9
...
...
@@ -161,7 +161,7 @@ void main() {
throwsA
(
isA
<
ProcessException
>()));
});
testWithoutContext
(
' does not throw on
failure with whitelist
'
,
()
async
{
testWithoutContext
(
' does not throw on
allowed Failures
'
,
()
async
{
when
(
mockProcessManager
.
run
(<
String
>[
'kaboom'
])).
thenAnswer
((
_
)
{
return
Future
<
ProcessResult
>.
value
(
ProcessResult
(
0
,
1
,
''
,
''
));
});
...
...
@@ -169,13 +169,13 @@ void main() {
(
await
processUtils
.
run
(
<
String
>[
'kaboom'
],
throwOnError:
true
,
whiteList
Failures:
(
int
c
)
=>
c
==
1
,
allowed
Failures:
(
int
c
)
=>
c
==
1
,
)).
exitCode
,
1
,
);
});
testWithoutContext
(
' throws on
failure when not in whitelist
'
,
()
async
{
testWithoutContext
(
' throws on
disallowed failure
'
,
()
async
{
when
(
mockProcessManager
.
run
(<
String
>[
'kaboom'
])).
thenAnswer
((
_
)
{
return
Future
<
ProcessResult
>.
value
(
ProcessResult
(
0
,
2
,
''
,
''
));
});
...
...
@@ -183,7 +183,7 @@ void main() {
()
=>
processUtils
.
run
(
<
String
>[
'kaboom'
],
throwOnError:
true
,
whiteList
Failures:
(
int
c
)
=>
c
==
1
,
allowed
Failures:
(
int
c
)
=>
c
==
1
,
),
throwsA
(
isA
<
ProcessException
>()),
);
...
...
@@ -295,7 +295,7 @@ void main() {
throwsA
(
isA
<
ProcessException
>()));
});
testWithoutContext
(
' does not throw on
failure with whitelist
'
,
()
async
{
testWithoutContext
(
' does not throw on
allowed Failures
'
,
()
async
{
when
(
mockProcessManager
.
runSync
(<
String
>[
'kaboom'
])).
thenReturn
(
ProcessResult
(
0
,
1
,
''
,
''
)
);
...
...
@@ -303,12 +303,12 @@ void main() {
processUtils
.
runSync
(
<
String
>[
'kaboom'
],
throwOnError:
true
,
whiteList
Failures:
(
int
c
)
=>
c
==
1
,
allowed
Failures:
(
int
c
)
=>
c
==
1
,
).
exitCode
,
1
);
});
testWithoutContext
(
' throws on
failure when not in whitelist
'
,
()
async
{
testWithoutContext
(
' throws on
disallowed failure
'
,
()
async
{
when
(
mockProcessManager
.
runSync
(<
String
>[
'kaboom'
])).
thenReturn
(
ProcessResult
(
0
,
2
,
''
,
''
)
);
...
...
@@ -316,7 +316,7 @@ void main() {
()
=>
processUtils
.
runSync
(
<
String
>[
'kaboom'
],
throwOnError:
true
,
whiteList
Failures:
(
int
c
)
=>
c
==
1
,
allowed
Failures:
(
int
c
)
=>
c
==
1
,
),
throwsA
(
isA
<
ProcessException
>()));
});
...
...
packages/flutter_tools/test/general.shard/forbidden_imports_test.dart
View file @
584fd5f9
...
...
@@ -59,18 +59,18 @@ void main() {
});
test
(
'no unauthorized imports of dart:io'
,
()
{
final
List
<
String
>
whitelist
edPaths
=
<
String
>[
final
List
<
String
>
allow
edPaths
=
<
String
>[
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'base'
,
'io.dart'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'base'
,
'platform.dart'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'base'
,
'error_handling_file_system.dart'
),
];
bool
_isNot
Whitelisted
(
FileSystemEntity
entity
)
=>
whitelist
edPaths
.
every
((
String
path
)
=>
path
!=
entity
.
path
);
bool
_isNot
Allowed
(
FileSystemEntity
entity
)
=>
allow
edPaths
.
every
((
String
path
)
=>
path
!=
entity
.
path
);
for
(
final
String
dirName
in
<
String
>[
'lib'
,
'bin'
])
{
final
Iterable
<
File
>
files
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
join
(
flutterTools
,
dirName
))
.
listSync
(
recursive:
true
)
.
where
(
_isDartFile
)
.
where
(
_isNot
Whitelist
ed
)
.
where
(
_isNot
Allow
ed
)
.
map
(
_asFile
);
for
(
final
File
file
in
files
)
{
for
(
final
String
line
in
file
.
readAsLinesSync
())
{
...
...
@@ -85,19 +85,19 @@ void main() {
});
test
(
'no unauthorized imports of test_api'
,
()
{
final
List
<
String
>
whitelist
edPaths
=
<
String
>[
final
List
<
String
>
allow
edPaths
=
<
String
>[
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'build_runner'
,
'build_script.dart'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'test'
,
'flutter_platform.dart'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'test'
,
'flutter_web_platform.dart'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'test'
,
'test_wrapper.dart'
),
];
bool
_isNot
Whitelisted
(
FileSystemEntity
entity
)
=>
whitelist
edPaths
.
every
((
String
path
)
=>
path
!=
entity
.
path
);
bool
_isNot
Allowed
(
FileSystemEntity
entity
)
=>
allow
edPaths
.
every
((
String
path
)
=>
path
!=
entity
.
path
);
for
(
final
String
dirName
in
<
String
>[
'lib'
])
{
final
Iterable
<
File
>
files
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
join
(
flutterTools
,
dirName
))
.
listSync
(
recursive:
true
)
.
where
(
_isDartFile
)
.
where
(
_isNot
Whitelist
ed
)
.
where
(
_isNot
Allow
ed
)
.
map
(
_asFile
);
for
(
final
File
file
in
files
)
{
for
(
final
String
line
in
file
.
readAsLinesSync
())
{
...
...
@@ -112,7 +112,7 @@ void main() {
});
test
(
'no unauthorized imports of package:path'
,
()
{
final
List
<
String
>
whitelist
edPath
=
<
String
>[
final
List
<
String
>
allow
edPath
=
<
String
>[
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'build_runner'
,
'web_compilation_delegate.dart'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'test'
,
'general.shard'
,
'platform_plugins_test.dart'
),
];
...
...
@@ -120,7 +120,7 @@ void main() {
final
Iterable
<
File
>
files
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
join
(
flutterTools
,
dirName
))
.
listSync
(
recursive:
true
)
.
where
(
_isDartFile
)
.
where
((
FileSystemEntity
entity
)
=>
!
whitelist
edPath
.
contains
(
entity
.
path
))
.
where
((
FileSystemEntity
entity
)
=>
!
allow
edPath
.
contains
(
entity
.
path
))
.
map
(
_asFile
);
for
(
final
File
file
in
files
)
{
for
(
final
String
line
in
file
.
readAsLinesSync
())
{
...
...
@@ -135,14 +135,14 @@ void main() {
});
test
(
'no unauthorized imports of package:file/local.dart'
,
()
{
final
List
<
String
>
whitelist
edPath
=
<
String
>[
final
List
<
String
>
allow
edPath
=
<
String
>[
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'base'
,
'file_system.dart'
),
];
for
(
final
String
dirName
in
<
String
>[
'lib'
,
'bin'
,
'test'
])
{
final
Iterable
<
File
>
files
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
join
(
flutterTools
,
dirName
))
.
listSync
(
recursive:
true
)
.
where
(
_isDartFile
)
.
where
((
FileSystemEntity
entity
)
=>
!
whitelist
edPath
.
contains
(
entity
.
path
))
.
where
((
FileSystemEntity
entity
)
=>
!
allow
edPath
.
contains
(
entity
.
path
))
.
map
(
_asFile
);
for
(
final
File
file
in
files
)
{
for
(
final
String
line
in
file
.
readAsLinesSync
())
{
...
...
@@ -156,17 +156,17 @@ void main() {
});
test
(
'no unauthorized imports of dart:convert'
,
()
{
final
List
<
String
>
whitelist
edPaths
=
<
String
>[
final
List
<
String
>
allow
edPaths
=
<
String
>[
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'convert.dart'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'base'
,
'error_handling_file_system.dart'
),
];
bool
_isNot
Whitelisted
(
FileSystemEntity
entity
)
=>
whitelist
edPaths
.
every
((
String
path
)
=>
path
!=
entity
.
path
);
bool
_isNot
Allowed
(
FileSystemEntity
entity
)
=>
allow
edPaths
.
every
((
String
path
)
=>
path
!=
entity
.
path
);
for
(
final
String
dirName
in
<
String
>[
'lib'
])
{
final
Iterable
<
File
>
files
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
join
(
flutterTools
,
dirName
))
.
listSync
(
recursive:
true
)
.
where
(
_isDartFile
)
.
where
(
_isNot
Whitelist
ed
)
.
where
(
_isNot
Allow
ed
)
.
map
(
_asFile
);
for
(
final
File
file
in
files
)
{
for
(
final
String
line
in
file
.
readAsLinesSync
())
{
...
...
@@ -181,20 +181,20 @@ void main() {
});
test
(
'no unauthorized imports of build_runner or dwds'
,
()
{
final
List
<
String
>
whitelist
edPaths
=
<
String
>[
final
List
<
String
>
allow
edPaths
=
<
String
>[
globals
.
fs
.
path
.
join
(
flutterTools
,
'test'
,
'src'
,
'build_runner'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'build_runner'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'executable.dart'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'devfs_web.dart'
),
globals
.
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'resident_web_runner.dart'
),
];
bool
_isNot
Whitelisted
(
FileSystemEntity
entity
)
=>
whitelist
edPaths
.
every
((
String
path
)
=>
!
entity
.
path
.
contains
(
path
));
bool
_isNot
Allowed
(
FileSystemEntity
entity
)
=>
allow
edPaths
.
every
((
String
path
)
=>
!
entity
.
path
.
contains
(
path
));
for
(
final
String
dirName
in
<
String
>[
'lib'
])
{
final
Iterable
<
File
>
files
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
join
(
flutterTools
,
dirName
))
.
listSync
(
recursive:
true
)
.
where
(
_isDartFile
)
.
where
(
_isNot
Whitelist
ed
)
.
where
(
_isNot
Allow
ed
)
.
map
(
_asFile
);
for
(
final
File
file
in
files
)
{
for
(
final
String
line
in
file
.
readAsLinesSync
())
{
...
...
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