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
98e43bc6
Unverified
Commit
98e43bc6
authored
Apr 06, 2020
by
Jonah Williams
Committed by
GitHub
Apr 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] ensure the tool can find SDK manager on windows (#54133)
parent
727552e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
android_sdk.dart
packages/flutter_tools/lib/src/android/android_sdk.dart
+5
-1
android_sdk_test.dart
...er_tools/test/general.shard/android/android_sdk_test.dart
+20
-1
No files found.
packages/flutter_tools/lib/src/android/android_sdk.dart
View file @
98e43bc6
...
...
@@ -380,7 +380,11 @@ class AndroidSdk {
/// was marked as obsolete in 3.6.
String
get
sdkManagerPath
{
final
File
cmdlineTool
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
directory
,
'cmdline-tools'
,
'latest'
,
'bin'
,
'sdkmanager'
)
globals
.
fs
.
path
.
join
(
directory
,
'cmdline-tools'
,
'latest'
,
'bin'
,
globals
.
platform
.
isWindows
?
'sdkmanager.bat'
:
'sdkmanager'
),
);
if
(
cmdlineTool
.
existsSync
())
{
return
cmdlineTool
.
path
;
...
...
packages/flutter_tools/test/general.shard/android/android_sdk_test.dart
View file @
98e43bc6
...
...
@@ -8,6 +8,7 @@ import 'package:flutter_tools/src/base/file_system.dart';
import
'package:flutter_tools/src/base/io.dart'
show
ProcessResult
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:mockito/mockito.dart'
;
import
'package:platform/platform.dart'
;
import
'package:process/process.dart'
;
import
'../../src/common.dart'
;
...
...
@@ -59,7 +60,7 @@ void main() {
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'returns sdkmanager path under cmdline tools'
,
()
{
testUsingContext
(
'returns sdkmanager path under cmdline tools
on Linux/macOS
'
,
()
{
sdkDir
=
MockAndroidSdk
.
createSdkDirectory
();
globals
.
config
.
setValue
(
'android-sdk'
,
sdkDir
.
path
);
...
...
@@ -72,6 +73,24 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
});
testUsingContext
(
'returns sdkmanager.bat path under cmdline tools for windows'
,
()
{
sdkDir
=
MockAndroidSdk
.
createSdkDirectory
();
globals
.
config
.
setValue
(
'android-sdk'
,
sdkDir
.
path
);
final
AndroidSdk
sdk
=
AndroidSdk
.
locateAndroidSdk
();
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
sdk
.
directory
,
'cmdline-tools'
,
'latest'
,
'bin'
,
'sdkmanager.bat'
)
).
createSync
(
recursive:
true
);
expect
(
sdk
.
sdkManagerPath
,
globals
.
fs
.
path
.
join
(
sdk
.
directory
,
'cmdline-tools'
,
'latest'
,
'bin'
,
'sdkmanager.bat'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
Platform:
()
=>
FakePlatform
(
operatingSystem:
'windows'
),
});
testUsingContext
(
'returns sdkmanager path under tools if cmdline doesnt exist'
,
()
{
...
...
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