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
2243c42e
Unverified
Commit
2243c42e
authored
Feb 26, 2020
by
Lynn
Committed by
GitHub
Feb 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flutter doctor (pluginsPath) check for Mac (#50324)
parent
9e744c57
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
134 additions
and
14 deletions
+134
-14
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+42
-14
doctor_test.dart
...utter_tools/test/commands.shard/hermetic/doctor_test.dart
+14
-0
Info.plist
...est/data/intellij/mac_not_via_toolbox/Contents/Info.plist
+38
-0
Info.plist
...ls/test/data/intellij/mac_via_toolbox/Contents/Info.plist
+40
-0
No files found.
packages/flutter_tools/lib/src/doctor.dart
View file @
2243c42e
...
...
@@ -4,6 +4,8 @@
import
'dart:async'
;
import
'package:meta/meta.dart'
;
import
'android/android_studio_validator.dart'
;
import
'android/android_workflow.dart'
;
import
'artifacts.dart'
;
...
...
@@ -699,18 +701,22 @@ abstract class IntelliJValidator extends DoctorValidator {
Future
<
ValidationResult
>
validate
()
async
{
final
List
<
ValidationMessage
>
messages
=
<
ValidationMessage
>[];
messages
.
add
(
ValidationMessage
(
userMessages
.
intellijLocation
(
installPath
)));
if
(
pluginsPath
==
null
)
{
messages
.
add
(
ValidationMessage
.
error
(
'Invalid IntelliJ version number.'
));
}
else
{
messages
.
add
(
ValidationMessage
(
userMessages
.
intellijLocation
(
installPath
)));
final
IntelliJPlugins
plugins
=
IntelliJPlugins
(
pluginsPath
);
plugins
.
validatePackage
(
messages
,
<
String
>[
'flutter-intellij'
,
'flutter-intellij.jar'
],
'Flutter'
,
minVersion:
IntelliJPlugins
.
kMinFlutterPluginVersion
);
plugins
.
validatePackage
(
messages
,
<
String
>[
'Dart'
],
'Dart'
);
final
IntelliJPlugins
plugins
=
IntelliJPlugins
(
pluginsPath
);
plugins
.
validatePackage
(
messages
,
<
String
>[
'flutter-intellij'
,
'flutter-intellij.jar'
],
'Flutter'
,
minVersion:
IntelliJPlugins
.
kMinFlutterPluginVersion
);
plugins
.
validatePackage
(
messages
,
<
String
>[
'Dart'
],
'Dart'
);
if
(
_hasIssues
(
messages
))
{
messages
.
add
(
ValidationMessage
(
userMessages
.
intellijPluginInfo
));
}
if
(
_hasIssues
(
messages
))
{
messages
.
add
(
ValidationMessage
(
userMessages
.
intellijPluginInfo
));
}
_validateIntelliJVersion
(
messages
,
kMinIdeaVersion
);
_validateIntelliJVersion
(
messages
,
kMinIdeaVersion
);
}
return
ValidationResult
(
_hasIssues
(
messages
)
?
ValidationType
.
partial
:
ValidationType
.
installed
,
...
...
@@ -847,31 +853,53 @@ class IntelliJValidatorOnMac extends IntelliJValidator {
return
validators
;
}
@visibleForTesting
String
get
plistFile
{
_plistFile
??=
globals
.
fs
.
path
.
join
(
installPath
,
'Contents'
,
'Info.plist'
);
return
_plistFile
;
}
String
_plistFile
;
@override
String
get
version
{
if
(
_version
==
null
)
{
final
String
plistFile
=
globals
.
fs
.
path
.
join
(
installPath
,
'Contents'
,
'Info.plist'
);
_version
=
PlistParser
.
instance
.
getValueFromFile
(
_version
??=
PlistParser
.
instance
.
getValueFromFile
(
plistFile
,
PlistParser
.
kCFBundleShortVersionStringKey
,
)
??
'unknown'
;
}
return
_version
;
}
String
_version
;
@override
String
get
pluginsPath
{
if
(
_pluginsPath
!=
null
)
{
return
_pluginsPath
;
}
final
String
altLocation
=
PlistParser
.
instance
.
getValueFromFile
(
plistFile
,
'JetBrainsToolboxApp'
);
if
(
altLocation
!=
null
)
{
_pluginsPath
=
altLocation
+
'.plugins'
;
return
_pluginsPath
;
}
final
List
<
String
>
split
=
version
.
split
(
'.'
);
if
(
split
.
length
<
2
)
{
return
null
;
}
final
String
major
=
split
[
0
];
final
String
minor
=
split
[
1
];
return
globals
.
fs
.
path
.
join
(
_pluginsPath
=
globals
.
fs
.
path
.
join
(
globals
.
fsUtils
.
homeDirPath
,
'Library'
,
'Application Support'
,
'
$id$major
.
$minor
'
,
);
return
_pluginsPath
;
}
String
_pluginsPath
;
}
class
DeviceValidator
extends
DoctorValidator
{
...
...
packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart
View file @
2243c42e
...
...
@@ -13,6 +13,7 @@ import 'package:flutter_tools/src/base/user_messages.dart';
import
'package:flutter_tools/src/doctor.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/ios/plist_parser.dart'
;
import
'package:flutter_tools/src/proxy_validator.dart'
;
import
'package:flutter_tools/src/reporting/reporting.dart'
;
import
'package:flutter_tools/src/vscode/vscode.dart'
;
...
...
@@ -67,6 +68,19 @@ void main() {
expect
(
message
.
message
,
contains
(
'recommended minimum version'
));
},
overrides:
noColorTerminalOverride
);
testUsingContext
(
'intellij plugins path checking on mac'
,
()
async
{
final
String
pathViaToolbox
=
globals
.
fs
.
path
.
join
(
'test'
,
'data'
,
'intellij'
,
'mac_via_toolbox'
);
final
String
pathNotViaToolbox
=
globals
.
fs
.
path
.
join
(
'test'
,
'data'
,
'intellij'
,
'mac_not_via_toolbox'
);
final
IntelliJValidatorOnMac
validatorViaToolbox
=
IntelliJValidatorOnMac
(
'Test'
,
'Test'
,
pathViaToolbox
);
expect
(
validatorViaToolbox
.
plistFile
,
'test/data/intellij/mac_via_toolbox/Contents/Info.plist'
);
final
IntelliJValidatorOnMac
validatorNotViaToolbox
=
IntelliJValidatorOnMac
(
'Test'
,
'Test'
,
pathNotViaToolbox
);
expect
(
validatorNotViaToolbox
.
plistFile
,
'test/data/intellij/mac_not_via_toolbox/Contents/Info.plist'
);
},
overrides:
<
Type
,
Generator
>{
PlistParser:
()
=>
const
PlistParser
(),
});
testUsingContext
(
'vs code validator when both installed'
,
()
async
{
final
ValidationResult
result
=
await
VsCodeValidatorTestTargets
.
installedWithExtension
.
validate
();
expect
(
result
.
type
,
ValidationType
.
installed
);
...
...
packages/flutter_tools/test/data/intellij/mac_not_via_toolbox/Contents/Info.plist
0 → 100644
View file @
2243c42e
<
?xml
v
e
rsion='
1
.
0
'
e
n
c
o
d
ing='UT
F
-
8
'?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
'-//
A
ppl
e C
omput
e
r//
D
T
D
PLIST
1
.
0
//
E
N'
'http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
'
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
English
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
jetbrains-toolbox-launcher
<
/string
>
<
k
e
y
>
CFBundleGetInfoString
<
/k
e
y
>
<
string/
>
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
NSHumanReadableCopyright
<
/k
e
y
>
<
string
>
Copyright
(
c
)
JetBrains
s.r.o.
<
/string
>
<
k
e
y
>
NSHighResolutionCapable
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
NSUIElement
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
LSUIElement
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
IntelliJ
IDEA
Ultimate
2019.3.3
<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
<
string
>
com.jetbrains.apps.activator.linkapp.pcom.jetbrains.apps.activator__ntelli_ltimate_2019_3_3
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
2019.3.3
<
/string
>
<
k
e
y
>
CFBundleLongVersionString
<
/k
e
y
>
<
string
>
2019.3.3
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
2019.3.3
<
/string
>
<
k
e
y
>
CFBundleIconFile
<
/k
e
y
>
<
string
>
icon.icns
<
/string
>
<
/
d
i
c
t
>
<
/plist
>
packages/flutter_tools/test/data/intellij/mac_via_toolbox/Contents/Info.plist
0 → 100644
View file @
2243c42e
<
?xml
v
e
rsion='
1
.
0
'
e
n
c
o
d
ing='UT
F
-
8
'?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
'-//
A
ppl
e C
omput
e
r//
D
T
D
PLIST
1
.
0
//
E
N'
'http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
'
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
English
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
jetbrains-toolbox-launcher
<
/string
>
<
k
e
y
>
CFBundleGetInfoString
<
/k
e
y
>
<
string/
>
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
NSHumanReadableCopyright
<
/k
e
y
>
<
string
>
Copyright
(
c
)
JetBrains
s.r.o.
<
/string
>
<
k
e
y
>
NSHighResolutionCapable
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
NSUIElement
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
LSUIElement
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
IntelliJ
IDEA
Ultimate
2019.3.3
<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
<
string
>
com.jetbrains.apps.activator.linkapp.pcom.jetbrains.apps.activator__ntelli_ltimate_2019_3_3
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
2019.3.3
<
/string
>
<
k
e
y
>
CFBundleLongVersionString
<
/k
e
y
>
<
string
>
2019.3.3
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
2019.3.3
<
/string
>
<
k
e
y
>
CFBundleIconFile
<
/k
e
y
>
<
string
>
icon.icns
<
/string
>
<
k
e
y
>
JetBrainsToolboxApp
<
/k
e
y
>
<
string
>
/Users/lynn/Library/Application
Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/193.6494.35/IntelliJ
IDEA.app
<
/string
>
<
/
d
i
c
t
>
<
/plist
>
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