Move DownloadService name to a constant
This commit is contained in:
parent
daab4fa35e
commit
1d88d33cc5
5 changed files with 6 additions and 4 deletions
|
@ -48,7 +48,7 @@ class PaperweightCore : Plugin<Project> {
|
|||
|
||||
val ext = target.extensions.create(PAPERWEIGHT_EXTENSION, PaperweightCoreExtension::class, target)
|
||||
|
||||
target.gradle.sharedServices.registerIfAbsent("download", DownloadService::class) {}
|
||||
target.gradle.sharedServices.registerIfAbsent(DOWNLOAD_SERVICE_NAME, DownloadService::class) {}
|
||||
|
||||
target.tasks.register<Delete>("cleanCache") {
|
||||
group = "paper"
|
||||
|
|
|
@ -115,6 +115,8 @@ const val IVY_REPOSITORY = "$PAPER_PATH/ivyRepository"
|
|||
|
||||
const val RELOCATION_EXTENSION = "relocation"
|
||||
|
||||
const val DOWNLOAD_SERVICE_NAME = "paperweightDownloadService"
|
||||
|
||||
fun paperSetupOutput(name: String, ext: String) = "$SETUP_CACHE/$name.$ext"
|
||||
fun Task.paperTaskOutput(ext: String) = paperTaskOutput(name, ext)
|
||||
fun paperTaskOutput(name: String, ext: String) = "$TASK_CACHE/$name.$ext"
|
||||
|
|
|
@ -118,7 +118,7 @@ inline fun <reified T : Task> TaskContainer.configureTask(name: String, noinline
|
|||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val Project.download: Provider<DownloadService>
|
||||
get() = gradle.sharedServices.registrations.getByName("download").service as Provider<DownloadService>
|
||||
get() = gradle.sharedServices.registrations.getByName(DOWNLOAD_SERVICE_NAME).service as Provider<DownloadService>
|
||||
|
||||
fun commentRegex(): Regex {
|
||||
return Regex("\\s*#.*")
|
||||
|
|
|
@ -54,7 +54,7 @@ class PaperweightPatcher : Plugin<Project> {
|
|||
|
||||
val patcher = target.extensions.create(PAPERWEIGHT_EXTENSION, PaperweightPatcherExtension::class, target)
|
||||
|
||||
target.gradle.sharedServices.registerIfAbsent("download", DownloadService::class) {}
|
||||
target.gradle.sharedServices.registerIfAbsent(DOWNLOAD_SERVICE_NAME, DownloadService::class) {}
|
||||
|
||||
target.tasks.register<Delete>("cleanCache") {
|
||||
group = "paperweight"
|
||||
|
|
|
@ -75,7 +75,7 @@ abstract class PaperweightUser : Plugin<Project> {
|
|||
null
|
||||
}
|
||||
|
||||
target.gradle.sharedServices.registerIfAbsent("download", DownloadService::class) {}
|
||||
target.gradle.sharedServices.registerIfAbsent(DOWNLOAD_SERVICE_NAME, DownloadService::class) {}
|
||||
|
||||
val cleanAll = target.tasks.register<Delete>("cleanAllPaperweightUserdevCaches") {
|
||||
group = "paperweight"
|
||||
|
|
Loading…
Reference in a new issue