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
618fac92
Unverified
Commit
618fac92
authored
Sep 27, 2019
by
Jonah Williams
Committed by
GitHub
Sep 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Exit resident web runner on initial compilation failure (#41441)" (#41498)
parent
ec3baa8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
60 deletions
+6
-60
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+3
-1
web_fs.dart
packages/flutter_tools/lib/src/build_runner/web_fs.dart
+2
-18
web_fs_test.dart
...ges/flutter_tools/test/general.shard/web/web_fs_test.dart
+1
-41
No files found.
packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart
View file @
618fac92
...
...
@@ -192,7 +192,9 @@ class ResidentWebRunner extends ResidentRunner {
_connectionResult
=
await
_webFs
.
connect
(
debuggingOptions
);
unawaited
(
_connectionResult
.
debugConnection
.
onDone
.
whenComplete
(
exit
));
}
}
catch
(
err
)
{
}
catch
(
err
,
stackTrace
)
{
printError
(
err
.
toString
());
printError
(
stackTrace
.
toString
());
throwToolExit
(
'Failed to build application for the web.'
);
}
finally
{
buildStatus
.
stop
();
...
...
packages/flutter_tools/lib/src/build_runner/web_fs.dart
View file @
618fac92
...
...
@@ -135,7 +135,7 @@ class WebFs {
_client
.
startBuild
();
await
for
(
BuildResults
results
in
_client
.
buildResults
)
{
final
BuildResult
result
=
results
.
results
.
firstWhere
((
BuildResult
result
)
{
return
result
.
target
==
kBuildTargetName
;
return
result
.
target
==
'web'
;
});
if
(
result
.
status
==
BuildStatus
.
failed
)
{
return
false
;
...
...
@@ -164,7 +164,6 @@ class WebFs {
final
bool
hasWebPlugins
=
findPlugins
(
flutterProject
)
.
any
((
Plugin
p
)
=>
p
.
platforms
.
containsKey
(
WebPlugin
.
kConfigKey
));
// Start the build daemon and run an initial build.
final
Completer
<
bool
>
inititalBuild
=
Completer
<
bool
>();
final
BuildDaemonClient
client
=
await
buildDaemonCreator
.
startBuildDaemon
(
fs
.
currentDirectory
.
path
,
release:
buildInfo
.
isRelease
,
...
...
@@ -179,17 +178,6 @@ class WebFs {
return
results
.
results
.
firstWhere
((
BuildResult
result
)
=>
result
.
target
==
kBuildTargetName
);
});
client
.
buildResults
.
listen
((
BuildResults
buildResults
)
{
final
BuildResult
result
=
buildResults
.
results
.
firstWhere
((
BuildResult
result
)
{
return
result
.
target
==
kBuildTargetName
;
});
if
(
result
.
status
==
BuildStatus
.
failed
)
{
inititalBuild
.
complete
(
false
);
}
if
(
result
.
status
==
BuildStatus
.
succeeded
)
{
inititalBuild
.
complete
(
true
);
}
});
final
int
daemonAssetPort
=
buildDaemonCreator
.
assetServerPort
(
fs
.
currentDirectory
);
// Initialize the asset bundle.
...
...
@@ -261,17 +249,13 @@ class WebFs {
cascade
=
cascade
.
add
(
assetServer
.
handle
);
final
HttpServer
server
=
await
httpMultiServerFactory
(
hostname
??
_kHostName
,
hostPort
);
shelf_io
.
serveRequests
(
server
,
cascade
.
handler
);
final
WebFs
webFS
=
WebFs
(
return
WebFs
(
client
,
server
,
dwds
,
'http://
$_kHostName
:
$hostPort
/'
,
assetServer
,
);
if
(!
await
inititalBuild
.
future
)
{
throw
Exception
(
'Failed to compile for the web.'
);
}
return
webFS
;
}
}
...
...
packages/flutter_tools/test/general.shard/web/web_fs_test.dart
View file @
618fac92
...
...
@@ -4,7 +4,6 @@
import
'package:build_daemon/client.dart'
;
import
'package:build_daemon/data/build_status.dart'
;
import
'package:built_collection/built_collection.dart'
;
import
'package:dwds/dwds.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
...
...
@@ -50,18 +49,7 @@ void main() {
return
1234
;
});
when
(
mockBuildDaemonClient
.
buildResults
).
thenAnswer
((
Invocation
_
)
{
return
Stream
<
BuildResults
>.
fromFuture
(
Future
<
BuildResults
>.
value
(
BuildResults
((
BuildResultsBuilder
builder
)
{
builder
.
results
=
ListBuilder
<
BuildResult
>(
<
BuildResult
>[
DefaultBuildResult
((
DefaultBuildResultBuilder
builder
)
{
builder
.
target
=
'web'
;
builder
.
status
=
BuildStatus
.
succeeded
;
})
]
);
})
));
return
const
Stream
<
BuildResults
>.
empty
();
});
when
(
mockBuildDaemonCreator
.
assetServerPort
(
any
)).
thenReturn
(
4321
);
testbed
=
Testbed
(
...
...
@@ -153,34 +141,6 @@ void main() {
expect
(
lastPort
,
1234
);
expect
(
lastAddress
,
contains
(
'foo'
));
}));
test
(
'Throws exception if build fails'
,
()
=>
testbed
.
run
(()
async
{
when
(
mockBuildDaemonClient
.
buildResults
).
thenAnswer
((
Invocation
_
)
{
return
Stream
<
BuildResults
>.
fromFuture
(
Future
<
BuildResults
>.
value
(
BuildResults
((
BuildResultsBuilder
builder
)
{
builder
.
results
=
ListBuilder
<
BuildResult
>(
<
BuildResult
>[
DefaultBuildResult
((
DefaultBuildResultBuilder
builder
)
{
builder
.
target
=
'web'
;
builder
.
status
=
BuildStatus
.
failed
;
})
]
);
})
));
});
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
expect
(
WebFs
.
start
(
skipDwds:
false
,
target:
fs
.
path
.
join
(
'lib'
,
'main.dart'
),
buildInfo:
BuildInfo
.
debug
,
flutterProject:
flutterProject
,
initializePlatform:
false
,
hostname:
'foo'
,
port:
'1234'
,
),
throwsA
(
isInstanceOf
<
Exception
>()));
}));
}
class
MockBuildDaemonCreator
extends
Mock
implements
BuildDaemonCreator
{}
...
...
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