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
762c92ea
Unverified
Commit
762c92ea
authored
Jul 29, 2022
by
Gary Qian
Committed by
GitHub
Jul 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove doc for --ignore-deprecation and check for pubspec before v1 embedding check (#108523)
parent
7cfbdadc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
11 deletions
+23
-11
project.dart
packages/flutter_tools/lib/src/project.dart
+3
-6
project_test.dart
packages/flutter_tools/test/general.shard/project_test.dart
+20
-5
No files found.
packages/flutter_tools/lib/src/project.dart
View file @
762c92ea
...
...
@@ -377,7 +377,7 @@ class FlutterProject {
}
void
checkForDeprecation
({
DeprecationBehavior
deprecationBehavior
=
DeprecationBehavior
.
none
})
{
if
(
android
.
existsSync
())
{
if
(
android
.
existsSync
()
&&
pubspecFile
.
existsSync
()
)
{
android
.
checkForDeprecation
(
deprecationBehavior:
deprecationBehavior
);
}
}
...
...
@@ -599,14 +599,11 @@ class AndroidProject extends FlutterProjectPlatform {
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2.
Follow th
e
steps at
embedding. It is being deprecated in favor of Android embedding v2.
To migrat
e
your project, follow the steps at:
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:
...
...
packages/flutter_tools/test/general.shard/project_test.dart
View file @
762c92ea
...
...
@@ -191,7 +191,7 @@ void main() {
_testInMemory
(
'checkForDeprecation fails on invalid android app manifest file'
,
()
async
{
// This is not a valid Xml document
const
String
invalidManifest
=
'<manifest></application>'
;
final
FlutterProject
project
=
await
someProject
(
androidManifestOverride:
invalidManifest
);
final
FlutterProject
project
=
await
someProject
(
androidManifestOverride:
invalidManifest
,
includePubspec:
true
);
expect
(
()
=>
project
.
checkForDeprecation
(
deprecationBehavior:
DeprecationBehavior
.
ignore
),
...
...
@@ -199,7 +199,7 @@ void main() {
);
});
_testInMemory
(
'Android project not on v2 embedding shows a warning'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
(
includePubspec:
true
);
// The default someProject with an empty <manifest> already indicates
// v1 embedding, as opposed to having <meta-data
// android:name="flutterEmbedding" android:value="2" />.
...
...
@@ -208,7 +208,7 @@ void main() {
expect
(
testLogger
.
statusText
,
contains
(
'https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects'
));
});
_testInMemory
(
'Android project not on v2 embedding exits'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
(
includePubspec:
true
);
// The default someProject with an empty <manifest> already indicates
// v1 embedding, as opposed to having <meta-data
// android:name="flutterEmbedding" android:value="2" />.
...
...
@@ -221,7 +221,7 @@ void main() {
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
();
final
FlutterProject
project
=
await
someProject
(
includePubspec:
true
);
// The default someProject with an empty <manifest> already indicates
// v1 embedding, as opposed to having <meta-data
// android:name="flutterEmbedding" android:value="2" />.
...
...
@@ -230,7 +230,7 @@ void main() {
expect
(
testLogger
.
statusText
,
isEmpty
);
});
_testInMemory
(
'Android project not on v2 embedding ignore continues'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
(
includePubspec:
true
);
// The default someProject with an empty <manifest> already indicates
// v1 embedding, as opposed to having <meta-data
// android:name="flutterEmbedding" android:value="2" />.
...
...
@@ -238,6 +238,15 @@ void main() {
project
.
checkForDeprecation
(
deprecationBehavior:
DeprecationBehavior
.
ignore
);
expect
(
testLogger
.
statusText
,
contains
(
'https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects'
));
});
_testInMemory
(
'Android project no pubspec continues'
,
()
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
.
ignore
);
expect
(
testLogger
.
statusText
,
isNot
(
contains
(
'https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects'
)));
});
_testInMemory
(
'Android plugin project does not throw v1 embedding deprecation warning'
,
()
async
{
final
FlutterProject
project
=
await
aPluginProject
();
...
...
@@ -781,12 +790,18 @@ apply plugin: 'kotlin-android'
Future
<
FlutterProject
>
someProject
({
String
androidManifestOverride
,
bool
includePubspec
=
false
,
})
async
{
final
Directory
directory
=
globals
.
fs
.
directory
(
'some_project'
);
directory
.
childDirectory
(
'.dart_tool'
)
.
childFile
(
'package_config.json'
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'{"configVersion":2,"packages":[]}'
);
if
(
includePubspec
)
{
directory
.
childFile
(
'pubspec.yaml'
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
validPubspec
);
}
directory
.
childDirectory
(
'ios'
).
createSync
(
recursive:
true
);
final
Directory
androidDirectory
=
directory
.
childDirectory
(
'android'
)
...
...
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