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
57bca7da
Commit
57bca7da
authored
Nov 17, 2015
by
Kris Giesing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow flutter engine path to be set when using run_mojo
parent
fc5832dc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
run_mojo.dart
packages/flutter_tools/lib/src/commands/run_mojo.dart
+23
-3
No files found.
packages/flutter_tools/lib/src/commands/run_mojo.dart
View file @
57bca7da
...
...
@@ -12,10 +12,11 @@ import 'package:path/path.dart' as path;
import
'../artifacts.dart'
;
import
'../build_configuration.dart'
;
import
'../process.dart'
;
import
'flutter_command.dart'
;
final
Logger
_logging
=
new
Logger
(
'flutter_tools.run_mojo'
);
class
RunMojoCommand
extends
Command
{
class
RunMojoCommand
extends
Flutter
Command
{
final
String
name
=
'run_mojo'
;
final
String
description
=
'Run a Flutter app in mojo.'
;
...
...
@@ -58,6 +59,18 @@ class RunMojoCommand extends Command {
return
_makePathAbsolute
(
path
.
join
(
argResults
[
'mojo-path'
],
'out'
,
mojoBuildType
,
'mojo_shell'
));
}
BuildConfig
_getCurrentHostConfig
()
{
BuildConfiguration
result
;
TargetPlatform
target
=
getCurrentHostPlatformAsTarget
();
for
(
BuildConfiguration
config
in
buildConfigurations
)
{
if
(
config
.
targetPlatform
==
target
)
{
result
=
config
;
break
;
}
}
return
result
;
}
Future
<
List
<
String
>>
_getShellConfig
()
async
{
List
<
String
>
args
=
[];
...
...
@@ -77,8 +90,15 @@ class RunMojoCommand extends Command {
args
.
add
(
'--url-mappings=mojo:sky_viewer=http://sky_viewer/sky_viewer.mojo'
);
}
else
{
final
appPath
=
_makePathAbsolute
(
argResults
[
'app'
]);
String
viewerPath
;
BuildConfig
config
=
_getCurrentHostConfig
();
if
(
config
.
type
==
BuildType
.
prebuilt
)
{
Artifact
artifact
=
ArtifactStore
.
getArtifact
(
type:
ArtifactType
.
viewer
,
targetPlatform:
TargetPlatform
.
linux
);
final
viewerPath
=
_makePathAbsolute
(
await
ArtifactStore
.
getPath
(
artifact
));
viewerPath
=
_makePathAbsolute
(
await
ArtifactStore
.
getPath
(
artifact
));
}
else
{
String
localPath
=
path
.
join
(
config
.
buildDir
,
'sky_viewer.mojo'
);
viewerPath
=
_makePathAbsolute
(
localPath
);
}
args
.
add
(
'file://
$appPath
'
);
args
.
add
(
'--url-mappings=mojo:sky_viewer=file://
$viewerPath
'
);
}
...
...
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