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
61dfbfe1
Unverified
Commit
61dfbfe1
authored
Nov 21, 2020
by
Emmanuel Garcia
Committed by
GitHub
Nov 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for Android plugin to load before configuring plugin dependency (#70970)
parent
7a3a29e7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
2 deletions
+95
-2
android_plugin_example_app_build_test.dart
...elab/bin/tasks/android_plugin_example_app_build_test.dart
+84
-0
manifest.yaml
dev/devicelab/manifest.yaml
+6
-0
flutter.gradle
packages/flutter_tools/gradle/flutter.gradle
+5
-2
No files found.
dev/devicelab/bin/tasks/android_plugin_example_app_build_test.dart
0 → 100644
View file @
61dfbfe1
// Copyright 2014 The Flutter 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:io'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/framework/task_result.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:path/path.dart'
as
path
;
final
String
gradlew
=
Platform
.
isWindows
?
'gradlew.bat'
:
'gradlew'
;
final
String
gradlewExecutable
=
Platform
.
isWindows
?
'.
\\
$gradlew
'
:
'./
$gradlew
'
;
/// Tests that a plugin example app can be built using the current Flutter Gradle plugin.
Future
<
void
>
main
()
async
{
await
task
(()
async
{
section
(
'Find Java'
);
final
String
javaHome
=
await
findJavaHome
();
if
(
javaHome
==
null
)
{
return
TaskResult
.
failure
(
'Could not find Java'
);
}
print
(
'
\n
Using JAVA_HOME=
$javaHome
'
);
section
(
'Create Flutter plugin project'
);
await
flutter
(
'precache'
,
options:
<
String
>[
'--android'
,
'--no-ios'
],
);
final
Directory
tempDir
=
Directory
.
systemTemp
.
createTempSync
(
'flutter_plugin_test.'
);
final
Directory
projectDir
=
Directory
(
path
.
join
(
tempDir
.
path
,
'plugin_test'
));
try
{
await
inDirectory
(
tempDir
,
()
async
{
await
flutter
(
'create'
,
options:
<
String
>[
'--template=plugin'
,
'--platforms=android'
,
'plugin_test'
],
);
});
final
Directory
exampleAppDir
=
Directory
(
path
.
join
(
projectDir
.
path
,
'example'
));
if
(!
exists
(
exampleAppDir
))
{
return
TaskResult
.
failure
(
'Example app directory doesn
\'
t exist'
);
}
section
(
'Run flutter build apk'
);
await
inDirectory
(
exampleAppDir
,
()
async
{
await
flutter
(
'build'
,
options:
<
String
>[
'apk'
,
'--target-platform=android-arm'
,
],
);
});
final
String
exampleApk
=
path
.
join
(
exampleAppDir
.
path
,
'build'
,
'app'
,
'outputs'
,
'flutter-apk'
,
'app-release.apk'
,
);
if
(!
exists
(
File
(
exampleApk
)))
{
return
TaskResult
.
failure
(
'Failed to build app-release.apk'
);
}
return
TaskResult
.
success
(
null
);
}
on
TaskResult
catch
(
taskResult
)
{
return
taskResult
;
}
catch
(
e
)
{
return
TaskResult
.
failure
(
e
.
toString
());
}
finally
{
rmTree
(
tempDir
);
}
});
}
dev/devicelab/manifest.yaml
View file @
61dfbfe1
...
...
@@ -314,6 +314,12 @@ tasks:
stage
:
devicelab
required_agent_capabilities
:
[
"
mac/android"
]
android_plugin_example_app_build_test
:
description
:
>
Tests that the plugin example app can be built using the Flutter Gradle plugin.
stage
:
devicelab
required_agent_capabilities
:
[
"
mac/android"
]
run_release_test
:
description
:
>
Checks that `flutter run --release` does not crash.
...
...
packages/flutter_tools/gradle/flutter.gradle
View file @
61dfbfe1
...
...
@@ -363,11 +363,14 @@ class FlutterPlugin implements Plugin<Project> {
!
doesSupportAndroidPlatform
(
dependencyProject
.
projectDir
.
parentFile
.
path
))
{
return
}
// Wait for the Android plugin to load and add the dependency to the plugin project.
pluginProject
.
afterEvaluate
{
pluginProject
.
dependencies
{
implementation
dependencyProject
}
}
}
}
private
Properties
getPluginList
()
{
File
pluginsFile
=
new
File
(
project
.
projectDir
.
parentFile
.
parentFile
,
'.flutter-plugins'
)
...
...
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