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
515027a9
Unverified
Commit
515027a9
authored
Feb 28, 2020
by
Jonah Williams
Committed by
GitHub
Feb 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] allow configuring libraries spec path for the web compilation (#51590)
parent
47911e85
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
0 deletions
+19
-0
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+7
-0
compile.dart
packages/flutter_tools/lib/src/compile.dart
+7
-0
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+2
-0
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+3
-0
No files found.
packages/flutter_tools/lib/src/artifacts.dart
View file @
515027a9
...
...
@@ -40,6 +40,7 @@ enum Artifact {
kernelWorkerSnapshot
,
/// The root of the web implementation of the dart SDK.
flutterWebSdk
,
flutterWebLibrariesJson
,
/// The summary dill for the dartdevc target.
webPlatformKernelDill
,
iosDeploy
,
...
...
@@ -134,6 +135,8 @@ String _artifactToFileName(Artifact artifact, [ TargetPlatform platform, BuildMo
return
'font-subset
$exe
'
;
case
Artifact
.
constFinder
:
return
'const_finder.dart.snapshot'
;
case
Artifact
.
flutterWebLibrariesJson
:
return
'libraries.json'
;
}
assert
(
false
,
'Invalid artifact
$artifact
.'
);
return
null
;
...
...
@@ -333,6 +336,8 @@ class CachedArtifacts extends Artifacts {
return
_getFlutterPatchedSdkPath
(
mode
);
case
Artifact
.
flutterWebSdk
:
return
_getFlutterWebSdkPath
();
case
Artifact
.
flutterWebLibrariesJson
:
return
_fileSystem
.
path
.
join
(
_getFlutterWebSdkPath
(),
_artifactToFileName
(
artifact
));
case
Artifact
.
webPlatformKernelDill
:
return
_fileSystem
.
path
.
join
(
_getFlutterWebSdkPath
(),
'kernel'
,
_artifactToFileName
(
artifact
));
case
Artifact
.
dart2jsSnapshot
:
...
...
@@ -536,6 +541,8 @@ class LocalEngineArtifacts extends Artifacts {
return
_fileSystem
.
path
.
join
(
_hostEngineOutPath
,
artifactFileName
);
case
Artifact
.
constFinder
:
return
_fileSystem
.
path
.
join
(
_hostEngineOutPath
,
'gen'
,
artifactFileName
);
case
Artifact
.
flutterWebLibrariesJson
:
return
_fileSystem
.
path
.
join
(
_getFlutterWebSdkPath
(),
artifactFileName
);
}
assert
(
false
,
'Invalid artifact
$artifact
.'
);
return
null
;
...
...
packages/flutter_tools/lib/src/compile.dart
View file @
515027a9
...
...
@@ -462,6 +462,7 @@ abstract class ResidentCompiler {
List
<
String
>
experimentalFlags
,
String
platformDill
,
List
<
String
>
dartDefines
,
String
librariesSpec
,
})
=
DefaultResidentCompiler
;
// TODO(jonahwilliams): find a better way to configure additional file system
...
...
@@ -526,6 +527,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
this
.
experimentalFlags
,
this
.
platformDill
,
List
<
String
>
dartDefines
,
this
.
librariesSpec
,
})
:
assert
(
sdkRoot
!=
null
),
_stdoutHandler
=
StdoutHandler
(
consumer:
compilerMessageConsumer
),
dartDefines
=
dartDefines
??
const
<
String
>[],
...
...
@@ -542,6 +544,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
final
bool
unsafePackageSerialization
;
final
List
<
String
>
experimentalFlags
;
final
List
<
String
>
dartDefines
;
final
String
librariesSpec
;
@override
void
addFileSystemRoot
(
String
root
)
{
...
...
@@ -664,6 +667,10 @@ class DefaultResidentCompiler implements ResidentCompiler {
'--output-dill'
,
outputPath
,
],
if
(
librariesSpec
!=
null
)
...<
String
>[
'--libraries-spec'
,
librariesSpec
,
],
if
(
packagesFilePath
!=
null
)
...<
String
>[
'--packages'
,
packagesFilePath
,
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
515027a9
...
...
@@ -94,6 +94,8 @@ class FlutterDevice {
.
getArtifactPath
(
Artifact
.
webPlatformKernelDill
,
mode:
buildMode
))
.
absolute
.
uri
.
toString
(),
dartDefines:
dartDefines
,
librariesSpec:
globals
.
fs
.
file
(
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebLibrariesJson
)).
uri
.
toString
()
);
}
else
{
generator
=
ResidentCompiler
(
...
...
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
515027a9
...
...
@@ -688,6 +688,9 @@ void main() {
trackWidgetCreation:
true
,
)).
generator
as
DefaultResidentCompiler
;
expect
(
residentCompiler
.
librariesSpec
,
globals
.
fs
.
file
(
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebLibrariesJson
))
.
uri
.
toString
());
expect
(
residentCompiler
.
targetModel
,
TargetModel
.
dartdevc
);
expect
(
residentCompiler
.
sdkRoot
,
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebSdk
,
mode:
BuildMode
.
debug
)
+
'/'
);
...
...
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