From 18915372d0a7e0d552f9c12c728105590ee072b1 Mon Sep 17 00:00:00 2001 From: C10udburst <18114966+C10udburst@users.noreply.github.com> Date: Fri, 19 Aug 2022 15:23:16 +0200 Subject: [PATCH] guh fix --- .../cloudstream3/gradle/tasks/MakePluginsJsonTask.kt | 4 ---- .../kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/MakePluginsJsonTask.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/MakePluginsJsonTask.kt index 903333b..8d6a042 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/MakePluginsJsonTask.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/MakePluginsJsonTask.kt @@ -27,12 +27,8 @@ abstract class MakePluginsJsonTask : DefaultTask() { bruh why does gradle ignore task order forcing me to do jank like this */ - var timeout = 10000 // 10 s timeout while (cloudstream.fileSize == null) { Thread.sleep(100) - timeout -= 100 - if (timeout <= 0) - throw RuntimeException("Timeout while fetching fileSize for ${subproject.name}") } lst.add(subproject.makePluginEntry()) diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt index 4f87b3e..be191ac 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt @@ -130,6 +130,12 @@ fun registerTasks(project: Project) { extension.fileSize = task.outputs.files.singleFile.length() task.logger.lifecycle("Made Cloudstream package at ${task.outputs.files.singleFile}") } + + it.finalizedBy { + if (extension.fileSize == null) { + extension.fileSize = -1L + } + } } }