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
0287449c
Unverified
Commit
0287449c
authored
Jan 05, 2022
by
Jenn Magder
Committed by
GitHub
Jan 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not show v1 Android embedding message for non-Android commands (#96148)
parent
500a3324
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
18 deletions
+28
-18
project.dart
packages/flutter_tools/lib/src/project.dart
+18
-17
project_test.dart
packages/flutter_tools/test/general.shard/project_test.dart
+10
-1
No files found.
packages/flutter_tools/lib/src/project.dart
View file @
0287449c
...
...
@@ -552,9 +552,16 @@ class AndroidProject extends FlutterProjectPlatform {
}
void
checkForDeprecation
({
DeprecationBehavior
deprecationBehavior
=
DeprecationBehavior
.
none
})
{
if
(
deprecationBehavior
==
DeprecationBehavior
.
none
)
{
return
;
}
final
AndroidEmbeddingVersionResult
result
=
computeEmbeddingVersion
();
if
(
result
.
version
==
AndroidEmbeddingVersion
.
v1
)
{
globals
.
printStatus
(
if
(
result
.
version
!=
AndroidEmbeddingVersion
.
v1
)
{
return
;
}
globals
.
printStatus
(
'''
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
...
...
@@ -573,21 +580,15 @@ The detected reason was:
${result.reason}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
'''
);
switch
(
deprecationBehavior
)
{
case
DeprecationBehavior
.
none
:
break
;
case
DeprecationBehavior
.
ignore
:
BuildEvent
(
'deprecated-v1-android-embedding-ignored'
,
type:
'gradle'
,
flutterUsage:
globals
.
flutterUsage
).
send
();
break
;
case
DeprecationBehavior
.
exit
:
BuildEvent
(
'deprecated-v1-android-embedding-failed'
,
type:
'gradle'
,
flutterUsage:
globals
.
flutterUsage
).
send
();
throwToolExit
(
'Build failed due to use of deprecated Android v1 embedding.'
,
exitCode:
1
,
);
}
'''
);
if
(
deprecationBehavior
==
DeprecationBehavior
.
ignore
)
{
BuildEvent
(
'deprecated-v1-android-embedding-ignored'
,
type:
'gradle'
,
flutterUsage:
globals
.
flutterUsage
).
send
();
}
else
{
// DeprecationBehavior.exit
BuildEvent
(
'deprecated-v1-android-embedding-failed'
,
type:
'gradle'
,
flutterUsage:
globals
.
flutterUsage
).
send
();
throwToolExit
(
'Build failed due to use of deprecated Android v1 embedding.'
,
exitCode:
1
,
);
}
}
...
...
packages/flutter_tools/test/general.shard/project_test.dart
View file @
0287449c
...
...
@@ -182,7 +182,7 @@ void main() {
// v1 embedding, as opposed to having <meta-data
// android:name="flutterEmbedding" android:value="2" />.
project
.
checkForDeprecation
(
deprecationBehavior:
DeprecationBehavior
.
non
e
);
project
.
checkForDeprecation
(
deprecationBehavior:
DeprecationBehavior
.
ignor
e
);
expect
(
testLogger
.
statusText
,
contains
(
'https://flutter.dev/go/android-project-migration'
));
});
_testInMemory
(
'Android project not on v2 embedding exits'
,
()
async
{
...
...
@@ -198,6 +198,15 @@ void main() {
expect
(
testLogger
.
statusText
,
contains
(
'https://flutter.dev/go/android-project-migration'
));
expect
(
testLogger
.
statusText
,
contains
(
'No `<meta-data android:name="flutterEmbedding" android:value="2"/>` in '
));
});
_testInMemory
(
'Project not on v2 embedding does not warn if deprecation status is irrelevant'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
// The default someProject with an empty <manifest> already indicates
// v1 embedding, as opposed to having <meta-data
// android:name="flutterEmbedding" android:value="2" />.
project
.
checkForDeprecation
(
deprecationBehavior:
DeprecationBehavior
.
none
);
expect
(
testLogger
.
statusText
,
isEmpty
);
});
_testInMemory
(
'Android project not on v2 embedding ignore continues'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
// The default someProject with an empty <manifest> already indicates
...
...
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