This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flutter_plugin_tools] Add a command to lint Android code (#4206)
Adds a new `lint-android` command to run `gradlew lint` on Android plugins. Also standardizes the names of the Cirrus tasks that run all the build and platform-specific (i.e., not Dart unit test) tests for each platform, as they were getting unnecessarily long and complex in some cases. Fixes flutter/flutter#87071
- Loading branch information
1 parent
90fd90e
commit af2896b
Showing
60 changed files
with
1,306 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
## NEXT | ||
|
||
* Remove support for the V1 Android embedding. | ||
* Updated Android lint settings. | ||
|
||
## 2.0.2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<issues format="5" by="lint 3.3.0" client="gradle" variant="debug" version="3.3.0"> | ||
|
||
<issue | ||
id="LongLogTag" | ||
message="The logging tag can be at most 23 characters, was 25 (AndroidAlarmManagerPlugin)" | ||
errorLine1=" Log.i(TAG, "onAttachedToEngine");" | ||
errorLine2=" ~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java" | ||
line="75" | ||
column="13"/> | ||
</issue> | ||
|
||
<issue | ||
id="LongLogTag" | ||
message="The logging tag can be at most 23 characters, was 25 (AndroidAlarmManagerPlugin)" | ||
errorLine1=" Log.i(TAG, "onDetachedFromEngine");" | ||
errorLine2=" ~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java" | ||
line="96" | ||
column="11"/> | ||
</issue> | ||
|
||
<issue | ||
id="LongLogTag" | ||
message="The logging tag can be at most 23 characters, was 25 (FlutterBackgroundExecutor)" | ||
errorLine1=" Log.e(TAG, "Background isolate already started");" | ||
errorLine2=" ~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/androidalarmmanager/FlutterBackgroundExecutor.java" | ||
line="130" | ||
column="13"/> | ||
</issue> | ||
|
||
<issue | ||
id="LongLogTag" | ||
message="The logging tag can be at most 23 characters, was 25 (FlutterBackgroundExecutor)" | ||
errorLine1=" Log.i(TAG, "Starting AlarmService...");" | ||
errorLine2=" ~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/androidalarmmanager/FlutterBackgroundExecutor.java" | ||
line="134" | ||
column="11"/> | ||
</issue> | ||
|
||
<issue | ||
id="StaticFieldLeak" | ||
message="Do not place Android context classes in static fields (static reference to `AndroidAlarmManagerPlugin` which has field `context` pointing to `Context`); this is a memory leak (and also breaks Instant Run)" | ||
errorLine1=" private static AndroidAlarmManagerPlugin instance;" | ||
errorLine2=" ~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/androidalarmmanager/AndroidAlarmManagerPlugin.java" | ||
line="43" | ||
column="11"/> | ||
</issue> | ||
|
||
</issues> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
## NEXT | ||
|
||
* Remove references to the V1 Android embedding. | ||
* Updated Android lint settings. | ||
|
||
## 2.0.2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ android { | |
} | ||
lintOptions { | ||
disable 'InvalidPackage' | ||
disable 'GradleDependency' | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
## NEXT | ||
|
||
* Remove references to the Android v1 embedding. | ||
* Updated Android lint settings. | ||
|
||
## 2.0.3 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ android { | |
} | ||
lintOptions { | ||
disable 'InvalidPackage' | ||
disable 'GradleDependency' | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<issues format="5" by="lint 3.5.0" client="gradle" variant="debug" version="3.5.0"> | ||
|
||
<issue | ||
id="Assert" | ||
message="Assertions are unreliable in Dalvik and unimplemented in ART. Use `BuildConfig.DEBUG` conditional checks instead." | ||
errorLine1=" assert (boundaries.getWidth() > 0 && boundaries.getHeight() > 0);" | ||
errorLine2=" ~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/camera/CameraRegionUtils.java" | ||
line="73" | ||
column="5"/> | ||
</issue> | ||
|
||
<issue | ||
id="Assert" | ||
message="Assertions are unreliable in Dalvik and unimplemented in ART. Use `BuildConfig.DEBUG` conditional checks instead." | ||
errorLine1=" assert (x >= 0 && x <= 1);" | ||
errorLine2=" ~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/camera/CameraRegionUtils.java" | ||
line="74" | ||
column="5"/> | ||
</issue> | ||
|
||
<issue | ||
id="Assert" | ||
message="Assertions are unreliable in Dalvik and unimplemented in ART. Use `BuildConfig.DEBUG` conditional checks instead." | ||
errorLine1=" assert (y >= 0 && y <= 1);" | ||
errorLine2=" ~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/camera/CameraRegionUtils.java" | ||
line="75" | ||
column="5"/> | ||
</issue> | ||
|
||
<issue | ||
id="Assert" | ||
message="Assertions are unreliable in Dalvik and unimplemented in ART. Use `BuildConfig.DEBUG` conditional checks instead." | ||
errorLine1=" assert (maxBoundaries == null || maxBoundaries.getWidth() > 0);" | ||
errorLine2=" ~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/camera/CameraRegions.java" | ||
line="16" | ||
column="5"/> | ||
</issue> | ||
|
||
<issue | ||
id="Assert" | ||
message="Assertions are unreliable in Dalvik and unimplemented in ART. Use `BuildConfig.DEBUG` conditional checks instead." | ||
errorLine1=" assert (maxBoundaries == null || maxBoundaries.getHeight() > 0);" | ||
errorLine2=" ~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/camera/CameraRegions.java" | ||
line="17" | ||
column="5"/> | ||
</issue> | ||
|
||
<issue | ||
id="Assert" | ||
message="Assertions are unreliable in Dalvik and unimplemented in ART. Use `BuildConfig.DEBUG` conditional checks instead." | ||
errorLine1=" assert (x >= 0 && x <= 1);" | ||
errorLine2=" ~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/camera/CameraRegions.java" | ||
line="50" | ||
column="5"/> | ||
</issue> | ||
|
||
<issue | ||
id="Assert" | ||
message="Assertions are unreliable in Dalvik and unimplemented in ART. Use `BuildConfig.DEBUG` conditional checks instead." | ||
errorLine1=" assert (y >= 0 && y <= 1);" | ||
errorLine2=" ~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/camera/CameraRegions.java" | ||
line="51" | ||
column="5"/> | ||
</issue> | ||
|
||
<issue | ||
id="SwitchIntDef" | ||
message="Switch statement on an `int` with known associated constant missing case `Configuration.ORIENTATION_SQUARE`, `Configuration.ORIENTATION_UNDEFINED`" | ||
errorLine1=" switch (orientation) {" | ||
errorLine2=" ~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/camera/DeviceOrientationManager.java" | ||
line="143" | ||
column="5"/> | ||
</issue> | ||
|
||
<issue | ||
id="SwitchIntDef" | ||
message="Switch statement on an `int` with known associated constant missing case `Configuration.ORIENTATION_SQUARE`, `Configuration.ORIENTATION_UNDEFINED`" | ||
errorLine1=" switch (orientation) {" | ||
errorLine2=" ~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/camera/features/sensororientation/DeviceOrientationManager.java" | ||
line="264" | ||
column="5"/> | ||
</issue> | ||
|
||
<issue | ||
id="ObsoleteSdkInt" | ||
message="Unnecessary; SDK_INT is never < 21" | ||
errorLine1=" if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {" | ||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> | ||
<location | ||
file="src/main/java/io/flutter/plugins/camera/CameraPlugin.java" | ||
line="102" | ||
column="9"/> | ||
</issue> | ||
|
||
</issues> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
## NEXT | ||
|
||
* Remove references to the Android V1 embedding. | ||
* Updated Android lint settings. | ||
|
||
## 3.0.6 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ android { | |
} | ||
lintOptions { | ||
disable 'InvalidPackage' | ||
disable 'GradleDependency' | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
## NEXT | ||
|
||
* Remove references to the Android V1 embedding. | ||
* Updated Android lint settings. | ||
|
||
## 2.0.2 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ android { | |
} | ||
lintOptions { | ||
disable 'InvalidPackage' | ||
disable 'GradleDependency' | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## NEXT | ||
|
||
* Updated Android lint settings. | ||
|
||
## 0.1.0+3 | ||
|
||
* Remove references to the Android v1 embedding. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.