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
14c1c211
Unverified
Commit
14c1c211
authored
Oct 08, 2019
by
Jonah Williams
Committed by
GitHub
Oct 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch argument error from Make when it isn't installed (#42252)
parent
fde26751
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
build_linux.dart
packages/flutter_tools/lib/src/linux/build_linux.dart
+8
-6
build_linux_test.dart
..._tools/test/commands.shard/hermetic/build_linux_test.dart
+21
-0
No files found.
packages/flutter_tools/lib/src/linux/build_linux.dart
View file @
14c1c211
...
...
@@ -48,18 +48,18 @@ export PROJECT_DIR=${linuxProject.project.directory.path}
// Invoke make.
final
String
buildFlag
=
getNameForBuildMode
(
buildInfo
.
mode
??
BuildMode
.
release
);
final
Stopwatch
sw
=
Stopwatch
()..
start
();
final
Process
process
=
await
processManager
.
start
(<
String
>[
'make'
,
'-C'
,
linuxProject
.
makeFile
.
parent
.
path
,
'BUILD=
$buildFlag
'
,
]);
final
Status
status
=
logger
.
startProgress
(
'Building Linux application...'
,
timeout:
null
,
);
int
result
;
try
{
final
Process
process
=
await
processManager
.
start
(<
String
>[
'make'
,
'-C'
,
linuxProject
.
makeFile
.
parent
.
path
,
'BUILD=
$buildFlag
'
,
]);
process
.
stderr
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
())
...
...
@@ -69,6 +69,8 @@ export PROJECT_DIR=${linuxProject.project.directory.path}
.
transform
(
const
LineSplitter
())
.
listen
(
printTrace
);
result
=
await
process
.
exitCode
;
}
on
ArgumentError
{
throwToolExit
(
'make not found. Run
\'
flutter doctor
\'
for more information.'
);
}
finally
{
status
.
cancel
();
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_linux_test.dart
View file @
14c1c211
...
...
@@ -117,6 +117,27 @@ void main() {
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
true
),
});
testUsingContext
(
'Handles argument error from missing make'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
applyMocksToCommand
(
command
);
setUpMockProjectFilesForBuild
();
when
(
mockProcessManager
.
start
(<
String
>[
'make'
,
'-C'
,
'/linux'
,
'BUILD=release'
,
])).
thenThrow
(
ArgumentError
());
expect
(
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'linux'
]
),
throwsToolExit
(
message:
'make not found. Run
\'
flutter doctor
\'
for more information.'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
ProcessManager:
()
=>
mockProcessManager
,
Platform:
()
=>
linuxPlatform
,
FeatureFlags:
()
=>
TestFeatureFlags
(
isLinuxEnabled:
true
),
});
testUsingContext
(
'Linux build --debug passes debug mode to make'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
applyMocksToCommand
(
command
);
...
...
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