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
b0ad6072
Unverified
Commit
b0ad6072
authored
Nov 07, 2019
by
Emmanuel Garcia
Committed by
GitHub
Nov 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't print how to consume AARs when building plugins as AARs (#44301)
parent
9492dcc7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
6 deletions
+73
-6
android_builder.dart
packages/flutter_tools/lib/src/android/android_builder.dart
+1
-0
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+15
-5
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+57
-1
No files found.
packages/flutter_tools/lib/src/android/android_builder.dart
View file @
b0ad6072
...
...
@@ -70,6 +70,7 @@ class _AndroidBuilderImpl extends AndroidBuilder {
androidBuildInfo:
androidBuildInfo
,
target:
target
,
outputDir:
outputDirectory
,
printHowToConsumeAaar:
true
,
);
}
finally
{
androidSdk
.
reinitialize
();
...
...
packages/flutter_tools/lib/src/android/gradle.dart
View file @
b0ad6072
...
...
@@ -472,7 +472,14 @@ Future<void> buildGradleAar({
@required
AndroidBuildInfo
androidBuildInfo
,
@required
String
target
,
@required
Directory
outputDir
,
@required
bool
printHowToConsumeAaar
,
})
async
{
assert
(
project
!=
null
);
assert
(
androidBuildInfo
!=
null
);
assert
(
target
!=
null
);
assert
(
outputDir
!=
null
);
assert
(
printHowToConsumeAaar
!=
null
);
if
(
androidSdk
==
null
)
{
exitWithNoSdkMessage
();
}
...
...
@@ -564,11 +571,13 @@ Future<void> buildGradleAar({
'
$successMark
Built
${fs.path.relative(repoDirectory.path)}
.'
,
color:
TerminalColor
.
green
,
);
_printHowToConsumeAar
(
buildMode:
androidBuildInfo
.
buildInfo
.
modeName
,
androidPackage:
project
.
manifest
.
androidPackage
,
repoPath:
repoDirectory
.
path
,
);
if
(
printHowToConsumeAaar
)
{
_printHowToConsumeAar
(
buildMode:
androidBuildInfo
.
buildInfo
.
modeName
,
androidPackage:
project
.
manifest
.
androidPackage
,
repoPath:
repoDirectory
.
path
,
);
}
}
/// Prints how to consume the AAR from a host app.
...
...
@@ -688,6 +697,7 @@ Future<void> buildPluginsAsAar(
),
target:
''
,
outputDir:
buildDirectory
,
printHowToConsumeAaar:
false
,
);
}
on
ToolExit
{
// Log the entire plugin entry in `.flutter-plugins` since it
...
...
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
b0ad6072
...
...
@@ -1501,7 +1501,7 @@ plugin2=${plugin2.path}
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'indicates how to consume an AAR'
,
()
async
{
testUsingContext
(
'indicates how to consume an AAR
when printHowToConsumeAaar is true
'
,
()
async
{
final
File
manifestFile
=
fs
.
file
(
'pubspec.yaml'
);
manifestFile
.
createSync
(
recursive:
true
);
manifestFile
.
writeAsStringSync
(
'''
...
...
@@ -1533,6 +1533,7 @@ plugin2=${plugin2.path}
project:
FlutterProject
.
current
(),
outputDir:
fs
.
directory
(
'build/'
),
target:
''
,
printHowToConsumeAaar:
true
,
);
final
BufferLogger
logger
=
context
.
get
<
Logger
>();
...
...
@@ -1573,6 +1574,60 @@ To learn more, visit https://flutter.dev/go/build-aar'''));
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'doesn
\'
t indicate how to consume an AAR when printHowToConsumeAaar is false'
,
()
async
{
final
File
manifestFile
=
fs
.
file
(
'pubspec.yaml'
);
manifestFile
.
createSync
(
recursive:
true
);
manifestFile
.
writeAsStringSync
(
'''
flutter:
module:
androidPackage: com.example.test
'''
);
fs
.
file
(
'.android/gradlew'
).
createSync
(
recursive:
true
);
fs
.
file
(
'.android/gradle.properties'
)
.
writeAsStringSync
(
'irrelevant'
);
fs
.
file
(
'.android/build.gradle'
)
.
createSync
(
recursive:
true
);
// Let any process start. Assert after.
when
(
mockProcessManager
.
run
(
any
,
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
((
_
)
async
=>
ProcessResult
(
1
,
0
,
''
,
''
));
fs
.
directory
(
'build/outputs/repo'
).
createSync
(
recursive:
true
);
await
buildGradleAar
(
androidBuildInfo:
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
null
)),
project:
FlutterProject
.
current
(),
outputDir:
fs
.
directory
(
'build/'
),
target:
''
,
printHowToConsumeAaar:
false
,
);
final
BufferLogger
logger
=
context
.
get
<
Logger
>();
expect
(
logger
.
statusText
,
contains
(
'Built build/outputs/repo'
),
);
expect
(
logger
.
statusText
.
contains
(
'Consuming the Module'
),
isFalse
,
);
},
overrides:
<
Type
,
Generator
>{
AndroidSdk:
()
=>
mockAndroidSdk
,
AndroidStudio:
()
=>
mockAndroidStudio
,
Cache:
()
=>
cache
,
Platform:
()
=>
android
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'build apk uses selected local engine'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
platform:
TargetPlatform
.
android_arm
,
mode:
anyNamed
(
'mode'
))).
thenReturn
(
'engine'
);
...
...
@@ -1715,6 +1770,7 @@ To learn more, visit https://flutter.dev/go/build-aar'''));
project:
FlutterProject
.
current
(),
outputDir:
fs
.
directory
(
'build/'
),
target:
''
,
printHowToConsumeAaar:
false
,
);
final
List
<
String
>
actualGradlewCall
=
verify
(
...
...
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