Fix unused resources inspection not working in AS (#200)

* Fix unused resources inspection not working in AS

* Remove unused resources

* Update CI

* Fix CI

* Add baseline for lint

* Test CI
This commit is contained in:
FooIbar authored and GitHub committed 2023-11-06 22:18:56 +08:00
1 parent 26906f6709
commit 2d7b024293
22 files changed
+207 -134

No files matched your search

-3
View File
@@ -48,9 +48,6 @@ jobs:
- name: Spotless Check
run: ./gradlew spotlessCheck
- name: Lint Check
run: ./gradlew lintMarshmallowGmsRelease
- name: CMake Cache
uses: actions/cache@v3
with:
+3 -7
View File
@@ -109,10 +109,6 @@ android {
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
lint {
checkOnly += setOf("InlinedApi", "NewApi", "UnusedAttribute")
error += setOf("InlinedApi", "UnusedAttribute")
}
}
create("oss") {
dimension = "oss"
@@ -154,9 +150,9 @@ android {
}
lint {
abortOnError = true
checkReleaseBuilds = false
disable.add("MissingTranslation")
baseline = file("lint-baseline.xml")
disable += setOf("MissingTranslation", "MissingQuantity")
fatal += setOf("NewApi", "InlineApi")
}
packaging {
+202
View File
@@ -0,0 +1,202 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.3.0-alpha12" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.2)" variant="fatal" version="8.3.0-alpha12">
<issue
id="NewApi"
message="Field requires version 7 of the S Extensions SDK (current min is 0): `setConsumer`"
errorLine1=" consumer = {"
errorLine2=" ~~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/cronet/CronetExtensions.kt"
line="18"
column="13"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `android.net.http.UrlRequest#read`"
errorLine1=" request.read(buffer)"
errorLine2=" ~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/cronet/CronetExtensions.kt"
line="21"
column="25"/>
</issue>
<issue
id="NewApi"
message="Field requires version 7 of the S Extensions SDK (current min is 0): `getRequest`"
errorLine1=" request.read(buffer)"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/cronet/CronetExtensions.kt"
line="21"
column="17"/>
</issue>
<issue
id="NewApi"
message="Field requires version 7 of the S Extensions SDK (current min is 0): `getReaderCont`"
errorLine1=" onError = { readerCont.resumeWithException(it) }"
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/cronet/CronetExtensions.kt"
line="23"
column="25"/>
</issue>
<issue
id="NewApi"
message="Field requires version 7 of the S Extensions SDK (current min is 0): `setOnError`"
errorLine1=" onError = { readerCont.resumeWithException(it) }"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/cronet/CronetExtensions.kt"
line="23"
column="13"/>
</issue>
<issue
id="NewApi"
message="Field requires version 7 of the S Extensions SDK (current min is 0): `setReaderCont`"
errorLine1=" readerCont = cont"
errorLine2=" ~~~~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/cronet/CronetExtensions.kt"
line="24"
column="13"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `android.net.http.UrlRequest#read`"
errorLine1=" request.read(buffer)"
errorLine2=" ~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/cronet/CronetExtensions.kt"
line="25"
column="21"/>
</issue>
<issue
id="NewApi"
message="Field requires version 7 of the S Extensions SDK (current min is 0): `getRequest`"
errorLine1=" request.read(buffer)"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/cronet/CronetExtensions.kt"
line="25"
column="13"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `cronetRequest`"
errorLine1=" val success = cronetRequest(data) {"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/coil/CronetHttpUriFetcher.kt"
line="30"
column="27"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `noCache`"
errorLine1=" noCache()"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/coil/CronetHttpUriFetcher.kt"
line="31"
column="17"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `execute`"
errorLine1=" }.execute {"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/coil/CronetHttpUriFetcher.kt"
line="32"
column="15"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `cronetRequest`"
errorLine1=" cronetRequest(url, referer).execute {"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/client/EhEngine.kt"
line="123"
column="9"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `execute`"
errorLine1=" cronetRequest(url, referer).execute {"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/client/EhEngine.kt"
line="123"
column="37"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `cronetRequest`"
errorLine1=" cronetRequest(url, referer) {"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/spider/SpiderDen.kt"
line="137"
column="13"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `noCache`"
errorLine1=" noCache()"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/spider/SpiderDen.kt"
line="138"
column="17"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `execute`"
errorLine1=" }.execute { info ->"
errorLine2=" ~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/spider/SpiderDen.kt"
line="139"
column="15"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `getHeadersMap`"
errorLine1=" val headers = info.getHeadersMap()"
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/spider/SpiderDen.kt"
line="140"
column="36"/>
</issue>
<issue
id="NewApi"
message="Call requires version 7 of the S Extensions SDK (current min is 0): `android.net.http.UrlResponseInfo#getReceivedByteCount`"
errorLine1=" notifyProgress(length, info.receivedByteCount, it)"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/kotlin/com/hippo/ehviewer/spider/SpiderDen.kt"
line="148"
column="57"/>
</issue>
</issues>
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="@string/pd_arrow_left" />
</vector>
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="@string/pd_reply" />
</vector>
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="@string/pd_send" />
</vector>
@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2016 Hippo Seven
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Indicating"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/abc_dialog_padding_top_material"
android:paddingBottom="@dimen/abc_dialog_padding_top_material" />
-1
View File
@@ -165,7 +165,6 @@
<string name="favored_times">♥ %d</string>
<string name="rating_text">%1$s (%2$.2f, %3$d)</string>
<string name="gallery_comments">Kommentare der Galerie</string>
<string name="no_one_comments_gallery">Keine Kommentare</string>
<string name="comment_successfully">Kommentar erfolgreich gesendet</string>
<string name="comment_failed">Kommentar nicht gesendet</string>
<string name="copy_comment_text">Inhalt des Kommentars kopieren</string>
-1
View File
@@ -198,7 +198,6 @@
<!-- Gallery Comments -->
<string name="gallery_comments">Comentarios de la galería</string>
<string name="no_one_comments_gallery">Sin comentarios en esta galería</string>
<string name="comment_successfully">Comentario publicado</string>
<string name="copy_comment_text">Copiar texto de comentario</string>
<string name="vote_up">Votar positivo</string>
-1
View File
@@ -211,7 +211,6 @@
<!-- Gallery Comments -->
<string name="gallery_comments">Commentaires de la galerie</string>
<string name="no_one_comments_gallery">Personne n\'a commenté sur la galerie</string>
<string name="comment_successfully">Commentaire posté</string>
<string name="comment_failed">Impossible de commenter</string>
<string name="copy_comment_text">Copier le texte du commentaire</string>
-1
View File
@@ -210,7 +210,6 @@
<!-- Gallery Comments -->
<string name="gallery_comments">ギャラリーコメント</string>
<string name="no_one_comments_gallery">コメントはまだありません。</string>
<string name="comment_successfully">コメントを送信しました。</string>
<string name="comment_failed">コメントに失敗しました。</string>
<string name="copy_comment_text">コメントをコピー</string>
-1
View File
@@ -185,7 +185,6 @@
<!-- Gallery Comments -->
<string name="gallery_comments">갤러리 코멘트</string>
<string name="no_one_comments_gallery">코멘트가 없습니다.</string>
<string name="comment_successfully">코멘트를 남겼습니다.</string>
<string name="comment_failed">코멘트를 남기지 못했습니다.</string>
<string name="copy_comment_text">코멘트 텍스트 복사</string>
@@ -129,7 +129,6 @@
<string name="key_size">Størrelse</string>
<string name="download_move_dialog_title">Flytt</string>
<string name="key_torrents">Torrenter</string>
<string name="no_one_comments_gallery">Ingen kommentar.</string>
<string name="gallery_comments">Gallerikommentarer</string>
<string name="download_state_wait">Venter</string>
<string name="download_state_failed">Mislykket</string>
-1
View File
@@ -200,7 +200,6 @@
<!-- Gallery Comments -->
<string name="gallery_comments">การแสดงความคิดเห็นในแกลเลอรี่</string>
<string name="no_one_comments_gallery">ไม่มีความคิดเห็น</string>
<string name="comment_successfully">แสดงความคิดเห็นเสร็จเรียบร้อยแล้ว</string>
<string name="comment_failed">การแสดงความคิดเห็นล้มเหลว</string>
<string name="copy_comment_text">คัดลอกข้อความของความคิดเห็น</string>
@@ -204,7 +204,6 @@
<string name="key_torrent_url">种子链接</string>
<!-- Gallery Comments -->
<string name="gallery_comments">画廊评论</string>
<string name="no_one_comments_gallery">暂时没有评论</string>
<string name="comment_successfully">评论成功</string>
<string name="comment_failed">评论失败</string>
<string name="copy_comment_text">复制评论文字</string>
@@ -216,7 +216,6 @@
<!-- Gallery Comments -->
<string name="gallery_comments">畫廊評論</string>
<string name="no_one_comments_gallery">暫時沒有評論</string>
<string name="comment_successfully">評論成功</string>
<string name="comment_failed">評論失敗</string>
<string name="copy_comment_text">複製評論文字</string>
@@ -204,7 +204,6 @@
<string name="key_torrent_url">種子連結</string>
<!-- Gallery Comments -->
<string name="gallery_comments">圖庫留言</string>
<string name="no_one_comments_gallery">目前沒有留言</string>
<string name="comment_successfully">留言成功</string>
<string name="comment_failed">留言失敗</string>
<string name="copy_comment_text">複製留言文字</string>
-2
View File
@@ -68,8 +68,6 @@
<dimen name="fab_size">56dp</dimen>
<dimen name="fab_min_size">40dp</dimen>
<dimen name="fab_rv_padding_size">64dp</dimen>
<dimen name="corner_fab_margin">16dp</dimen>
<dimen name="gallery_detail_thumb_width">128dp</dimen>
-3
View File
@@ -27,9 +27,6 @@
<string name="pd_go_to" translatable="false">M13,13L17,17L21,13H18V10C18,6.1,14.9,3,11,3S4,6.1,4,10V17H6V10C6,7.2,8.2,5,11,5S16,7.2,16,10V13H13M,16,19H18V21H16V19Z</string>
<string name="pd_magnify" translatable="false">M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z</string>
<string name="pd_help_circle" translatable="false">M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z</string>
<string name="pd_arrow_left" translatable="false">M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z</string>
<string name="pd_reply" translatable="false">M10,9V5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9Z</string>
<string name="pd_send" translatable="false">M2,21L23,12L2,3V10L17,12L2,14V21Z</string>
<string name="pd_download_box" translatable="false">M19,3H5C3.9,3,3,3.9,3,5V19C3,20.1,3.9,21,5,21H19C20.1,21,21,20.1,21,19V5C21,3.9,20.1,3,19,3ZM12,17L7,12H10V8H14V12H17L12,17Z</string>
<string name="pd_refresh" translatable="false">M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z</string>
<string name="pd_file_image" translatable="false">M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M6,20H15L18,20V12L14,16L12,14L6,20M8,9A2,2 0 0,0 6,11A2,2 0 0,0 8,13A2,2 0 0,0 10,11A2,2 0 0,0 8,9Z</string>
-1
View File
@@ -246,7 +246,6 @@
<string name="key_torrent_url">Torrent URL</string>
<!-- Gallery Comments -->
<string name="gallery_comments">Gallery Comments</string>
<string name="no_one_comments_gallery">No comment.</string>
<string name="comment_successfully">Comment post successfully</string>
<string name="comment_failed">Failed to post the comment</string>
<string name="copy_comment_text">Copy comment text</string>
+1 -1
View File
@@ -21,6 +21,6 @@ org.gradle.caching=true
android.useAndroidX=true
android.enableAppCompileTimeRClass=true
android.experimental.enableNewResourceShrinker.preciseShrinking=true
android.experimental.lint.version=8.3.0-alpha10
android.experimental.lint.version=8.3.0-alpha12
android.lint.useK2Uast=true
kotlin.experimental.tryK2=true
+1 -1
View File
@@ -1,7 +1,7 @@
[versions]
aboutlibraries = "10.9.2"
agp = "8.1.2"
android-tools-r8 = "8.3.12-dev"
android-tools-r8 = "8.3.16-dev"
androidx-activity = "1.8.0"
androidx-appcompat = "1.6.1"
androidx-biometric = "1.2.0-alpha05"