i just needed to write this properly and not be lazy

This commit is contained in:
C10udburst 2022-08-19 14:16:55 +02:00
parent 269e597e4e
commit 3810f1a580
2 changed files with 12 additions and 3 deletions

View file

@ -20,7 +20,7 @@ abstract class MakePluginsJsonTask : DefaultTask() {
val lst = LinkedList<PluginEntry>() val lst = LinkedList<PluginEntry>()
for (subproject in project.allprojects) { for (subproject in project.allprojects) {
val cloudstream = subproject.extensions.findCloudstream() ?: continue subproject.extensions.findCloudstream() ?: continue
lst.add(subproject.makePluginEntry()) lst.add(subproject.makePluginEntry())
} }

View file

@ -11,7 +11,8 @@ import org.gradle.api.Project
import org.gradle.api.tasks.AbstractCopyTask import org.gradle.api.tasks.AbstractCopyTask
import org.gradle.api.tasks.bundling.Zip import org.gradle.api.tasks.bundling.Zip
import org.gradle.api.tasks.compile.AbstractCompile import org.gradle.api.tasks.compile.AbstractCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.lagradost.cloudstream3.gradle.findCloudstream
const val TASK_GROUP = "cloudstream" const val TASK_GROUP = "cloudstream"
@ -23,7 +24,15 @@ fun registerTasks(project: Project) {
project.rootProject.tasks.register("makePluginsJson", MakePluginsJsonTask::class.java) { project.rootProject.tasks.register("makePluginsJson", MakePluginsJsonTask::class.java) {
it.group = TASK_GROUP it.group = TASK_GROUP
it.mustRunAfter("make") for (subproject in project.allprojects) {
subproject.extensions.findCloudstream() ?: continue
val makeTask = subproject.tasks.findByName("make")
if (makeTask != null) {
it.dependsOn(makeTask)
}
}
it.outputs.upToDateWhen { false } it.outputs.upToDateWhen { false }