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
4aba536a
Commit
4aba536a
authored
Aug 30, 2016
by
Jason Simmons
Committed by
GitHub
Aug 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support x86/x64 targets in the build apk command (#5660)
Fixes
https://github.com/flutter/flutter/issues/5592
parent
a4c9adfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
build_apk.dart
packages/flutter_tools/lib/src/commands/build_apk.dart
+29
-2
No files found.
packages/flutter_tools/lib/src/commands/build_apk.dart
View file @
4aba536a
...
...
@@ -181,6 +181,10 @@ class BuildApkCommand extends BuildSubCommand {
argParser
.
addOption
(
'flx'
,
abbr:
'f'
,
help:
'Path to the FLX file. If this is not provided, an FLX will be built.'
);
argParser
.
addOption
(
'target-arch'
,
defaultsTo:
'arm'
,
allowed:
<
String
>[
'arm'
,
'x86'
,
'x64'
],
help:
'Architecture of the target device.'
);
argParser
.
addOption
(
'aot-path'
,
help:
'Path to the ahead-of-time compiled snapshot directory.
\n
'
'If this is not provided, an AOT snapshot will be built.'
);
...
...
@@ -203,19 +207,42 @@ class BuildApkCommand extends BuildSubCommand {
'debugging and a quick development cycle.
\'
release
\'
builds don
\'
t support debugging and are
\n
'
'suitable for deploying to app stores.'
;
TargetPlatform
_getTargetPlatform
(
String
targetArch
)
{
switch
(
targetArch
)
{
case
'arm'
:
return
TargetPlatform
.
android_arm
;
case
'x86'
:
return
TargetPlatform
.
android_x86
;
case
'x64'
:
return
TargetPlatform
.
android_x64
;
default
:
throw
new
Exception
(
'Unrecognized target architecture:
$targetArch
'
);
}
}
@override
Future
<
int
>
runInProject
()
async
{
await
super
.
runInProject
();
TargetPlatform
targetPlatform
=
_getTargetPlatform
(
argResults
[
'target-arch'
]);
if
(
targetPlatform
!=
TargetPlatform
.
android_arm
&&
getBuildMode
()
!=
BuildMode
.
debug
)
{
printError
(
'Profile and release builds are only supported on ARM targets.'
);
return
1
;
}
if
(
isProjectUsingGradle
())
{
if
(
targetPlatform
!=
TargetPlatform
.
android_arm
)
{
printError
(
'Gradle builds only support ARM targets.'
);
return
1
;
}
return
await
buildAndroidWithGradle
(
TargetPlatform
.
android_arm
,
getBuildMode
(),
target:
targetFile
);
}
else
{
// TODO(devoncarew): This command should take an arg for the output type (arm / x64).
return
await
buildAndroid
(
TargetPlatform
.
android_a
rm
,
targetPlatfo
rm
,
getBuildMode
(),
force:
true
,
manifest:
argResults
[
'manifest'
],
...
...
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