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
c4da1da2
Commit
c4da1da2
authored
Mar 24, 2016
by
Alhaad Gokhale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow run_mojo command to run an app at a URL.
Fixes #2113
parent
a8c108de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
run_mojo.dart
packages/flutter_tools/lib/src/commands/run_mojo.dart
+19
-6
No files found.
packages/flutter_tools/lib/src/commands/run_mojo.dart
View file @
c4da1da2
...
...
@@ -94,7 +94,6 @@ class RunMojoCommand extends FlutterCommand {
args
.
add
(
command
);
BuildConfiguration
config
=
_getCurrentHostConfig
();
final
String
appPath
=
_makePathAbsolute
(
bundlePath
);
String
flutterPath
;
if
(
config
==
null
||
config
.
type
==
BuildType
.
prebuilt
)
{
...
...
@@ -108,17 +107,31 @@ class RunMojoCommand extends FlutterCommand {
if
(
argResults
[
'android'
])
{
args
.
add
(
'--android'
);
final
String
appName
=
path
.
basename
(
appPath
);
final
String
appDir
=
path
.
dirname
(
appPath
);
args
.
add
(
'mojo:launcher http://app/
$appName
'
);
args
.
add
(
'--map-origin=http://app/=
$appDir
'
);
}
try
{
final
String
appPath
=
_makePathAbsolute
(
bundlePath
);
if
(
argResults
[
'android'
])
{
final
String
appName
=
path
.
basename
(
appPath
);
final
String
appDir
=
path
.
dirname
(
appPath
);
args
.
add
(
'mojo:launcher http://app/
$appName
'
);
args
.
add
(
'--map-origin=http://app/=
$appDir
'
);
}
else
{
args
.
add
(
'mojo:launcher file://
$appPath
'
);
}
}
catch
(
_
)
{
// This means that |bundlePath| is not on the file-system, so let us treat
// it as a URL.
args
.
add
(
'mojo:launcher
$bundlePath
'
);
}
// Add url-mapping for mojo:flutter.
if
(
argResults
[
'android'
])
{
final
String
flutterName
=
path
.
basename
(
flutterPath
);
final
String
flutterDir
=
path
.
dirname
(
flutterPath
);
args
.
add
(
'--map-origin=http://flutter/=
$flutterDir
'
);
args
.
add
(
'--url-mappings=mojo:flutter=http://flutter/
$flutterName
'
);
}
else
{
args
.
add
(
'mojo:launcher file://
$appPath
'
);
args
.
add
(
'--url-mappings=mojo:flutter=file://
$flutterPath
'
);
}
...
...
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