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
a467932d
Unverified
Commit
a467932d
authored
Dec 12, 2019
by
Emmanuel Garcia
Committed by
GitHub
Dec 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip plugins that don't have an android impl when building AARs (#46835)
parent
4944622b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
2 deletions
+80
-2
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+4
-0
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+76
-2
No files found.
packages/flutter_tools/lib/src/android/gradle.dart
View file @
a467932d
...
...
@@ -715,6 +715,10 @@ Future<void> buildPluginsAsAar(
assert
(
pluginDirectory
.
existsSync
());
final
String
pluginName
=
pluginParts
.
first
;
if
(!
pluginDirectory
.
childDirectory
(
'android'
).
existsSync
())
{
printTrace
(
'Skipping plugin
$pluginName
since it doesn
\'
t have an android directory'
);
continue
;
}
logger
.
printStatus
(
'Building plugin
$pluginName
...'
);
try
{
await
buildGradleAar
(
...
...
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
a467932d
...
...
@@ -896,6 +896,9 @@ flutter:
plugin:
androidPackage: irrelevant
'''
);
plugin1
.
childDirectory
(
'android'
).
createSync
();
final
Directory
plugin2
=
fs
.
directory
(
'plugin2.'
);
plugin2
..
createSync
()
...
...
@@ -907,6 +910,8 @@ flutter:
androidPackage: irrelevant
'''
);
plugin2
.
childDirectory
(
'android'
).
createSync
();
androidDirectory
.
childFile
(
'.flutter-plugins'
)
.
writeAsStringSync
(
'''
...
...
@@ -927,8 +932,13 @@ plugin2=${plugin2.path}
);
final
String
flutterRoot
=
fs
.
path
.
absolute
(
Cache
.
flutterRoot
);
final
String
initScript
=
fs
.
path
.
join
(
flutterRoot
,
'packages'
,
'flutter_tools'
,
'gradle'
,
'aar_init_script.gradle'
);
final
String
initScript
=
fs
.
path
.
join
(
flutterRoot
,
'packages'
,
'flutter_tools'
,
'gradle'
,
'aar_init_script.gradle'
,
);
verify
(
mockProcessManager
.
run
(
<
String
>[
'gradlew'
,
...
...
@@ -965,6 +975,70 @@ plugin2=${plugin2.path}
ProcessManager:
()
=>
mockProcessManager
,
GradleUtils:
()
=>
FakeGradleUtils
(),
});
testUsingContext
(
'skips plugin without an android directory'
,
()
async
{
final
Directory
androidDirectory
=
fs
.
directory
(
'android.'
);
androidDirectory
.
createSync
();
androidDirectory
.
childFile
(
'pubspec.yaml'
)
.
writeAsStringSync
(
'name: irrelevant'
);
final
Directory
plugin1
=
fs
.
directory
(
'plugin1.'
);
plugin1
..
createSync
()
..
childFile
(
'pubspec.yaml'
)
.
writeAsStringSync
(
'''
name: irrelevant
flutter:
plugin:
androidPackage: irrelevant
'''
);
androidDirectory
.
childFile
(
'.flutter-plugins'
)
.
writeAsStringSync
(
'''
plugin1=
${plugin1.path}
'''
);
final
Directory
buildDirectory
=
androidDirectory
.
childDirectory
(
'build'
);
buildDirectory
.
childDirectory
(
'outputs'
)
.
childDirectory
(
'repo'
)
.
createSync
(
recursive:
true
);
await
buildPluginsAsAar
(
FlutterProject
.
fromPath
(
androidDirectory
.
path
),
const
AndroidBuildInfo
(
BuildInfo
.
release
),
buildDirectory:
buildDirectory
,
);
final
String
flutterRoot
=
fs
.
path
.
absolute
(
Cache
.
flutterRoot
);
final
String
initScript
=
fs
.
path
.
join
(
flutterRoot
,
'packages'
,
'flutter_tools'
,
'gradle'
,
'aar_init_script.gradle'
,
);
verifyNever
(
mockProcessManager
.
run
(
<
String
>[
'gradlew'
,
'-I=
$initScript
'
,
'-Pflutter-root=
$flutterRoot
'
,
'-Poutput-dir=
${buildDirectory.path}
'
,
'-Pis-plugin=true'
,
'-Ptarget-platform=android-arm,android-arm64,android-x64'
,
'assembleAarRelease'
,
],
environment:
anyNamed
(
'environment'
),
workingDirectory:
plugin1
.
childDirectory
(
'android'
).
path
),
);
},
overrides:
<
Type
,
Generator
>{
AndroidSdk:
()
=>
mockAndroidSdk
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
mockProcessManager
,
GradleUtils:
()
=>
FakeGradleUtils
(),
});
});
group
(
'gradle build'
,
()
{
...
...
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