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
522f607b
Commit
522f607b
authored
Oct 04, 2016
by
P.Y. Laligand
Committed by
GitHub
Oct 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow an output file header to be specified when building for Fuchsia. (#6181)
parent
f18f8953
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
fuchsia_builder.dart
packages/flutter_tools/bin/fuchsia_builder.dart
+24
-4
No files found.
packages/flutter_tools/bin/fuchsia_builder.dart
View file @
522f607b
...
...
@@ -16,6 +16,7 @@ const String _kOptionSnapshotter = 'snapshotter-path';
const
String
_kOptionTarget
=
'target'
;
const
String
_kOptionPackages
=
'packages'
;
const
String
_kOptionOutput
=
'output-file'
;
const
String
_kOptionHeader
=
'header'
;
const
String
_kOptionSnapshot
=
'snapshot'
;
const
String
_kOptionDepfile
=
'depfile'
;
const
String
_kOptionWorking
=
'working-dir'
;
...
...
@@ -24,6 +25,7 @@ const List<String> _kOptions = const <String>[
_kOptionTarget
,
_kOptionPackages
,
_kOptionOutput
,
_kOptionHeader
,
_kOptionSnapshot
,
_kOptionDepfile
,
_kOptionWorking
,
...
...
@@ -36,6 +38,7 @@ Future<Null> main(List<String> args) async {
..
addOption
(
_kOptionTarget
,
help:
'The entry point into the app'
)
..
addOption
(
_kOptionPackages
,
help:
'The .packages file'
)
..
addOption
(
_kOptionOutput
,
help:
'The generated flx file'
)
..
addOption
(
_kOptionHeader
,
help:
'The header of the flx file'
)
..
addOption
(
_kOptionSnapshot
,
help:
'The generated snapshot file'
)
..
addOption
(
_kOptionDepfile
,
help:
'The generated dependency file'
)
..
addOption
(
_kOptionWorking
,
...
...
@@ -46,7 +49,7 @@ Future<Null> main(List<String> args) async {
exit
(
1
);
}
String
outputPath
=
argResults
[
_kOptionOutput
];
final
int
r
esult
=
await
build
(
final
int
buildR
esult
=
await
build
(
snapshotterPath:
argResults
[
_kOptionSnapshotter
],
mainPath:
argResults
[
_kOptionTarget
],
outputPath:
outputPath
,
...
...
@@ -56,8 +59,25 @@ Future<Null> main(List<String> args) async {
packagesPath:
argResults
[
_kOptionPackages
],
includeRobotoFonts:
true
,
);
if
(
result
!=
0
)
{
printError
(
'Error building
$outputPath
:
$result
.'
);
if
(
buildResult
!=
0
)
{
printError
(
'Error building
$outputPath
:
$buildResult
.'
);
exit
(
buildResult
);
}
final
int
headerResult
=
_addHeader
(
outputPath
,
argResults
[
_kOptionHeader
]);
if
(
headerResult
!=
0
)
{
printError
(
'Error adding header to
$outputPath
:
$headerResult
.'
);
}
exit
(
headerResult
);
}
int
_addHeader
(
String
outputPath
,
String
header
)
{
try
{
final
File
outputFile
=
new
File
(
outputPath
);
final
List
<
int
>
content
=
outputFile
.
readAsBytesSync
();
outputFile
.
writeAsStringSync
(
'
$header
\n
'
);
outputFile
.
writeAsBytesSync
(
content
,
mode:
FileMode
.
APPEND
);
return
0
;
}
catch
(
_
)
{
return
1
;
}
exit
(
result
);
}
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