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
4d0e6984
Commit
4d0e6984
authored
May 05, 2016
by
Jason Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build tool support for Android x86 targets in 32- or 64-bit modes (#3761)
parent
a9993664
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
72 additions
and
21 deletions
+72
-21
engine.version
bin/cache/engine.version
+1
-1
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+35
-14
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+2
-0
build_configuration.dart
packages/flutter_tools/lib/src/build_configuration.dart
+1
-0
cache.dart
packages/flutter_tools/lib/src/cache.dart
+2
-1
build_apk.dart
packages/flutter_tools/lib/src/commands/build_apk.dart
+17
-2
toolchain.dart
packages/flutter_tools/lib/src/toolchain.dart
+14
-3
No files found.
bin/cache/engine.version
View file @
4d0e6984
d85ead8ec2556739924282e2b3f77ff077a45820
86837edd4ecbe5d28f16a770dff40a239f5b40b7
packages/flutter_tools/lib/src/android/android_device.dart
View file @
4d0e6984
...
...
@@ -49,23 +49,49 @@ class AndroidDevice extends Device {
final
String
modelID
;
final
String
deviceCodeName
;
Map
<
String
,
String
>
_properties
;
bool
_isLocalEmulator
;
TargetPlatform
_platform
;
String
_getProperty
(
String
name
)
{
if
(
_properties
==
null
)
{
String
getpropOutput
=
runCheckedSync
(
adbCommandForDevice
(<
String
>[
'shell'
,
'getprop'
]));
RegExp
propertyExp
=
new
RegExp
(
r'\[(.*?)\]: \[(.*?)\]'
);
_properties
=
<
String
,
String
>{};
for
(
Match
m
in
propertyExp
.
allMatches
(
getpropOutput
))
{
_properties
[
m
.
group
(
1
)]
=
m
.
group
(
2
);
}
}
return
_properties
[
name
];
}
@override
bool
get
isLocalEmulator
{
if
(
_isLocalEmulator
==
null
)
{
String
characteristics
=
_getProperty
(
'ro.build.characteristics'
);
_isLocalEmulator
=
characteristics
!=
null
&&
characteristics
.
contains
(
'emulator'
);
}
return
_isLocalEmulator
;
}
@override
TargetPlatform
get
platform
{
if
(
_platform
==
null
)
{
// http://developer.android.com/ndk/guides/abis.html (x86, armeabi-v7a, ...)
try
{
String
value
=
runCheckedSync
(
adbCommandForDevice
(
<
String
>[
'shell'
,
'getprop'
,
'ro.product.cpu.abi'
]
));
_isLocalEmulator
=
value
.
startsWith
(
'x86'
);
}
catch
(
error
)
{
_isLocalEmulator
=
false
;
switch
(
_getProperty
(
'ro.product.cpu.abi'
))
{
case
'x86_64'
:
_platform
=
TargetPlatform
.
android_x64
;
break
;
case
'x86'
:
_platform
=
TargetPlatform
.
android_x86
;
break
;
default
:
_platform
=
TargetPlatform
.
android_arm
;
break
;
}
}
return
_
isLocalEmulator
;
return
_
platform
;
}
_AdbLogReader
_logReader
;
...
...
@@ -123,9 +149,7 @@ class AndroidDevice extends Device {
runCheckedSync
(<
String
>[
androidSdk
.
adbPath
,
'start-server'
]);
// Sample output: '22'
String
sdkVersion
=
runCheckedSync
(
adbCommandForDevice
(<
String
>[
'shell'
,
'getprop'
,
'ro.build.version.sdk'
])
).
trimRight
();
String
sdkVersion
=
_getProperty
(
'ro.build.version.sdk'
);
int
sdkVersionParsed
=
int
.
parse
(
sdkVersion
,
onError:
(
String
source
)
=>
null
);
if
(
sdkVersionParsed
==
null
)
{
...
...
@@ -333,9 +357,6 @@ class AndroidDevice extends Device {
return
runCommandAndStreamOutput
(
command
).
then
((
int
exitCode
)
=>
exitCode
==
0
);
}
@override
TargetPlatform
get
platform
=>
isLocalEmulator
?
TargetPlatform
.
android_x64
:
TargetPlatform
.
android_arm
;
@override
void
clearLogs
()
{
runSync
(
adbCommandForDevice
(<
String
>[
'logcat'
,
'-c'
]));
...
...
packages/flutter_tools/lib/src/application_package.dart
View file @
4d0e6984
...
...
@@ -103,6 +103,7 @@ ApplicationPackage getApplicationPackageForPlatform(TargetPlatform platform) {
switch
(
platform
)
{
case
TargetPlatform
.
android_arm
:
case
TargetPlatform
.
android_x64
:
case
TargetPlatform
.
android_x86
:
return
new
AndroidApk
.
fromCurrentDirectory
();
case
TargetPlatform
.
ios
:
return
new
IOSApp
.
fromCurrentDirectory
();
...
...
@@ -122,6 +123,7 @@ class ApplicationPackageStore {
switch
(
platform
)
{
case
TargetPlatform
.
android_arm
:
case
TargetPlatform
.
android_x64
:
case
TargetPlatform
.
android_x86
:
android
??=
new
AndroidApk
.
fromCurrentDirectory
();
return
android
;
case
TargetPlatform
.
ios
:
...
...
packages/flutter_tools/lib/src/build_configuration.dart
View file @
4d0e6984
...
...
@@ -41,6 +41,7 @@ String getNameForHostPlatform(HostPlatform platform) {
enum
TargetPlatform
{
android_arm
,
android_x64
,
android_x86
,
ios
,
darwin_x64
,
linux_x64
...
...
packages/flutter_tools/lib/src/cache.dart
View file @
4d0e6984
...
...
@@ -192,7 +192,8 @@ class FlutterEngine {
'android-arm'
,
'android-arm-profile'
,
'android-arm-release'
,
'android-x64'
'android-x64'
,
'android-x86'
,
];
if
(
Platform
.
isMacOS
)
...
...
packages/flutter_tools/lib/src/commands/build_apk.dart
View file @
4d0e6984
...
...
@@ -261,6 +261,21 @@ class BuildApkCommand extends FlutterCommand {
}
}
// Return the directory name within the APK that is used for native code libraries
// on the given platform.
String
getAbiDirectory
(
TargetPlatform
platform
)
{
switch
(
platform
)
{
case
TargetPlatform
.
android_arm
:
return
'armeabi-v7a'
;
case
TargetPlatform
.
android_x64
:
return
'x86_64'
;
case
TargetPlatform
.
android_x86
:
return
'x86'
;
default
:
throw
new
Exception
(
'Unsupported platform.'
);
}
}
Future
<
_ApkComponents
>
_findApkComponents
(
TargetPlatform
platform
,
BuildMode
buildMode
,
...
...
@@ -274,7 +289,7 @@ Future<_ApkComponents> _findApkComponents(
components
.
extraFiles
=
extraFiles
!=
null
?
extraFiles
:
<
String
,
File
>{};
if
(
tools
.
isLocalEngine
)
{
String
abiDir
=
platform
==
TargetPlatform
.
android_arm
?
'armeabi-v7a'
:
'x86_64'
;
String
abiDir
=
getAbiDirectory
(
platform
)
;
String
enginePath
=
tools
.
engineSrcPath
;
String
buildDir
=
tools
.
getEngineArtifactsDirectory
(
platform
,
buildMode
).
path
;
...
...
@@ -348,7 +363,7 @@ int _buildApk(
_AssetBuilder
artifactBuilder
=
new
_AssetBuilder
(
tempDir
,
'artifacts'
);
artifactBuilder
.
add
(
classesDex
,
'classes.dex'
);
String
abiDir
=
platform
==
TargetPlatform
.
android_arm
?
'armeabi-v7a'
:
'x86_64'
;
String
abiDir
=
getAbiDirectory
(
platform
)
;
artifactBuilder
.
add
(
components
.
libSkyShell
,
'lib/
$abiDir
/libsky_shell.so'
);
for
(
String
relativePath
in
components
.
extraFiles
.
keys
)
...
...
packages/flutter_tools/lib/src/toolchain.dart
View file @
4d0e6984
...
...
@@ -144,10 +144,9 @@ class ToolConfiguration {
switch
(
platform
)
{
case
TargetPlatform
.
android_arm
:
type
=
'android'
;
break
;
case
TargetPlatform
.
android_x64
:
type
=
'android_sim'
;
case
TargetPlatform
.
android_x86
:
type
=
'android'
;
break
;
// TODO(devoncarew): We will need an ios vs ios_x86 target (for ios vs. ios_sim).
...
...
@@ -166,6 +165,18 @@ class ToolConfiguration {
if
(
isAotBuildMode
(
mode
))
buildOutputPath
+=
'_Deploy'
;
// Add a suffix for the target architecture.
switch
(
platform
)
{
case
TargetPlatform
.
android_x64
:
buildOutputPath
+=
'_x64'
;
break
;
case
TargetPlatform
.
android_x86
:
buildOutputPath
+=
'_x86'
;
break
;
default
:
break
;
}
return
new
Directory
(
path
.
join
(
engineSrcPath
,
buildOutputPath
));
}
else
{
String
suffix
=
mode
!=
BuildMode
.
debug
?
'-
${getModeName(mode)}
'
:
''
;
...
...
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