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
d4db7480
Unverified
Commit
d4db7480
authored
Jun 25, 2018
by
Mikkel Nygaard Ravn
Committed by
GitHub
Jun 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add2app devicelab test (#18795)
parent
75b737ff
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
176 additions
and
0 deletions
+176
-0
module_test.dart
dev/devicelab/bin/tasks/module_test.dart
+89
-0
manifest.yaml
dev/devicelab/manifest.yaml
+7
-0
README.md
dev/integration_tests/android_host_app/README.md
+8
-0
build.gradle
dev/integration_tests/android_host_app/app/build.gradle
+18
-0
AndroidManifest.xml
...n_tests/android_host_app/app/src/main/AndroidManifest.xml
+10
-0
MainActivity.java
...pp/app/src/main/java/io/flutter/add2app/MainActivity.java
+14
-0
build.gradle
dev/integration_tests/android_host_app/build.gradle
+20
-0
gradle.properties
dev/integration_tests/android_host_app/gradle.properties
+1
-0
gradle-wrapper.properties
...android_host_app/gradle/wrapper/gradle-wrapper.properties
+6
-0
settings.gradle
dev/integration_tests/android_host_app/settings.gradle
+3
-0
No files found.
dev/devicelab/bin/tasks/module_test.dart
0 → 100644
View file @
d4db7480
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:io'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:path/path.dart'
as
path
;
/// Tests that the Flutter module project template works and supports
/// adding Flutter to an existing Android app.
Future
<
Null
>
main
()
async
{
await
task
(()
async
{
section
(
'Create Flutter module project'
);
final
Directory
directory
=
await
Directory
.
systemTemp
.
createTemp
(
'module'
);
try
{
await
inDirectory
(
directory
,
()
async
{
await
flutter
(
'create'
,
options:
<
String
>[
'--org'
,
'io.flutter.devicelab'
,
'-t'
,
'module'
,
'hello'
],
);
});
section
(
'Build Android .aar'
);
await
inDirectory
(
new
Directory
(
path
.
join
(
directory
.
path
,
'hello'
,
'.android'
)),
()
async
{
await
exec
(
'./gradlew'
,
<
String
>[
'flutter:assembleDebug'
]);
});
final
bool
aarBuilt
=
exists
(
new
File
(
path
.
join
(
directory
.
path
,
'hello'
,
'build'
,
'android_gen'
,
'outputs'
,
'aar'
,
'flutter-debug.aar'
,
)));
if
(!
aarBuilt
)
{
return
new
TaskResult
.
failure
(
'Failed to build .aar'
);
}
section
(
'Add to Android app'
);
final
Directory
hostApp
=
new
Directory
(
path
.
join
(
directory
.
path
,
'hello_host_app'
));
mkdir
(
hostApp
);
recursiveCopy
(
new
Directory
(
path
.
join
(
flutterDirectory
.
path
,
'dev'
,
'integration_tests'
,
'android_host_app'
)),
hostApp
,
);
copy
(
new
File
(
path
.
join
(
directory
.
path
,
'hello'
,
'.android'
,
'gradlew'
)),
hostApp
,
);
copy
(
new
File
(
path
.
join
(
directory
.
path
,
'hello'
,
'.android'
,
'gradle'
,
'wrapper'
,
'gradle-wrapper.jar'
)),
new
Directory
(
path
.
join
(
hostApp
.
path
,
'gradle'
,
'wrapper'
)),
);
await
inDirectory
(
hostApp
,
()
async
{
await
exec
(
'chmod'
,
<
String
>[
'+x'
,
'gradlew'
]);
await
exec
(
'./gradlew'
,
<
String
>[
'app:assembleDebug'
]);
});
final
bool
appBuilt
=
exists
(
new
File
(
path
.
join
(
hostApp
.
path
,
'app'
,
'build'
,
'outputs'
,
'apk'
,
'debug'
,
'app-debug.apk'
,
)));
if
(!
appBuilt
)
{
return
new
TaskResult
.
failure
(
'Failed to build .apk'
);
}
return
new
TaskResult
.
success
(
null
);
}
catch
(
e
)
{
return
new
TaskResult
.
failure
(
e
.
toString
());
}
finally
{
rmTree
(
directory
);
}
});
}
dev/devicelab/manifest.yaml
View file @
d4db7480
...
...
@@ -261,6 +261,13 @@ tasks:
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
module_test
:
description
:
>
Checks that the module project template works and supports add2app on Android.
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
flaky
:
true
flutter_gallery_instrumentation_test
:
description
:
>
Same as flutter_gallery__transition_perf but uses Android instrumentation
...
...
dev/integration_tests/android_host_app/README.md
0 → 100644
View file @
d4db7480
# Android host app
Android host app for a Flutter module created using
```
$ flutter create -t module hello
```
and placed in a sibling folder to (a clone of) the host app.
Used by the
`module_test.dart`
device lab test.
dev/integration_tests/android_host_app/app/build.gradle
0 → 100644
View file @
d4db7480
apply
plugin:
'com.android.application'
android
{
compileSdkVersion
27
defaultConfig
{
applicationId
"io.flutter.add2app"
minSdkVersion
16
targetSdkVersion
27
versionCode
1
versionName
"1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
}
dependencies
{
implementation
project
(
':flutter'
)
implementation
'com.android.support:appcompat-v7:27.1.1'
}
dev/integration_tests/android_host_app/app/src/main/AndroidManifest.xml
0 → 100644
View file @
d4db7480
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"io.flutter.add2app"
>
<application
android:allowBackup=
"false"
tools:ignore=
"GoogleAppIndexingWarning,MissingApplicationIcon"
>
<activity
android:name=
".MainActivity"
/>
</application>
</manifest>
dev/integration_tests/android_host_app/app/src/main/java/io/flutter/add2app/MainActivity.java
0 → 100644
View file @
d4db7480
package
io
.
flutter
.
add2app
;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
io.flutter.facade.Flutter
;
public
class
MainActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
Flutter
.
createView
(
this
,
getLifecycle
(),
"route1"
));
}
}
dev/integration_tests/android_host_app/build.gradle
0 → 100644
View file @
d4db7480
buildscript
{
repositories
{
google
()
jcenter
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.1.3'
}
}
allprojects
{
repositories
{
google
()
jcenter
()
}
}
task
clean
(
type:
Delete
)
{
delete
rootProject
.
buildDir
}
dev/integration_tests/android_host_app/gradle.properties
0 → 100644
View file @
d4db7480
org.gradle.jvmargs
=
-Xmx1536m
dev/integration_tests/android_host_app/gradle/wrapper/gradle-wrapper.properties
0 → 100644
View file @
d4db7480
#Mon Jun 25 14:13:36 CEST 2018
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.4-all.zip
dev/integration_tests/android_host_app/settings.gradle
0 → 100644
View file @
d4db7480
include
':app'
setBinding
(
new
Binding
([
gradle:
this
]))
evaluate
(
new
File
(
settingsDir
.
parentFile
,
'hello/.android/include_flutter.groovy'
))
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