From 616724a762f4d67ac41dd1c72e6a1e3e50566995 Mon Sep 17 00:00:00 2001 From: lyy <511455842@QQ.com> Date: Sun, 15 Jan 2023 19:35:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppFrame/build.gradle | 9 +- Aria/build.gradle | 8 -- FtpComponent/build.gradle | 5 -- HttpComponent/build.gradle | 5 -- M3U8Component/build.gradle | 5 -- PublicComponent/build.gradle | 19 ++--- PublicComponent/src/main/AndroidManifest.xml | 15 +++- .../arialyy/aria/core/DuaStartupProvider.kt | 58 +++++++++++++ .../aria/core/config/AutoGenerateConstance.kt | 26 ++++++ .../arialyy/aria/core/provider/IDbProvider.kt | 26 ++++++ .../com/arialyy/aria/orm/DefaultDbProvider.kt | 32 ++++++++ .../main/java/com/arialyy/aria/orm/DuaDb.kt | 30 +++++++ .../com/arialyy/aria/orm/entiry/DEntity.kt | 41 ++++++++++ .../com/arialyy/aria/orm/entiry/UEntity.kt | 39 +++++++++ .../com/arialyy/aria/util/ReflectionUtil.java | 82 +++++++++++++++++++ SFtpComponent/build.gradle | 5 -- app/build.gradle | 4 - build.gradle | 14 ++-- libs.versions.toml | 16 ++-- settings.gradle | 17 +++- 20 files changed, 388 insertions(+), 68 deletions(-) create mode 100644 PublicComponent/src/main/java/com/arialyy/aria/core/DuaStartupProvider.kt create mode 100644 PublicComponent/src/main/java/com/arialyy/aria/core/config/AutoGenerateConstance.kt create mode 100644 PublicComponent/src/main/java/com/arialyy/aria/core/provider/IDbProvider.kt create mode 100644 PublicComponent/src/main/java/com/arialyy/aria/orm/DefaultDbProvider.kt create mode 100644 PublicComponent/src/main/java/com/arialyy/aria/orm/DuaDb.kt create mode 100644 PublicComponent/src/main/java/com/arialyy/aria/orm/entiry/DEntity.kt create mode 100644 PublicComponent/src/main/java/com/arialyy/aria/orm/entiry/UEntity.kt create mode 100644 PublicComponent/src/main/java/com/arialyy/aria/util/ReflectionUtil.java diff --git a/AppFrame/build.gradle b/AppFrame/build.gradle index 023c37b6..8d36a58c 100644 --- a/AppFrame/build.gradle +++ b/AppFrame/build.gradle @@ -9,15 +9,10 @@ android { defaultConfig { minSdkVersion libs.versions.minSdk.get().toInteger() targetSdkVersion libs.versions.targetsdk.get().toInteger() - versionCode 1 - versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { - debug{ - debuggable true - } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' @@ -37,8 +32,8 @@ dependencies { androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - testImplementation 'junit:junit:4.12' - api "androidx.appcompat:appcompat:${rootProject.ext.XAppcompatVersion}" + testImplementation libs.bundles.android.test + implementation(libs.appcompat) api 'com.google.code.gson:gson:2.8.2' api 'io.reactivex:rxandroid:1.2.0' api 'io.reactivex:rxjava:1.1.5' diff --git a/Aria/build.gradle b/Aria/build.gradle index 733cf05b..eb4bcee7 100644 --- a/Aria/build.gradle +++ b/Aria/build.gradle @@ -1,7 +1,6 @@ plugins { id 'com.android.library' id 'org.jetbrains.kotlin.android' - id 'kotlin-kapt' } android { @@ -11,13 +10,8 @@ android { defaultConfig { minSdkVersion libs.versions.minSdk.get().toInteger() targetSdkVersion libs.versions.targetsdk.get().toInteger() - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName } buildTypes { - debug{ - debuggable true - } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' @@ -31,8 +25,6 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') testImplementation(libs.bundles.android.test) implementation(libs.appcompat) - implementation(libs.room.runtime) - kapt libs.room.compiler api project(path: ':AriaAnnotations') api project(path: ':PublicComponent') api project(path: ':HttpComponent') diff --git a/FtpComponent/build.gradle b/FtpComponent/build.gradle index 7af2f0e1..ff723888 100644 --- a/FtpComponent/build.gradle +++ b/FtpComponent/build.gradle @@ -10,17 +10,12 @@ android { defaultConfig { minSdkVersion libs.versions.minSdk.get().toInteger() targetSdkVersion libs.versions.targetsdk.get().toInteger() - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' } buildTypes { - debug{ - debuggable true - } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' diff --git a/HttpComponent/build.gradle b/HttpComponent/build.gradle index 530299de..8198d5a7 100644 --- a/HttpComponent/build.gradle +++ b/HttpComponent/build.gradle @@ -10,16 +10,11 @@ android { defaultConfig { minSdkVersion libs.versions.minSdk.get().toInteger() targetSdkVersion libs.versions.targetsdk.get().toInteger() - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName consumerProguardFiles 'consumer-rules.pro' } buildTypes { - debug{ - debuggable true - } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' diff --git a/M3U8Component/build.gradle b/M3U8Component/build.gradle index 1781786d..2bb4586f 100644 --- a/M3U8Component/build.gradle +++ b/M3U8Component/build.gradle @@ -10,17 +10,12 @@ android { defaultConfig { minSdkVersion libs.versions.minSdk.get().toInteger() targetSdkVersion libs.versions.targetsdk.get().toInteger() - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' } buildTypes { - debug{ - debuggable true - } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' diff --git a/PublicComponent/build.gradle b/PublicComponent/build.gradle index 5a949b5f..6da507c3 100644 --- a/PublicComponent/build.gradle +++ b/PublicComponent/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'org.jetbrains.kotlin.android' + id 'kotlin-kapt' } android { @@ -10,17 +11,12 @@ android { defaultConfig { minSdkVersion libs.versions.minSdk.get().toInteger() targetSdkVersion libs.versions.targetsdk.get().toInteger() - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' } buildTypes { - debug{ - debuggable true - } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' @@ -35,16 +31,15 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - testImplementation 'junit:junit:4.12' - implementation "androidx.core:core-ktx:+" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + testImplementation(libs.bundles.android.test) + implementation(libs.appcompat) + implementation(libs.bundles.room) + implementation(libs.startup) + kapt libs.room.compiler } //apply from: 'bintray-release.gradle' ext{ PUBLISH_ARTIFACT_ID = 'public' } -apply from: '../gradle/mavenCentral-release.gradle' -repositories { - mavenCentral() -} \ No newline at end of file +apply from: '../gradle/mavenCentral-release.gradle' \ No newline at end of file diff --git a/PublicComponent/src/main/AndroidManifest.xml b/PublicComponent/src/main/AndroidManifest.xml index e3231482..9d8f9d82 100644 --- a/PublicComponent/src/main/AndroidManifest.xml +++ b/PublicComponent/src/main/AndroidManifest.xml @@ -1,12 +1,19 @@ + xmlns:tools="http://schemas.android.com/tools" + package="com.arialyy.aria.publiccomponent"> + + android:name="androidx.startup.InitializationProvider" + android:authorities="${applicationId}.androidx-startup" + android:exported="false" + tools:node="merge"> + + + diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/DuaStartupProvider.kt b/PublicComponent/src/main/java/com/arialyy/aria/core/DuaStartupProvider.kt new file mode 100644 index 00000000..9ded26d8 --- /dev/null +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/DuaStartupProvider.kt @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria) + * + * 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. + */ +package com.arialyy.aria.core + +import android.content.Context +import androidx.room.Room +import androidx.room.RoomDatabase +import androidx.room.RoomDatabase.Builder +import androidx.startup.Initializer +import com.arialyy.aria.core.config.AutoGenerateConstance +import com.arialyy.aria.orm.DefaultDbProvider +import com.arialyy.aria.util.ReflectionUtil + +class DuaStartupProvider : Initializer { + /** + * Find a user-defined database + */ + private fun findCustomDatabase(context: Context): Builder? { + try { + val clazz = javaClass.classLoader.loadClass(AutoGenerateConstance.GenerateClassName) + ?: return null + + val obj = clazz.newInstance() + + val method = ReflectionUtil.getMethod(clazz, "generateDb", Context::class.java) ?: return null + + return method.invoke(obj, context) as Builder? + } catch (e: java.lang.Exception) { + return null + } + } + + override fun create(context: Context) { + var customDb = findCustomDatabase(context) + if (customDb == null) { + customDb = DefaultDbProvider().generateDb(context) + } + customDb.build() + // .addMigrations(MIGRATION_2_3(), MIGRATION_3_4()) + } + + override fun dependencies(): MutableList>> { + return mutableListOf() + } +} \ No newline at end of file diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/config/AutoGenerateConstance.kt b/PublicComponent/src/main/java/com/arialyy/aria/core/config/AutoGenerateConstance.kt new file mode 100644 index 00000000..bb0b3daa --- /dev/null +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/config/AutoGenerateConstance.kt @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria) + * + * 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. + */ +package com.arialyy.aria.core.config + +/** + * Automatically created configurations + */ +object AutoGenerateConstance { + + const val GenerateClassName = "com.arialyy.aria.custom.Constance" + + const val DbClassKeyName = "roomBuilder" +} \ No newline at end of file diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/provider/IDbProvider.kt b/PublicComponent/src/main/java/com/arialyy/aria/core/provider/IDbProvider.kt new file mode 100644 index 00000000..41df67a8 --- /dev/null +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/provider/IDbProvider.kt @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria) + * + * 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. + */ +package com.arialyy.aria.core.provider + +import android.content.Context +import androidx.room.RoomDatabase + +interface IDbProvider { + + fun getDbName() = "duaDb" + + fun generateDb(context: Context): RoomDatabase.Builder +} \ No newline at end of file diff --git a/PublicComponent/src/main/java/com/arialyy/aria/orm/DefaultDbProvider.kt b/PublicComponent/src/main/java/com/arialyy/aria/orm/DefaultDbProvider.kt new file mode 100644 index 00000000..82eb6c68 --- /dev/null +++ b/PublicComponent/src/main/java/com/arialyy/aria/orm/DefaultDbProvider.kt @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria) + * + * 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. + */ +package com.arialyy.aria.orm + +import android.content.Context +import androidx.room.Room +import androidx.room.RoomDatabase +import androidx.room.RoomDatabase.Builder +import com.arialyy.aria.core.provider.IDbProvider + +class DefaultDbProvider : IDbProvider { + + override fun generateDb(context: Context): Builder { + return Room.databaseBuilder( + context, + DuaDb::class.java, getDbName() + ) as Builder + } +} \ No newline at end of file diff --git a/PublicComponent/src/main/java/com/arialyy/aria/orm/DuaDb.kt b/PublicComponent/src/main/java/com/arialyy/aria/orm/DuaDb.kt new file mode 100644 index 00000000..c4df9a8e --- /dev/null +++ b/PublicComponent/src/main/java/com/arialyy/aria/orm/DuaDb.kt @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria) + * + * 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. + */ +package com.arialyy.aria.orm + +import androidx.room.Database +import androidx.room.RoomDatabase +import com.arialyy.aria.orm.entiry.UEntity + +@Database( + entities = [DbEntity::class, UEntity::class], + version = 1 +) +abstract class DuaDb : RoomDatabase() { + companion object { + + } +} \ No newline at end of file diff --git a/PublicComponent/src/main/java/com/arialyy/aria/orm/entiry/DEntity.kt b/PublicComponent/src/main/java/com/arialyy/aria/orm/entiry/DEntity.kt new file mode 100644 index 00000000..6a3ab9e9 --- /dev/null +++ b/PublicComponent/src/main/java/com/arialyy/aria/orm/entiry/DEntity.kt @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria) + * + * 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. + */ +package com.arialyy.aria.orm.entiry + +import androidx.room.Entity +import androidx.room.Index +import androidx.room.PrimaryKey + +/** + * Download Entity + */ +@Entity(tableName = "d_entity", indices = [Index(value = ["sourceUrl", "savePath"])]) +data class DEntity( + @PrimaryKey(autoGenerate = true) val dId: Int = 0, + + /** + * file source url + */ + val sourceUrl: String, + /** + * file save path + */ + val savePath: String, + /** + * extended Information + */ + var ext: String? = null +) \ No newline at end of file diff --git a/PublicComponent/src/main/java/com/arialyy/aria/orm/entiry/UEntity.kt b/PublicComponent/src/main/java/com/arialyy/aria/orm/entiry/UEntity.kt new file mode 100644 index 00000000..3df430ea --- /dev/null +++ b/PublicComponent/src/main/java/com/arialyy/aria/orm/entiry/UEntity.kt @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria) + * + * 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. + */ +package com.arialyy.aria.orm.entiry + +import androidx.room.Entity +import androidx.room.Index +import androidx.room.PrimaryKey + +@Entity(tableName = "u_entity", indices = [Index(value = ["serverUrl", "filePath"])]) +data class UEntity( + @PrimaryKey(autoGenerate = true) val uId: Int = 0, + /** + * uploader server url + */ + val serverUrl: String, + + /** + * file path + */ + val filePath: String, + + /** + * extended Information + */ + var ext: String? = null +) \ No newline at end of file diff --git a/PublicComponent/src/main/java/com/arialyy/aria/util/ReflectionUtil.java b/PublicComponent/src/main/java/com/arialyy/aria/util/ReflectionUtil.java new file mode 100644 index 00000000..439f7b6f --- /dev/null +++ b/PublicComponent/src/main/java/com/arialyy/aria/util/ReflectionUtil.java @@ -0,0 +1,82 @@ +package com.arialyy.aria.util; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +/** + * Created by lyy on 2015/7/30. + * 反射工具类 + */ +public class ReflectionUtil { + private static final String TAG = "ReflectionUtil"; + + /** + * 获取类里面的所在字段 + */ + public static Field[] getFields(Class clazz) { + Field[] fields = null; + fields = clazz.getDeclaredFields(); + if (fields == null || fields.length == 0) { + Class superClazz = clazz.getSuperclass(); + if (superClazz != null) { + fields = getFields(superClazz); + } + } + return fields; + } + + /** + * 获取类里面的指定对象,如果该类没有则从父类查询 + */ + public static Field getField(Class clazz, String name) { + Field field = null; + try { + field = clazz.getDeclaredField(name); + } catch (NoSuchFieldException e) { + try { + field = clazz.getField(name); + } catch (NoSuchFieldException e1) { + if (clazz.getSuperclass() == null) { + return field; + } else { + field = getField(clazz.getSuperclass(), name); + } + } + } + if (field != null) { + field.setAccessible(true); + } + return field; + } + + /** + * 利用递归找一个类的指定方法,如果找不到,去父亲里面找直到最上层Object对象为止。 + * + * @param clazz 目标类 + * @param methodName 方法名 + * @param params 方法参数类型数组 + * @return 方法对象 + */ + public static Method getMethod(Class clazz, String methodName, final Class... params) { + Method method = null; + try { + method = clazz.getDeclaredMethod(methodName, params); + } catch (NoSuchMethodException e) { + try { + method = clazz.getMethod(methodName, params); + } catch (NoSuchMethodException ex) { + if (clazz.getSuperclass() == null) { + ALog.e(TAG, "无法找到" + methodName + "方法"); + ALog.e(TAG, ALog.getExceptionString(e)); + return method; + } else { + method = getMethod(clazz.getSuperclass(), methodName, params); + } + } + } + if (method != null) { + method.setAccessible(true); + } + return method; + } +} diff --git a/SFtpComponent/build.gradle b/SFtpComponent/build.gradle index b6e149a9..e64691bb 100644 --- a/SFtpComponent/build.gradle +++ b/SFtpComponent/build.gradle @@ -10,17 +10,12 @@ android { defaultConfig { minSdkVersion libs.versions.minSdk.get().toInteger() targetSdkVersion libs.versions.targetsdk.get().toInteger() - versionCode rootProject.ext.versionCode - versionName rootProject.ext.versionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' } buildTypes { - debug{ - debuggable true - } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' diff --git a/app/build.gradle b/app/build.gradle index 4c90c0a7..5f3edf44 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,6 +1,5 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { @@ -91,6 +90,3 @@ dependencies { debugImplementation 'com.amitshekhar.android:debug-db:1.0.6' } -repositories { - mavenCentral() -} diff --git a/build.gradle b/build.gradle index 848262f4..e79c236f 100644 --- a/build.gradle +++ b/build.gradle @@ -3,17 +3,21 @@ buildscript { ext.kotlin_version = '1.7.20' dependencies { classpath files(libs.class.superclass.protectionDomain.codeSource.location) - classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.30" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // kotlin 文档引擎 +// classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.30" +// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // kotlin 文档引擎 } } plugins { - id 'com.android.application' version '7.3.1' apply false - id 'com.android.library' version '7.3.1' apply false + id 'com.android.application' version '7.4.0' apply false + id 'com.android.library' version '7.4.0' apply false id 'org.jetbrains.kotlin.android' version '1.7.20' apply false } +task clean(type: Delete) { + delete rootProject.buildDir +} + ext { versionCode = 390 versionName = '3.8.16-beta-1' @@ -49,4 +53,4 @@ ext { // 以下是androidX XAppcompatVersion = "1.1.0" -} +} \ No newline at end of file diff --git a/libs.versions.toml b/libs.versions.toml index 7fd036a7..17eb4055 100644 --- a/libs.versions.toml +++ b/libs.versions.toml @@ -1,22 +1,24 @@ [versions] -minSdk = "21" -compilesdk = "33" -targetsdk = "33" -appcompat = "1.5.1" +minSdk = "23" +compilesdk = "32" +targetsdk = "30" +buildToolsVersion="30.0.2" +appcompat = "1.6.0" recyclerview = "1.2.1" -buildToolsVersion="33.0.1" -room = "2.4.3" +room = "2.5.0" test-junit = "4.13.2" android-junit = "1.1.4" android-espresso = "3.5.0" android-ktx = "1.7.0" lifecycle = "2.5.1" +startup = "1.1.1" [libraries] recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" } room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" } room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" } +room-common = {module = "androidx.room:room-common", version.ref = "room"} junit = { module = "junit:junit", version.ref = "test-junit" } android-junit = { module = "androidx.test.ext:junit", version.ref = "android-junit" } android-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "android-espresso" } @@ -25,7 +27,9 @@ appcompat = {module = "androidx.appcompat:appcompat", version.ref = "appcompat"} lifecycle-viewmodel-ktx = {module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle"} lifecycle-viewmodel-compose = {module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle"} lifecycle-runtime-ktx = {module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle"} +startup = {module = "androidx.startup:startup-runtime", version.ref = "startup"} [bundles] +room = ["room-runtime", "room-common"] android-test = ["android-junit", "android-espresso"] lifecycle = ["lifecycle-viewmodel-ktx", "lifecycle-viewmodel-compose", "lifecycle-runtime-ktx"] diff --git a/settings.gradle b/settings.gradle index 40f558c1..d81d3ab9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,24 +3,37 @@ pluginManagement { gradlePluginPortal() google() mavenCentral() + maven { url 'https://jitpack.io' } mavenLocal() + maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } } } + enableFeaturePreview('VERSION_CATALOGS') dependencyResolutionManagement { + // repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() mavenLocal() + maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } + maven { url 'https://jitpack.io' } + maven { + url 'https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1' + } } versionCatalogs { libs { - from(files("libs.versions.toml")) + // from("com.lyy.kpa.version:catalog:0.0.1") + from(files('libs.versions.toml')) + // 我们也可以重写覆盖catalog中的groovy版本 + // version("groovy", "3.0.6") } } -} +} include ':app', ':Aria', ':AriaAnnotations', ':AriaCompiler', ':AppFrame', ':HttpComponent', ':M3U8Component', ':SFtpComponent', ':FtpComponent', ':PublicComponent' +rootProject.name='Aria' \ No newline at end of file