mirror of
https://github.com/recloudstream/gradle.git
synced 2024-08-14 23:56:59 +00:00
fix that race condition
This commit is contained in:
parent
3810f1a580
commit
de10dccb38
1 changed files with 14 additions and 1 deletions
|
@ -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<PluginEntry>()
|
||||
|
||||
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())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue