mirror of
https://github.com/recloudstream/gradle.git
synced 2024-08-14 23:56:59 +00:00
fix
This commit is contained in:
parent
b346926f90
commit
b96f8a062e
4 changed files with 12 additions and 7 deletions
|
@ -5,20 +5,20 @@ import com.lagradost.cloudstream3.gradle.getCloudstream
|
|||
import com.lagradost.cloudstream3.gradle.entities.PluginManifest
|
||||
import groovy.json.JsonBuilder
|
||||
|
||||
fun Project.makeManifest(): PluginManifest {
|
||||
fun Project.makeManifest(skipClass: Boolean?): PluginManifest {
|
||||
val extension = this.extensions.getCloudstream()
|
||||
|
||||
require(this.version != "unspecified") {
|
||||
"No version is set"
|
||||
}
|
||||
|
||||
require(extension.pluginClassName != null) {
|
||||
require((skipClass == null || !skipClass) && extension.pluginClassName != null) {
|
||||
"No plugin class found, make sure your plugin class is annotated with @CloudstreamPlugin"
|
||||
}
|
||||
|
||||
|
||||
return PluginManifest(
|
||||
pluginClassName = extension.pluginClassName!!,
|
||||
pluginClassName = extension.pluginClassName,
|
||||
name = this.name,
|
||||
version = this.version.toString(),
|
||||
authors = extension.authors.getOrElse(listOf()),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.lagradost.cloudstream3.gradle.entities
|
||||
|
||||
data class PluginManifest(
|
||||
val pluginClassName: String,
|
||||
val pluginClassName: String?,
|
||||
val name: String,
|
||||
val version: String,
|
||||
val authors: List<String>,
|
||||
|
|
|
@ -22,7 +22,7 @@ abstract class MakePluginsJsonTask : DefaultTask() {
|
|||
for (subproject in project.allprojects) {
|
||||
val cloudstream = subproject.extensions.findCloudstream() ?: continue
|
||||
|
||||
lst.add(subproject.makeManifest())
|
||||
lst.add(subproject.makeManifest(true))
|
||||
}
|
||||
|
||||
outputFile.asFile.get().writeText(
|
||||
|
@ -31,7 +31,7 @@ abstract class MakePluginsJsonTask : DefaultTask() {
|
|||
JsonGenerator.Options()
|
||||
.excludeNulls()
|
||||
.build()
|
||||
).toString()
|
||||
).toPrettyString()
|
||||
)
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import com.lagradost.cloudstream3.gradle.makeManifest
|
|||
import com.android.build.gradle.BaseExtension
|
||||
import com.android.build.gradle.tasks.ProcessLibraryManifest
|
||||
import groovy.json.JsonBuilder
|
||||
import groovy.json.JsonGenerator
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.tasks.AbstractCopyTask
|
||||
import org.gradle.api.tasks.bundling.Zip
|
||||
|
@ -69,7 +70,11 @@ fun registerTasks(project: Project) {
|
|||
}
|
||||
|
||||
manifestFile.writeText(
|
||||
JsonBuilder(project.makeManifest()).toPrettyString()
|
||||
JsonBuilder(project.makeManifest(),
|
||||
JsonGenerator.Options()
|
||||
.excludeNulls()
|
||||
.build()
|
||||
).toString()
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue