add more metadata

This commit is contained in:
C10udburst 2022-08-06 18:47:25 +02:00
parent 75355b1517
commit 30aa59ce54
4 changed files with 22 additions and 4 deletions

View file

@ -3,6 +3,7 @@ package com.lagradost.cloudstream3.gradle
import org.gradle.api.Project import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionContainer import org.gradle.api.plugins.ExtensionContainer
import org.gradle.api.provider.Property import org.gradle.api.provider.Property
import org.gradle.api.provider.ListProperty
import javax.inject.Inject import javax.inject.Inject
abstract class CloudstreamExtension @Inject constructor(project: Project) { abstract class CloudstreamExtension @Inject constructor(project: Project) {
@ -12,10 +13,17 @@ abstract class CloudstreamExtension @Inject constructor(project: Project) {
internal set internal set
fun overrideUrlPrefix(url: String) { fun overrideUrlPrefix(url: String) {
if (apkinfo == null) {
apkinfo = ApkInfo(this, "pre-release")
}
apkinfo!!.urlPrefix = url apkinfo!!.urlPrefix = url
} }
internal var pluginClassName: String? = null internal var pluginClassName: String? = null
val updateUrl: Property<String> = project.objects.property(String::class.java)
val sourceUrl: Property<String> = project.objects.property(String::class.java)
val authors: ListProperty<String> = project.objects.listProperty(String::class.java)
} }
class ApkInfo(extension: CloudstreamExtension, release: String) { class ApkInfo(extension: CloudstreamExtension, release: String) {

View file

@ -21,8 +21,10 @@ class ApkConfigurationProvider : IConfigurationProvider {
override fun provide(project: Project, dependency: Dependency) { override fun provide(project: Project, dependency: Dependency) {
val extension = project.extensions.getCloudstream() val extension = project.extensions.getCloudstream()
val apkinfo = ApkInfo(extension, dependency.version ?: "pre-release") if (extension.apkinfo == null) {
extension.apkinfo = apkinfo extension.apkinfo = ApkInfo(extension, dependency.version ?: "pre-release")
}
val apkinfo = extension.apkinfo!!
apkinfo.cache.mkdirs() apkinfo.cache.mkdirs()

View file

@ -2,5 +2,9 @@ package com.lagradost.cloudstream3.gradle.entities
data class PluginManifest( data class PluginManifest(
val pluginClassName: String, val pluginClassName: String,
val name: String val name: String,
val version: String,
val authors: List<String>,
val sourceUrl: String?,
val updateUrl: String?,
) )

View file

@ -69,7 +69,11 @@ fun registerTasks(project: Project) {
JsonBuilder( JsonBuilder(
PluginManifest( PluginManifest(
pluginClassName = extension.pluginClassName!!, pluginClassName = extension.pluginClassName!!,
name = project.name name = project.name,
version = project.version.toString(),
authors = extension.authors.get(),
sourceUrl = extension.sourceUrl.get(),
updateUrl = extension.updateUrl.get()
) )
).toPrettyString() ).toPrettyString()
) )