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
ff8203dc
Unverified
Commit
ff8203dc
authored
Dec 17, 2020
by
Jenn Magder
Committed by
GitHub
Dec 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate usage value plugin count off .flutter-plugins (#72538)
parent
9a9339fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
packages.dart
packages/flutter_tools/lib/src/commands/packages.dart
+4
-3
packages_test.dart
...er_tools/test/commands.shard/permeable/packages_test.dart
+26
-1
No files found.
packages/flutter_tools/lib/src/commands/packages.dart
View file @
ff8203dc
...
...
@@ -12,6 +12,7 @@ import '../cache.dart';
import
'../dart/generate_synthetic_packages.dart'
;
import
'../dart/pub.dart'
;
import
'../globals.dart'
as
globals
;
import
'../plugins.dart'
;
import
'../project.dart'
;
import
'../reporting/reporting.dart'
;
import
'../runner/flutter_command.dart'
;
...
...
@@ -79,10 +80,10 @@ class PackagesGetCommand extends FlutterCommand {
return
usageValues
;
}
final
FlutterProject
rootProject
=
FlutterProject
.
fromPath
(
target
);
final
bool
hasPlugins
=
rootProject
.
flutterPluginsFile
.
existsSync
();
final
bool
hasPlugins
=
rootProject
.
flutterPlugins
Dependencies
File
.
existsSync
();
if
(
hasPlugins
)
{
final
int
numberOfPlugins
=
(
rootProject
.
flutterPluginsFile
.
readAsLinesSync
()).
length
;
usageValues
[
CustomDimensions
.
commandPackagesNumberPlugins
]
=
'
$numberOfPlugins
'
;
final
List
<
Plugin
>
plugins
=
await
findPlugins
(
rootProject
)
;
usageValues
[
CustomDimensions
.
commandPackagesNumberPlugins
]
=
plugins
.
length
.
toString
()
;
}
else
{
usageValues
[
CustomDimensions
.
commandPackagesNumberPlugins
]
=
'0'
;
}
...
...
packages/flutter_tools/test/commands.shard/permeable/packages_test.dart
View file @
ff8203dc
...
...
@@ -227,7 +227,7 @@ void main() {
),
});
testUsingContext
(
'set
the number of
plugins as usage value'
,
()
async
{
testUsingContext
(
'set
no
plugins as usage value'
,
()
async
{
final
String
projectPath
=
await
createProject
(
tempDir
,
arguments:
<
String
>[
'--no-pub'
,
'--template=module'
]);
removeGeneratedFiles
(
projectPath
);
...
...
@@ -248,6 +248,31 @@ void main() {
),
});
testUsingContext
(
'set the number of plugins as usage value'
,
()
async
{
final
String
projectPath
=
await
createProject
(
tempDir
,
arguments:
<
String
>[
'--template=plugin'
,
'--no-pub'
,
'--platforms=ios,android,macos,windows'
],
);
final
String
exampleProjectPath
=
globals
.
fs
.
path
.
join
(
projectPath
,
'example'
);
final
PackagesCommand
command
=
await
runCommandIn
(
exampleProjectPath
,
'get'
);
final
PackagesGetCommand
getCommand
=
command
.
subcommands
[
'get'
]
as
PackagesGetCommand
;
// Should be 1 instead of 2, but integration_test is always included.
// https://github.com/flutter/flutter/issues/56591
expect
(
await
getCommand
.
usageValues
,
containsPair
(
CustomDimensions
.
commandPackagesNumberPlugins
,
'2'
));
},
overrides:
<
Type
,
Generator
>{
Pub:
()
=>
Pub
(
fileSystem:
globals
.
fs
,
logger:
globals
.
logger
,
processManager:
globals
.
processManager
,
usage:
globals
.
flutterUsage
,
botDetector:
globals
.
botDetector
,
platform:
globals
.
platform
,
),
});
testUsingContext
(
'indicate that the project is not a module in usage value'
,
()
async
{
final
String
projectPath
=
await
createProject
(
tempDir
,
arguments:
<
String
>[
'--no-pub'
]);
...
...
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