如何抑制生成源中的Lint警告?

时间:2019-08-07 15:58:27

标签: android android-room androidx deprecation-warning android-lint

使用会议室版本2.1.0-alpha04

implementation "androidx.room:room-runtime:2.1.0-alpha04"
annotationProcessor "androidx.room:room-compiler:2.1.0-alpha04"
testImplementation "androidx.room:room-testing:2.1.0-alpha04"

@Dao的{​​{1}}实现会根据生成的RoomDatabase引起这些警告:

Dao_Impl

还有一个[deprecation] setTransactionSuccessful() in RoomDatabase has been deprecated [deprecation] beginTransaction() in RoomDatabase has been deprecated [deprecation] endTransaction() in RoomDatabase has been deprecated 类的人:

@Database

问题是,这些文件位于[deprecation] mCallbacks in RoomDatabase has been deprecated 中,而似乎只有mobile/build/generated/source/apt/debug之类的路径才能被捕获。到目前为止,我尝试过的内容以及绝对路径和相对路径以及<ignore path="src/main/..."/>-以及带有或不带有通配符的合格类名:

**/

如何使用<?xml version="1.0" encoding="UTF-8"?> <lint> <issue id="Deprecated" severity="informational"> <ignore regexp="androidx.room.RoomDatabase" /> </issue> <issue id="Deprecated"> <ignore regexp="com.acme.database.dao.*Dao_Impl" /> </issue> </lint> build/generated/source中禁止这些弃用警告-还是有一个更新/稳定的版本或lint.xml,它们可以正常工作(导致这些警告)?

1 个答案:

答案 0 :(得分:0)

将会议室更新到版本await cleanRedirect()会删除弃用警告:

df = pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]),
columns=['a', 'b', 'c'])
x = df['a']
r = pd.DataFrame(columns=['F', 'G', 'H', 'I'])
for m in x:
    r.append(pd.read_sql_query("""SELECT a.F,a.G,a.H,a.I
                                    FROM users a
                                    WHERE a.F ="""+m,engine))