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
bd02e4f5
Unverified
Commit
bd02e4f5
authored
Jul 30, 2019
by
Emmanuel Garcia
Committed by
GitHub
Jul 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test that modules built as AAR contain the right assets and artifacts (#37206)
parent
dfad0395
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
3 deletions
+71
-3
build_aar_module_test.dart
dev/devicelab/bin/tasks/build_aar_module_test.dart
+64
-2
apk_utils.dart
dev/devicelab/lib/framework/apk_utils.dart
+7
-1
No files found.
dev/devicelab/bin/tasks/build_aar_module_test.dart
View file @
bd02e4f5
...
...
@@ -5,6 +5,7 @@
import
'dart:async'
;
import
'dart:io'
;
import
'package:flutter_devicelab/framework/apk_utils.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:path/path.dart'
as
path
;
...
...
@@ -134,6 +135,33 @@ Future<void> main() async {
'package_info_release-1.0.pom'
,
));
section
(
'Check assets in release AAR'
);
final
Iterable
<
String
>
releaseAar
=
await
getFilesInAar
(
path
.
join
(
repoPath
,
'io'
,
'flutter'
,
'devicelab'
,
'hello'
,
'flutter_release'
,
'1.0'
,
'flutter_release-1.0.aar'
,
));
checkItContains
<
String
>(<
String
>[
'assets/flutter_assets/FontManifest.json'
,
'assets/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf'
,
],
releaseAar
);
section
(
'Check AOT blobs in release AAR'
);
checkItContains
<
String
>(<
String
>[
'jni/arm64-v8a/libapp.so'
,
'jni/arm64-v8a/libflutter.so'
,
'jni/armeabi-v7a/libapp.so'
,
'jni/armeabi-v7a/libflutter.so'
,
],
releaseAar
);
section
(
'Build debug AAR'
);
await
inDirectory
(
projectDir
,
()
async
{
...
...
@@ -149,9 +177,9 @@ Future<void> main() async {
'flutter'
,
'devicelab'
,
'hello'
,
'flutter_
release
'
,
'flutter_
debug
'
,
'1.0'
,
'flutter_
release
-1.0.aar'
,
'flutter_
debug
-1.0.aar'
,
));
checkFileExists
(
path
.
join
(
...
...
@@ -209,7 +237,41 @@ Future<void> main() async {
'package_info_debug-1.0.pom'
,
));
section
(
'Check assets in debug AAR'
);
final
Iterable
<
String
>
debugAar
=
await
getFilesInAar
(
path
.
join
(
repoPath
,
'io'
,
'flutter'
,
'devicelab'
,
'hello'
,
'flutter_debug'
,
'1.0'
,
'flutter_debug-1.0.aar'
,
));
checkItContains
<
String
>(<
String
>[
'assets/flutter_assets/FontManifest.json'
,
'assets/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf'
,
// JIT snapshots.
'assets/flutter_assets/isolate_snapshot_data'
,
'assets/flutter_assets/kernel_blob.bin'
,
'assets/flutter_assets/vm_snapshot_data'
,
],
debugAar
);
section
(
'Check AOT blobs in debug AAR'
);
checkItContains
<
String
>(<
String
>[
'jni/arm64-v8a/libflutter.so'
,
'jni/armeabi-v7a/libflutter.so'
,
'jni/x86/libflutter.so'
,
'jni/x86_64/libflutter.so'
,
],
debugAar
);
return
TaskResult
.
success
(
null
);
}
on
TaskResult
catch
(
taskResult
)
{
return
taskResult
;
}
catch
(
e
)
{
return
TaskResult
.
failure
(
e
.
toString
());
}
finally
{
...
...
dev/devicelab/lib/framework/apk_utils.dart
View file @
bd02e4f5
...
...
@@ -34,6 +34,7 @@ Future<void> runPluginProjectTest(Future<void> testFunction(FlutterPluginProject
}
}
/// Returns the list of files inside an Android Package Kit.
Future
<
Iterable
<
String
>>
getFilesInApk
(
String
apk
)
async
{
if
(!
File
(
apk
).
existsSync
())
throw
TaskResult
.
failure
(
...
...
@@ -50,11 +51,16 @@ Future<Iterable<String>> getFilesInApk(String apk) async {
.
map
((
String
line
)
=>
line
.
split
(
' '
).
last
)
.
toList
();
}
/// Returns the list of files inside an Android App Bundle.
Future
<
Iterable
<
String
>>
getFilesInAppBundle
(
String
bundle
)
{
return
getFilesInApk
(
bundle
);
}
/// Returns the list of files inside an Android Archive.
Future
<
Iterable
<
String
>>
getFilesInAar
(
String
aar
)
{
return
getFilesInApk
(
aar
);
}
void
checkItContains
<
T
>(
Iterable
<
T
>
values
,
Iterable
<
T
>
collection
)
{
for
(
T
value
in
values
)
{
if
(!
collection
.
contains
(
value
))
{
...
...
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