diff --git a/Aria/build.gradle b/Aria/build.gradle index 9ae11290..2f668f67 100644 --- a/Aria/build.gradle +++ b/Aria/build.gradle @@ -28,7 +28,7 @@ dependencies { implementation(libs.timber) api project(path: ':AriaAnnotations') api project(path: ':PublicComponent') - api project(path: ':HttpComponent') + api project(path: ':Http') } //apply from: 'bintray-release.gradle' diff --git a/HttpComponent/.gitignore b/Http/.gitignore similarity index 100% rename from HttpComponent/.gitignore rename to Http/.gitignore diff --git a/HttpComponent/bintray-release.gradle b/Http/bintray-release.gradle similarity index 100% rename from HttpComponent/bintray-release.gradle rename to Http/bintray-release.gradle diff --git a/HttpComponent/build.gradle b/Http/build.gradle similarity index 100% rename from HttpComponent/build.gradle rename to Http/build.gradle diff --git a/HttpComponent/consumer-rules.pro b/Http/consumer-rules.pro similarity index 100% rename from HttpComponent/consumer-rules.pro rename to Http/consumer-rules.pro diff --git a/HttpComponent/proguard-rules.pro b/Http/proguard-rules.pro similarity index 100% rename from HttpComponent/proguard-rules.pro rename to Http/proguard-rules.pro diff --git a/HttpComponent/src/main/AndroidManifest.xml b/Http/src/main/AndroidManifest.xml similarity index 100% rename from HttpComponent/src/main/AndroidManifest.xml rename to Http/src/main/AndroidManifest.xml diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/BaseHttpThreadTaskAdapter.java b/Http/src/main/java/com/arialyy/aria/http/BaseHttpThreadTaskAdapter.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/BaseHttpThreadTaskAdapter.java rename to Http/src/main/java/com/arialyy/aria/http/BaseHttpThreadTaskAdapter.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/ChunkedInputStream.java b/Http/src/main/java/com/arialyy/aria/http/ChunkedInputStream.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/ChunkedInputStream.java rename to Http/src/main/java/com/arialyy/aria/http/ChunkedInputStream.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/ConnectionHelp.java b/Http/src/main/java/com/arialyy/aria/http/ConnectionHelp.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/ConnectionHelp.java rename to Http/src/main/java/com/arialyy/aria/http/ConnectionHelp.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/HttpBaseController.kt b/Http/src/main/java/com/arialyy/aria/http/HttpBaseController.kt similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/HttpBaseController.kt rename to Http/src/main/java/com/arialyy/aria/http/HttpBaseController.kt diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/HttpComponent.kt b/Http/src/main/java/com/arialyy/aria/http/HttpComponent.kt similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/HttpComponent.kt rename to Http/src/main/java/com/arialyy/aria/http/HttpComponent.kt diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/HttpComponentLoader.kt b/Http/src/main/java/com/arialyy/aria/http/HttpComponentLoader.kt similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/HttpComponentLoader.kt rename to Http/src/main/java/com/arialyy/aria/http/HttpComponentLoader.kt diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/HttpOption.kt b/Http/src/main/java/com/arialyy/aria/http/HttpOption.kt similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/HttpOption.kt rename to Http/src/main/java/com/arialyy/aria/http/HttpOption.kt diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/HttpRecordHandler.java b/Http/src/main/java/com/arialyy/aria/http/HttpRecordHandler.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/HttpRecordHandler.java rename to Http/src/main/java/com/arialyy/aria/http/HttpRecordHandler.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/HttpTaskOption.java b/Http/src/main/java/com/arialyy/aria/http/HttpTaskOption.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/HttpTaskOption.java rename to Http/src/main/java/com/arialyy/aria/http/HttpTaskOption.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/HttpUtil.kt b/Http/src/main/java/com/arialyy/aria/http/HttpUtil.kt similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/HttpUtil.kt rename to Http/src/main/java/com/arialyy/aria/http/HttpUtil.kt diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java b/Http/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDFileInfoTask.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDGInfoTask.java b/Http/src/main/java/com/arialyy/aria/http/download/HttpDGInfoTask.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDGInfoTask.java rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDGInfoTask.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDGLoader.java b/Http/src/main/java/com/arialyy/aria/http/download/HttpDGLoader.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDGLoader.java rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDGLoader.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDGLoaderUtil.java b/Http/src/main/java/com/arialyy/aria/http/download/HttpDGLoaderUtil.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDGLoaderUtil.java rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDGLoaderUtil.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDLoaderUtil.java b/Http/src/main/java/com/arialyy/aria/http/download/HttpDLoaderUtil.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDLoaderUtil.java rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDLoaderUtil.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDStartController.kt b/Http/src/main/java/com/arialyy/aria/http/download/HttpDStartController.kt similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDStartController.kt rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDStartController.kt diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDTTBuilderAdapter.java b/Http/src/main/java/com/arialyy/aria/http/download/HttpDTTBuilderAdapter.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDTTBuilderAdapter.java rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDTTBuilderAdapter.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDTaskOption.kt b/Http/src/main/java/com/arialyy/aria/http/download/HttpDTaskOption.kt similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDTaskOption.kt rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDTaskOption.kt diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDThreadTaskAdapter.java b/Http/src/main/java/com/arialyy/aria/http/download/HttpDThreadTaskAdapter.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDThreadTaskAdapter.java rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDThreadTaskAdapter.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDownloadListener.kt b/Http/src/main/java/com/arialyy/aria/http/download/HttpDownloadListener.kt similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDownloadListener.kt rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDownloadListener.kt diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDownloader.kt b/Http/src/main/java/com/arialyy/aria/http/download/HttpDownloader.kt similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpDownloader.kt rename to Http/src/main/java/com/arialyy/aria/http/download/HttpDownloader.kt diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpSubDLoaderUtil.java b/Http/src/main/java/com/arialyy/aria/http/download/HttpSubDLoaderUtil.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/download/HttpSubDLoaderUtil.java rename to Http/src/main/java/com/arialyy/aria/http/download/HttpSubDLoaderUtil.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/upload/HttpULoader.java b/Http/src/main/java/com/arialyy/aria/http/upload/HttpULoader.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/upload/HttpULoader.java rename to Http/src/main/java/com/arialyy/aria/http/upload/HttpULoader.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/upload/HttpULoaderUtil.java b/Http/src/main/java/com/arialyy/aria/http/upload/HttpULoaderUtil.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/upload/HttpULoaderUtil.java rename to Http/src/main/java/com/arialyy/aria/http/upload/HttpULoaderUtil.java diff --git a/HttpComponent/src/main/java/com/arialyy/aria/http/upload/HttpUThreadTaskAdapter.java b/Http/src/main/java/com/arialyy/aria/http/upload/HttpUThreadTaskAdapter.java similarity index 100% rename from HttpComponent/src/main/java/com/arialyy/aria/http/upload/HttpUThreadTaskAdapter.java rename to Http/src/main/java/com/arialyy/aria/http/upload/HttpUThreadTaskAdapter.java diff --git a/HttpComponent/src/main/resources/META-INF/MANIFEST.MF b/Http/src/main/resources/META-INF/MANIFEST.MF similarity index 100% rename from HttpComponent/src/main/resources/META-INF/MANIFEST.MF rename to Http/src/main/resources/META-INF/MANIFEST.MF diff --git a/HttpComponent/src/main/resources/META-INF/services/com.arialyy.aria.core.inf.IComponentInit b/Http/src/main/resources/META-INF/services/com.arialyy.aria.core.inf.IComponentInit similarity index 100% rename from HttpComponent/src/main/resources/META-INF/services/com.arialyy.aria.core.inf.IComponentInit rename to Http/src/main/resources/META-INF/services/com.arialyy.aria.core.inf.IComponentInit diff --git a/HttpComponent/src/main/resources/META-INF/services/com.arialyy.aria.core.inf.IUtil b/Http/src/main/resources/META-INF/services/com.arialyy.aria.core.inf.IUtil similarity index 100% rename from HttpComponent/src/main/resources/META-INF/services/com.arialyy.aria.core.inf.IUtil rename to Http/src/main/resources/META-INF/services/com.arialyy.aria.core.inf.IUtil diff --git a/M3U8Component/build.gradle b/M3U8Component/build.gradle index 2bb4586f..a3cd5f40 100644 --- a/M3U8Component/build.gradle +++ b/M3U8Component/build.gradle @@ -30,7 +30,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation project(path: ':HttpComponent') + implementation project(path: ':Http') implementation project(path: ':PublicComponent') } diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/DuaContext.kt b/PublicComponent/src/main/java/com/arialyy/aria/core/DuaContext.kt index d2b6ab33..61b10fae 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/core/DuaContext.kt +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/DuaContext.kt @@ -18,7 +18,6 @@ package com.arialyy.aria.core import android.annotation.SuppressLint import android.content.Context import com.arialyy.aria.core.service.LifecycleManager -import com.arialyy.aria.core.service.QueueManager import com.arialyy.aria.core.service.ServiceManager import kotlinx.coroutines.MainScope @@ -40,10 +39,7 @@ object DuaContext { fun isService(serviceName: String) = serviceName in serviceArray - fun getServiceManager() = ServiceManager fun getLifeManager() = LifecycleManager - - fun getQueueManger() = QueueManager } \ No newline at end of file diff --git a/Queue/src/main/java/com/arialyy/aria/queue/IPool.java b/PublicComponent/src/main/java/com/arialyy/aria/core/inf/IPool.java similarity index 95% rename from Queue/src/main/java/com/arialyy/aria/queue/IPool.java rename to PublicComponent/src/main/java/com/arialyy/aria/core/inf/IPool.java index 00b3b5b0..7149eaa3 100644 --- a/Queue/src/main/java/com/arialyy/aria/queue/IPool.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/inf/IPool.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.arialyy.aria.queue; +package com.arialyy.aria.core.inf; import com.arialyy.aria.core.task.ITask; import java.util.List; @@ -22,7 +22,7 @@ import java.util.List; /** * Created by lyy on 2016/8/14. 任务池 */ -interface IPool { +public interface IPool { List getAllTask(); diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/provider/DuaStartupProvider.kt b/PublicComponent/src/main/java/com/arialyy/aria/core/provider/DuaStartupProvider.kt index 5d63c986..e623f667 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/core/provider/DuaStartupProvider.kt +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/provider/DuaStartupProvider.kt @@ -18,9 +18,11 @@ package com.arialyy.aria.core.provider import android.content.Context import androidx.startup.Initializer import com.arialyy.aria.core.DuaContext +import com.arialyy.aria.core.inf.IComponentInit import com.arialyy.aria.core.service.DbService import timber.log.Timber import timber.log.Timber.DebugTree +import java.util.ServiceLoader class DuaStartupProvider : Initializer { @@ -30,6 +32,17 @@ class DuaStartupProvider : Initializer { it.registerService(DuaContext.DB_SERVICE, DbService::class.java) } initLog() + initComponent(context) + } + + /** + * init all component, [IComponentInit] + */ + private fun initComponent(context: Context) { + val sa = ServiceLoader.load(IComponentInit::class.java, javaClass.classLoader) + sa.forEach { + it.init(context) + } } private fun initLog() { diff --git a/Queue/src/main/java/com/arialyy/aria/queue/AbsTaskQueue.java b/Queue/src/main/java/com/arialyy/aria/queue/AbsTaskQueue.java index 224b40af..6d40bb5a 100644 --- a/Queue/src/main/java/com/arialyy/aria/queue/AbsTaskQueue.java +++ b/Queue/src/main/java/com/arialyy/aria/queue/AbsTaskQueue.java @@ -17,6 +17,7 @@ package com.arialyy.aria.queue; import com.arialyy.aria.core.inf.IEntity; +import com.arialyy.aria.core.inf.IPool; import com.arialyy.aria.core.inf.ITaskQueue; import com.arialyy.aria.core.inf.TaskSchedulerType; import com.arialyy.aria.core.manager.ThreadTaskManager; diff --git a/Queue/src/main/java/com/arialyy/aria/queue/BaseCachePool.java b/Queue/src/main/java/com/arialyy/aria/queue/BaseCachePool.java index 0ab39ce4..04d390f4 100644 --- a/Queue/src/main/java/com/arialyy/aria/queue/BaseCachePool.java +++ b/Queue/src/main/java/com/arialyy/aria/queue/BaseCachePool.java @@ -16,6 +16,7 @@ package com.arialyy.aria.queue; +import com.arialyy.aria.core.inf.IPool; import com.arialyy.aria.core.task.ITask; import java.util.ArrayList; import java.util.Deque; diff --git a/Queue/src/main/java/com/arialyy/aria/queue/BaseExecutePool.java b/Queue/src/main/java/com/arialyy/aria/queue/BaseExecutePool.java index b382fa6d..7b4b85e5 100644 --- a/Queue/src/main/java/com/arialyy/aria/queue/BaseExecutePool.java +++ b/Queue/src/main/java/com/arialyy/aria/queue/BaseExecutePool.java @@ -16,6 +16,7 @@ package com.arialyy.aria.queue; +import com.arialyy.aria.core.inf.IPool; import com.arialyy.aria.core.inf.TaskSchedulerType; import com.arialyy.aria.core.task.ITask; import java.util.ArrayList; diff --git a/Queue/src/main/java/com/arialyy/aria/queue/DTaskQueue.java b/Queue/src/main/java/com/arialyy/aria/queue/DTaskQueue.java index 76b7c628..3580bbda 100644 --- a/Queue/src/main/java/com/arialyy/aria/queue/DTaskQueue.java +++ b/Queue/src/main/java/com/arialyy/aria/queue/DTaskQueue.java @@ -17,6 +17,7 @@ package com.arialyy.aria.queue; import android.content.Context; +import androidx.annotation.NonNull; import com.arialyy.aria.core.AriaConfig; import com.arialyy.aria.core.task.DownloadTask; diff --git a/Queue/src/main/java/com/arialyy/aria/queue/QueueComponent.kt b/Queue/src/main/java/com/arialyy/aria/queue/QueueComponent.kt index e0096e05..2acbc230 100644 --- a/Queue/src/main/java/com/arialyy/aria/queue/QueueComponent.kt +++ b/Queue/src/main/java/com/arialyy/aria/queue/QueueComponent.kt @@ -1,6 +1,7 @@ package com.arialyy.aria.queue import android.content.Context +import com.arialyy.aria.core.DuaContext import com.arialyy.aria.core.inf.IComponentInit /** @@ -10,6 +11,7 @@ import com.arialyy.aria.core.inf.IComponentInit **/ class QueueComponent : IComponentInit { override fun init(context: Context) { - + DuaContext.getServiceManager().registerService(DuaContext.D_QUEUE, DTaskQueue.getInstance()) + DuaContext.getServiceManager().registerService(DuaContext.U_QUEUE, UTaskQueue.getInstance()) } } \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index c5585159..e95f7ad5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -34,7 +34,7 @@ dependencyResolutionManagement { } -include ':app', ':Aria', ':AriaAnnotations', ':AriaCompiler', ':AppFrame', ':HttpComponent', ':M3U8Component', ':SFtpComponent', +include ':app', ':Aria', ':AriaAnnotations', ':AriaCompiler', ':AppFrame', ':Http', ':M3U8Component', ':SFtpComponent', ':FtpComponent', ':PublicComponent' rootProject.name='Aria' include ':Queue'