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
555721de
Unverified
Commit
555721de
authored
Feb 18, 2021
by
Jonah Williams
Committed by
GitHub
Feb 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] remove mock process manager from gradle tests (#76252)
parent
00630d09
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
484 additions
and
403 deletions
+484
-403
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+57
-41
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+1
-1
context_runner.dart
packages/flutter_tools/lib/src/context_runner.dart
+2
-0
android_gradle_builder_test.dart
...st/general.shard/android/android_gradle_builder_test.dart
+408
-345
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+16
-16
No files found.
packages/flutter_tools/lib/src/android/gradle.dart
View file @
555721de
This diff is collapsed.
Click to expand it.
packages/flutter_tools/lib/src/application_package.dart
View file @
555721de
...
...
@@ -65,7 +65,7 @@ class ApplicationPackageFactory {
case
TargetPlatform
.
android_x64
:
case
TargetPlatform
.
android_x86
:
if
(
_androidSdk
?.
licensesAvailable
==
true
&&
_androidSdk
?.
latestVersion
==
null
)
{
await
checkGradleDependencies
(
_logger
);
await
checkGradleDependencies
(
_logger
,
_processUtils
);
}
if
(
applicationBinary
==
null
)
{
return
await
AndroidApk
.
fromAndroidProject
(
...
...
packages/flutter_tools/lib/src/context_runner.dart
View file @
555721de
...
...
@@ -81,6 +81,8 @@ Future<T> runInContext<T>(
fallbacks:
<
Type
,
Generator
>{
AndroidBuilder:
()
=>
AndroidGradleBuilder
(
logger:
globals
.
logger
,
processManager:
globals
.
processManager
,
fileSystem:
globals
.
fs
,
),
AndroidLicenseValidator:
()
=>
AndroidLicenseValidator
(
operatingSystemUtils:
globals
.
os
,
...
...
packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dart
View file @
555721de
This diff is collapsed.
Click to expand it.
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
555721de
...
...
@@ -436,9 +436,11 @@ void main() {
group
(
'Config files'
,
()
{
Directory
tempDir
;
FileSystem
fileSystem
;
setUp
(()
{
tempDir
=
globals
.
fs
.
systemTempDirectory
.
createTempSync
(
'flutter_settings_aar_test.'
);
fileSystem
=
MemoryFileSystem
.
test
();
tempDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'flutter_settings_aar_test.'
);
});
testUsingContext
(
'create settings_aar.gradle when current settings.gradle loads plugins'
,
()
{
...
...
@@ -468,25 +470,24 @@ include ':app'
tempDir
.
childFile
(
'settings.gradle'
).
writeAsStringSync
(
currentSettingsGradle
);
final
String
toolGradlePath
=
globals
.
fs
.
path
.
join
(
globals
.
fs
.
path
.
absolute
(
Cache
.
flutterRoot
),
final
String
toolGradlePath
=
fileSystem
.
path
.
join
(
fileSystem
.
path
.
absolute
(
Cache
.
flutterRoot
),
'packages'
,
'flutter_tools'
,
'gradle'
);
globals
.
fs
.
directory
(
toolGradlePath
).
createSync
(
recursive:
true
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
toolGradlePath
,
'settings.gradle.legacy_versions'
))
fileSystem
.
directory
(
toolGradlePath
).
createSync
(
recursive:
true
);
fileSystem
.
file
(
fileSystem
.
path
.
join
(
toolGradlePath
,
'settings.gradle.legacy_versions'
))
.
writeAsStringSync
(
currentSettingsGradle
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
toolGradlePath
,
'settings_aar.gradle.tmpl'
))
fileSystem
.
file
(
fileSystem
.
path
.
join
(
toolGradlePath
,
'settings_aar.gradle.tmpl'
))
.
writeAsStringSync
(
settingsAarFile
);
createSettingsAarGradle
(
tempDir
,
testLogger
);
expect
(
testLogger
.
statusText
,
contains
(
'created successfully'
));
expect
(
tempDir
.
childFile
(
'settings_aar.gradle'
).
existsSync
(),
isTrue
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
.
test
()
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
...
...
@@ -501,25 +502,24 @@ include ':app'
tempDir
.
childFile
(
'settings.gradle'
).
writeAsStringSync
(
currentSettingsGradle
);
final
String
toolGradlePath
=
globals
.
fs
.
path
.
join
(
globals
.
fs
.
path
.
absolute
(
Cache
.
flutterRoot
),
final
String
toolGradlePath
=
fileSystem
.
path
.
join
(
fileSystem
.
path
.
absolute
(
Cache
.
flutterRoot
),
'packages'
,
'flutter_tools'
,
'gradle'
);
globals
.
fs
.
directory
(
toolGradlePath
).
createSync
(
recursive:
true
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
toolGradlePath
,
'settings.gradle.legacy_versions'
))
fileSystem
.
directory
(
toolGradlePath
).
createSync
(
recursive:
true
);
fileSystem
.
file
(
fileSystem
.
path
.
join
(
toolGradlePath
,
'settings.gradle.legacy_versions'
))
.
writeAsStringSync
(
currentSettingsGradle
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
toolGradlePath
,
'settings_aar.gradle.tmpl'
))
fileSystem
.
file
(
fileSystem
.
path
.
join
(
toolGradlePath
,
'settings_aar.gradle.tmpl'
))
.
writeAsStringSync
(
settingsAarFile
);
createSettingsAarGradle
(
tempDir
,
testLogger
);
expect
(
testLogger
.
statusText
,
contains
(
'created successfully'
));
expect
(
tempDir
.
childFile
(
'settings_aar.gradle'
).
existsSync
(),
isTrue
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
.
test
()
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
...
...
@@ -860,7 +860,7 @@ flutter:
fakeProcessManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[]);
mockAndroidSdk
=
MockAndroidSdk
();
when
(
mockAndroidSdk
.
directory
).
thenReturn
(
fs
.
directory
(
'irrelevant'
));
builder
=
AndroidGradleBuilder
(
logger:
logger
);
builder
=
AndroidGradleBuilder
(
logger:
logger
,
processManager:
fakeProcessManager
,
fileSystem:
fs
);
});
testUsingContext
(
'calls gradle'
,
()
async
{
...
...
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