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
b4bdf01e
Commit
b4bdf01e
authored
Dec 17, 2015
by
Eric Seidel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #972 from eseidelGoogle/apk_fix
Fix `flutter apk` to work with resources
parents
fd4599ff
dd440d0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
apk.dart
packages/flutter_tools/lib/src/commands/apk.dart
+16
-6
No files found.
packages/flutter_tools/lib/src/commands/apk.dart
View file @
b4bdf01e
...
...
@@ -19,6 +19,7 @@ import 'start.dart';
const
String
_kDefaultAndroidManifestPath
=
'apk/AndroidManifest.xml'
;
const
String
_kDefaultOutputPath
=
'build/app.apk'
;
const
String
_kDefaultResourcesPath
=
'apk/res'
;
const
String
_kKeystoreKeyName
=
"chromiumdebugkey"
;
const
String
_kKeystorePassword
=
"chromium"
;
...
...
@@ -74,11 +75,11 @@ class _ApkBuilder {
'-A'
,
assets
.
path
,
'-I'
,
_androidJar
.
path
,
'-F'
,
outputApk
.
path
,
artifacts
.
path
];
if
(
resources
.
existsSync
()
)
{
packageArgs
.
addAll
([
'-S'
,
resources
.
path
]);
if
(
resources
!=
null
)
{
packageArgs
.
addAll
([
'-S'
,
resources
.
absolute
.
path
]);
}
packageArgs
.
add
(
artifacts
.
path
);
runCheckedSync
(
packageArgs
);
}
...
...
@@ -115,6 +116,10 @@ class ApkCommand extends FlutterCommand {
abbr:
'm'
,
defaultsTo:
_kDefaultAndroidManifestPath
,
help:
'Android manifest XML file.'
);
argParser
.
addOption
(
'resources'
,
abbr:
'r'
,
defaultsTo:
_kDefaultResourcesPath
,
help:
'Resources directory path.'
);
argParser
.
addOption
(
'output-file'
,
abbr:
'o'
,
defaultsTo:
_kDefaultOutputPath
,
...
...
@@ -159,13 +164,18 @@ class ApkCommand extends FlutterCommand {
_ApkComponents
components
=
new
_ApkComponents
();
components
.
androidSdk
=
new
Directory
(
androidSdkPath
);
components
.
manifest
=
new
File
(
argResults
[
'manifest'
]);
;
components
.
manifest
=
new
File
(
argResults
[
'manifest'
]);
components
.
icuData
=
new
File
(
artifactPaths
[
0
]);
components
.
classesDex
=
new
File
(
artifactPaths
[
1
]);
components
.
libSkyShell
=
new
File
(
artifactPaths
[
2
]);
components
.
keystore
=
new
File
(
artifactPaths
[
3
]);
// TODO(eseidel): Should this be configurable from flutter.yaml?
components
.
resources
=
new
Directory
(
'apk/res'
);
components
.
resources
=
new
Directory
(
argResults
[
'resources'
]);
if
(!
components
.
resources
.
existsSync
())
{
// TODO(eseidel): This level should be higher when path is manually set.
logging
.
info
(
'Can not locate Resources:
${components.resources}
, ignoring.'
);
components
.
resources
=
null
;
}
if
(!
components
.
androidSdk
.
existsSync
())
{
logging
.
severe
(
'Can not locate Android SDK:
$androidSdkPath
'
);
...
...
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