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
Show 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 {
...
@@ -155,11 +155,11 @@ class FlutterKernelBuilder implements Builder {
if
(
incrementalCompilerByteStorePath
!=
null
)
{
if
(
incrementalCompilerByteStorePath
!=
null
)
{
arguments
.
add
(
'--incremental'
);
arguments
.
add
(
'--incremental'
);
}
}
final
String
generatedRoot
=
path
.
join
(
projectDir
.
absolute
.
path
,
'.dart_tool'
,
'build'
,
'generated'
,
'
$packageName
'
,
'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'
);
final
String
normalRoot
=
path
.
join
(
projectDir
.
absolute
.
path
,
'lib
${Platform.pathSeparator}
'
);
arguments
.
addAll
(<
String
>[
arguments
.
addAll
(<
String
>[
'--packages'
,
'--packages'
,
packagesFile
.
path
,
Uri
.
file
(
packagesFile
.
path
).
toString
()
,
'--output-dill'
,
'--output-dill'
,
outputFile
.
path
,
outputFile
.
path
,
'--filesystem-root'
,
'--filesystem-root'
,
...
...
packages/flutter_tools/lib/src/build_runner/build_runner.dart
View file @
b594cf85
...
@@ -4,8 +4,9 @@
...
@@ -4,8 +4,9 @@
import
'dart:async'
;
import
'dart:async'
;
import
'package:build_daemon/data/build_status.dart'
;
import
'package:build_daemon/data/build_target.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/server_log.dart'
;
import
'package:build_daemon/data/build_status.dart'
as
build
;
import
'package:build_daemon/data/build_status.dart'
as
build
;
import
'package:build_daemon/client.dart'
;
import
'package:build_daemon/client.dart'
;
...
@@ -87,7 +88,7 @@ class BuildRunner extends CodeGenerator {
...
@@ -87,7 +88,7 @@ class BuildRunner extends CodeGenerator {
.
stdout
.
stdout
.
transform
(
utf8
.
decoder
)
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
transform
(
const
LineSplitter
())
.
listen
(
print
Status
);
.
listen
(
print
Trace
);
buildProcess
buildProcess
.
stderr
.
stderr
.
transform
(
utf8
.
decoder
)
.
transform
(
utf8
.
decoder
)
...
@@ -153,7 +154,7 @@ class BuildRunner extends CodeGenerator {
...
@@ -153,7 +154,7 @@ class BuildRunner extends CodeGenerator {
final
File
syntheticPubspec
=
fs
.
file
(
fs
.
path
.
join
(
generatedDirectory
,
'pubspec.yaml'
));
final
File
syntheticPubspec
=
fs
.
file
(
fs
.
path
.
join
(
generatedDirectory
,
'pubspec.yaml'
));
final
StringBuffer
stringBuffer
=
StringBuffer
();
final
StringBuffer
stringBuffer
=
StringBuffer
();
stringBuffer
.
writeln
(
'name:
synthetic_example
'
);
stringBuffer
.
writeln
(
'name:
flutter_tool
'
);
stringBuffer
.
writeln
(
'dependencies:'
);
stringBuffer
.
writeln
(
'dependencies:'
);
final
YamlMap
builders
=
await
flutterProject
.
builders
;
final
YamlMap
builders
=
await
flutterProject
.
builders
;
for
(
String
name
in
builders
.
keys
)
{
for
(
String
name
in
builders
.
keys
)
{
...
@@ -252,8 +253,17 @@ class _BuildRunnerCodegenDaemon implements CodegenDaemon {
...
@@ -252,8 +253,17 @@ class _BuildRunnerCodegenDaemon implements CodegenDaemon {
final
File
dillFile
;
final
File
dillFile
;
@override
@override
Stream
<
bool
>
get
buildResults
=>
buildDaemonClient
.
buildResults
.
map
((
build
.
BuildResults
results
)
{
Stream
<
CodegenStatus
>
get
buildResults
=>
buildDaemonClient
.
buildResults
.
map
((
build
.
BuildResults
results
)
{
return
results
.
results
.
first
.
status
==
build
.
BuildStatus
.
succeeded
;
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
@override
...
...
packages/flutter_tools/lib/src/codegen.dart
View file @
b594cf85
...
@@ -132,7 +132,7 @@ class UnsupportedCodeGenerator extends CodeGenerator {
...
@@ -132,7 +132,7 @@ class UnsupportedCodeGenerator extends CodeGenerator {
abstract
class
CodegenDaemon
{
abstract
class
CodegenDaemon
{
/// Whether the previously enqueued build was successful.
/// Whether the previously enqueued build was successful.
Stream
<
bool
>
get
buildResults
;
Stream
<
CodegenStatus
>
get
buildResults
;
/// Starts a new build.
/// Starts a new build.
void
startBuild
();
void
startBuild
();
...
@@ -229,14 +229,19 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
...
@@ -229,14 +229,19 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
trackWidgetCreation:
trackWidgetCreation
,
trackWidgetCreation:
trackWidgetCreation
,
);
);
codegenDaemon
.
startBuild
();
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
(
final
ResidentCompiler
residentCompiler
=
ResidentCompiler
(
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
),
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
),
trackWidgetCreation:
trackWidgetCreation
,
trackWidgetCreation:
trackWidgetCreation
,
packagesPath:
codegenDaemon
.
packagesFile
.
path
,
packagesPath:
codegenDaemon
.
packagesFile
.
path
,
fileSystemRoots:
<
String
>[
fileSystemRoots:
<
String
>[
f
lutterProject
.
generated
.
absolute
.
path
,
f
s
.
path
.
join
(
flutterProject
.
generated
.
absolute
.
path
,
'lib
${platform.pathSeparator}
'
)
,
f
lutterProject
.
directory
.
path
,
f
s
.
path
.
join
(
flutterProject
.
directory
.
path
,
'lib
${platform.pathSeparator}
'
)
,
],
],
fileSystemScheme:
_kMultiRootScheme
,
fileSystemScheme:
_kMultiRootScheme
,
targetModel:
TargetModel
.
flutter
,
targetModel:
TargetModel
.
flutter
,
...
@@ -261,7 +266,12 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
...
@@ -261,7 +266,12 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
@override
@override
Future
<
CompilerOutput
>
recompile
(
String
mainPath
,
List
<
String
>
invalidatedFiles
,
{
String
outputPath
,
String
packagesFilePath
})
async
{
Future
<
CompilerOutput
>
recompile
(
String
mainPath
,
List
<
String
>
invalidatedFiles
,
{
String
outputPath
,
String
packagesFilePath
})
async
{
_codegenDaemon
.
startBuild
();
_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.
// Delete this file so that the frontend_server can handle multi-root.
// TODO(jonahwilliams): investigate frontend_server behavior in the presence
// TODO(jonahwilliams): investigate frontend_server behavior in the presence
// of multi-root and initialize from dill.
// of multi-root and initialize from dill.
...
@@ -291,3 +301,16 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
...
@@ -291,3 +301,16 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
return
_residentCompiler
.
shutdown
();
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