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
93c87e92
Unverified
Commit
93c87e92
authored
May 14, 2021
by
Emmanuel Garcia
Committed by
GitHub
May 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tool] Suggest fix for transform input (#82309)
parent
b70f20b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
0 deletions
+74
-0
gradle_errors.dart
packages/flutter_tools/lib/src/android/gradle_errors.dart
+35
-0
gradle_errors_test.dart
..._tools/test/general.shard/android/gradle_errors_test.dart
+39
-0
No files found.
packages/flutter_tools/lib/src/android/gradle_errors.dart
View file @
93c87e92
...
...
@@ -74,6 +74,7 @@ final List<GradleHandledError> gradleErrors = <GradleHandledError>[
r8FailureHandler
,
androidXFailureHandler
,
minSdkVersion
,
transformInputIssue
,
];
// Permission defined error message.
...
...
@@ -394,3 +395,37 @@ final GradleHandledError minSdkVersion = GradleHandledError(
},
eventLabel:
'plugin-min-sdk'
,
);
/// Handler when https://issuetracker.google.com/issues/141126614 or
/// https://github.com/flutter/flutter/issues/58247 is triggered.
@visibleForTesting
final
GradleHandledError
transformInputIssue
=
GradleHandledError
(
test:
(
String
line
)
{
return
line
.
contains
(
'https://issuetracker.google.com/issues/158753935'
);
},
handler:
({
String
line
,
FlutterProject
project
,
bool
usesAndroidX
,
bool
shouldBuildPluginAsAar
,
})
async
{
final
File
gradleFile
=
project
.
directory
.
childDirectory
(
'android'
)
.
childDirectory
(
'app'
)
.
childFile
(
'build.gradle'
);
globals
.
printStatus
(
'
\n
This issue appears to be https://github.com/flutter/flutter/issues/58247.
\n
'
+
globals
.
logger
.
terminal
.
bolden
(
'Fix this issue by adding the following to the file
${gradleFile.path}
:
\n
'
'android {
\n
'
' lintOptions {
\n
'
' checkReleaseBuilds false
\n
'
' }
\n
'
'}'
)
);
return
GradleBuildStatus
.
exit
;
},
eventLabel:
'transform-input-issue'
,
);
packages/flutter_tools/test/general.shard/android/gradle_errors_test.dart
View file @
93c87e92
...
...
@@ -30,6 +30,7 @@ void main() {
r8FailureHandler
,
androidXFailureHandler
,
minSdkVersion
,
transformInputIssue
,
])
);
});
...
...
@@ -688,6 +689,44 @@ assembleProfile
ProcessManager:
()
=>
FakeProcessManager
.
empty
(),
});
});
// https://issuetracker.google.com/issues/141126614
group
(
'transform input issue'
,
()
{
testWithoutContext
(
'pattern'
,
()
{
expect
(
transformInputIssue
.
test
(
'https://issuetracker.google.com/issues/158753935'
),
isTrue
,
);
});
testUsingContext
(
'suggestion'
,
()
async
{
await
transformInputIssue
.
handler
(
project:
FlutterProject
.
fromDirectoryTest
(
globals
.
fs
.
currentDirectory
),
);
expect
(
testLogger
.
statusText
,
contains
(
'
\n
'
'This issue appears to be https://github.com/flutter/flutter/issues/58247.
\n
'
'Fix this issue by adding the following to the file /android/app/build.gradle:
\n
'
'android {
\n
'
' lintOptions {
\n
'
' checkReleaseBuilds false
\n
'
' }
\n
'
'}
\n
'
''
)
);
},
overrides:
<
Type
,
Generator
>{
GradleUtils:
()
=>
FakeGradleUtils
(),
Platform:
()
=>
fakePlatform
(
'android'
),
FileSystem:
()
=>
MemoryFileSystem
.
test
(),
ProcessManager:
()
=>
FakeProcessManager
.
empty
(),
});
});
}
bool
formatTestErrorMessage
(
String
errorMessage
,
GradleHandledError
error
)
{
...
...
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