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
bbaced6d
Unverified
Commit
bbaced6d
authored
Feb 24, 2021
by
Jonah Williams
Committed by
GitHub
Feb 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] cache adb path (#76650)
parent
ed70d190
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
android_sdk.dart
packages/flutter_tools/lib/src/android/android_sdk.dart
+2
-1
android_sdk_test.dart
...er_tools/test/general.shard/android/android_sdk_test.dart
+21
-0
No files found.
packages/flutter_tools/lib/src/android/android_sdk.dart
View file @
bbaced6d
...
...
@@ -167,7 +167,8 @@ class AndroidSdk {
AndroidSdkVersion
get
latestVersion
=>
_latestVersion
;
String
get
adbPath
=>
getPlatformToolsPath
(
globals
.
platform
.
isWindows
?
'adb.exe'
:
'adb'
);
String
get
adbPath
=>
_adbPath
??=
getPlatformToolsPath
(
globals
.
platform
.
isWindows
?
'adb.exe'
:
'adb'
);
String
_adbPath
;
String
get
emulatorPath
=>
getEmulatorPath
();
...
...
packages/flutter_tools/test/general.shard/android/android_sdk_test.dart
View file @
bbaced6d
...
...
@@ -83,6 +83,27 @@ void main() {
Config:
()
=>
config
,
});
testUsingContext
(
'Caches adb location after first access'
,
()
{
sdkDir
=
MockAndroidSdk
.
createSdkDirectory
();
config
.
setValue
(
'android-sdk'
,
sdkDir
.
path
);
final
AndroidSdk
sdk
=
AndroidSdk
.
locateAndroidSdk
();
final
File
adbFile
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
sdk
.
directory
.
path
,
'cmdline-tools'
,
'adb.exe'
)
)..
createSync
(
recursive:
true
);
expect
(
sdk
.
adbPath
,
fileSystem
.
path
.
join
(
sdk
.
directory
.
path
,
'cmdline-tools'
,
'adb.exe'
));
adbFile
.
deleteSync
(
recursive:
true
);
expect
(
sdk
.
adbPath
,
fileSystem
.
path
.
join
(
sdk
.
directory
.
path
,
'cmdline-tools'
,
'adb.exe'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
Platform:
()
=>
FakePlatform
(
operatingSystem:
'windows'
),
Config:
()
=>
config
,
});
testUsingContext
(
'returns sdkmanager.bat path under cmdline tools for windows'
,
()
{
sdkDir
=
MockAndroidSdk
.
createSdkDirectory
();
config
.
setValue
(
'android-sdk'
,
sdkDir
.
path
);
...
...
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