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
b594cf85
Unverified
Commit
b594cf85
authored
Feb 21, 2019
by
Jonah Williams
Committed by
GitHub
Feb 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extra slash from builder that is not handled on windows (#28027)
parent
72b6ed35
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
13 deletions
+46
-13
kernel_builder.dart
packages/flutter_build/lib/src/kernel_builder.dart
+3
-3
build_runner.dart
...ages/flutter_tools/lib/src/build_runner/build_runner.dart
+15
-5
codegen.dart
packages/flutter_tools/lib/src/codegen.dart
+28
-5
No files found.
packages/flutter_build/lib/src/kernel_builder.dart
View file @
b594cf85
...
...
@@ -155,11 +155,11 @@ class FlutterKernelBuilder implements Builder {
if
(
incrementalCompilerByteStorePath
!=
null
)
{
arguments
.
add
(
'--incremental'
);
}
final
String
generatedRoot
=
path
.
join
(
projectDir
.
absolute
.
path
,
'.dart_tool'
,
'build'
,
'generated'
,
'
$packageName
'
,
'lib'
);
final
String
normalRoot
=
path
.
join
(
projectDir
.
absolute
.
path
,
'lib'
);
final
String
generatedRoot
=
path
.
join
(
projectDir
.
absolute
.
path
,
'.dart_tool'
,
'build'
,
'generated'
,
'
$packageName
'
,
'lib
${Platform.pathSeparator}
'
);
final
String
normalRoot
=
path
.
join
(
projectDir
.
absolute
.
path
,
'lib
${Platform.pathSeparator}
'
);
arguments
.
addAll
(<
String
>[
'--packages'
,
packagesFile
.
path
,
Uri
.
file
(
packagesFile
.
path
).
toString
()
,
'--output-dill'
,
outputFile
.
path
,
'--filesystem-root'
,
...
...
packages/flutter_tools/lib/src/build_runner/build_runner.dart
View file @
b594cf85
...
...
@@ -4,8 +4,9 @@
import
'dart:async'
;
import
'package:build_daemon/data/build_status.dart'
;
import
'package:build_daemon/data/build_target.dart'
;
import
'package:build_runner_core/build_runner_core.dart'
;
import
'package:build_runner_core/build_runner_core.dart'
hide
BuildStatus
;
import
'package:build_daemon/data/server_log.dart'
;
import
'package:build_daemon/data/build_status.dart'
as
build
;
import
'package:build_daemon/client.dart'
;
...
...
@@ -87,7 +88,7 @@ class BuildRunner extends CodeGenerator {
.
stdout
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
listen
(
print
Status
);
.
listen
(
print
Trace
);
buildProcess
.
stderr
.
transform
(
utf8
.
decoder
)
...
...
@@ -153,7 +154,7 @@ class BuildRunner extends CodeGenerator {
final
File
syntheticPubspec
=
fs
.
file
(
fs
.
path
.
join
(
generatedDirectory
,
'pubspec.yaml'
));
final
StringBuffer
stringBuffer
=
StringBuffer
();
stringBuffer
.
writeln
(
'name:
synthetic_example
'
);
stringBuffer
.
writeln
(
'name:
flutter_tool
'
);
stringBuffer
.
writeln
(
'dependencies:'
);
final
YamlMap
builders
=
await
flutterProject
.
builders
;
for
(
String
name
in
builders
.
keys
)
{
...
...
@@ -252,8 +253,17 @@ class _BuildRunnerCodegenDaemon implements CodegenDaemon {
final
File
dillFile
;
@override
Stream
<
bool
>
get
buildResults
=>
buildDaemonClient
.
buildResults
.
map
((
build
.
BuildResults
results
)
{
return
results
.
results
.
first
.
status
==
build
.
BuildStatus
.
succeeded
;
Stream
<
CodegenStatus
>
get
buildResults
=>
buildDaemonClient
.
buildResults
.
map
((
build
.
BuildResults
results
)
{
if
(
results
.
results
.
first
.
status
==
BuildStatus
.
failed
)
{
return
CodegenStatus
.
Failed
;
}
if
(
results
.
results
.
first
.
status
==
BuildStatus
.
started
)
{
return
CodegenStatus
.
Started
;
}
if
(
results
.
results
.
first
.
status
==
BuildStatus
.
succeeded
)
{
return
CodegenStatus
.
Succeeded
;
}
return
null
;
});
@override
...
...
packages/flutter_tools/lib/src/codegen.dart
View file @
b594cf85
...
...
@@ -132,7 +132,7 @@ class UnsupportedCodeGenerator extends CodeGenerator {
abstract
class
CodegenDaemon
{
/// Whether the previously enqueued build was successful.
Stream
<
bool
>
get
buildResults
;
Stream
<
CodegenStatus
>
get
buildResults
;
/// Starts a new build.
void
startBuild
();
...
...
@@ -229,14 +229,19 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
trackWidgetCreation:
trackWidgetCreation
,
);
codegenDaemon
.
startBuild
();
await
codegenDaemon
.
buildResults
.
firstWhere
((
bool
result
)
=>
result
);
final
CodegenStatus
status
=
await
codegenDaemon
.
buildResults
.
firstWhere
((
CodegenStatus
status
)
{
return
status
==
CodegenStatus
.
Succeeded
||
status
==
CodegenStatus
.
Failed
;
});
if
(
status
==
CodegenStatus
.
Failed
)
{
printError
(
'Codegeneration failed, halting build.'
);
}
final
ResidentCompiler
residentCompiler
=
ResidentCompiler
(
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
),
trackWidgetCreation:
trackWidgetCreation
,
packagesPath:
codegenDaemon
.
packagesFile
.
path
,
fileSystemRoots:
<
String
>[
f
lutterProject
.
generated
.
absolute
.
path
,
f
lutterProject
.
directory
.
path
,
f
s
.
path
.
join
(
flutterProject
.
generated
.
absolute
.
path
,
'lib
${platform.pathSeparator}
'
)
,
f
s
.
path
.
join
(
flutterProject
.
directory
.
path
,
'lib
${platform.pathSeparator}
'
)
,
],
fileSystemScheme:
_kMultiRootScheme
,
targetModel:
TargetModel
.
flutter
,
...
...
@@ -261,7 +266,12 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
@override
Future
<
CompilerOutput
>
recompile
(
String
mainPath
,
List
<
String
>
invalidatedFiles
,
{
String
outputPath
,
String
packagesFilePath
})
async
{
_codegenDaemon
.
startBuild
();
await
_codegenDaemon
.
buildResults
.
first
;
final
CodegenStatus
status
=
await
_codegenDaemon
.
buildResults
.
firstWhere
((
CodegenStatus
status
)
{
return
status
==
CodegenStatus
.
Succeeded
||
status
==
CodegenStatus
.
Failed
;
});
if
(
status
==
CodegenStatus
.
Failed
)
{
printError
(
'Codegeneration failed, halting build.'
);
}
// Delete this file so that the frontend_server can handle multi-root.
// TODO(jonahwilliams): investigate frontend_server behavior in the presence
// of multi-root and initialize from dill.
...
...
@@ -291,3 +301,16 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
return
_residentCompiler
.
shutdown
();
}
}
/// The current status of a codegen build.
enum
CodegenStatus
{
/// The build has started running.
///
/// If this is the current status when running a hot reload, an additional build does
/// not need to be started.
Started
,
/// The build succeeded.
Succeeded
,
/// The build failed.
Failed
}
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