From 90beeee2207965ea98de51065af66d89f6d0d12b Mon Sep 17 00:00:00 2001 From: C10udburst <18114966+C10udburst@users.noreply.github.com> Date: Mon, 8 Aug 2022 09:48:45 +0200 Subject: [PATCH] oops --- .../lagradost/cloudstream3/gradle/Utils.kt | 5 ++--- .../gradle/tasks/DumpManifestTask.kt | 22 ------------------- .../cloudstream3/gradle/tasks/Tasks.kt | 2 +- 3 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/DumpManifestTask.kt diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt index 61c0f88..c933868 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt @@ -5,18 +5,17 @@ import com.lagradost.cloudstream3.gradle.getCloudstream import com.lagradost.cloudstream3.gradle.entities.PluginManifest import groovy.json.JsonBuilder -fun Project.makeManifest(skipClass: Boolean?): PluginManifest { +fun Project.makeManifest(skipClass: Boolean): PluginManifest { val extension = this.extensions.getCloudstream() require(this.version != "unspecified") { "No version is set" } - require((skipClass == null || !skipClass) && extension.pluginClassName != null) { + require(!skipClass && extension.pluginClassName != null) { "No plugin class found, make sure your plugin class is annotated with @CloudstreamPlugin" } - return PluginManifest( pluginClassName = extension.pluginClassName, name = this.name, diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/DumpManifestTask.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/DumpManifestTask.kt deleted file mode 100644 index fdb1725..0000000 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/DumpManifestTask.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.lagradost.cloudstream3.gradle.tasks - -import com.lagradost.cloudstream3.gradle.getCloudstream -import com.lagradost.cloudstream3.gradle.makeManifest -import org.gradle.api.DefaultTask -import org.gradle.api.tasks.AbstractCopyTask -import org.gradle.api.tasks.Input -import org.gradle.api.tasks.TaskAction -import org.gradle.api.tasks.options.Option -import java.nio.charset.StandardCharsets -import groovy.json.JsonBuilder - -abstract class DumpManifestTask : DefaultTask() { - @TaskAction - fun dumpManifest() { - val manifestFile = project.buildDir.resolve("${project.name}.json") - - manifestFile.writeText( - JsonBuilder(project.makeManifest()).toPrettyString() - ) - } -} \ No newline at end of file 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 fd69a23..bacd76f 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt @@ -70,7 +70,7 @@ fun registerTasks(project: Project) { } manifestFile.writeText( - JsonBuilder(project.makeManifest(), + JsonBuilder(project.makeManifest(false), JsonGenerator.Options() .excludeNulls() .build()