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 76081b7..903333b 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/MakePluginsJsonTask.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/MakePluginsJsonTask.kt @@ -10,6 +10,7 @@ import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.TaskAction import java.util.LinkedList +import java.lang.Thread abstract class MakePluginsJsonTask : DefaultTask() { @get:OutputFile @@ -20,7 +21,19 @@ abstract class MakePluginsJsonTask : DefaultTask() { val lst = LinkedList() for (subproject in project.allprojects) { - subproject.extensions.findCloudstream() ?: continue + val cloudstream = subproject.extensions.findCloudstream() ?: continue + + /* + 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()) }