mirror of
https://github.com/recloudstream/gradle.git
synced 2024-08-14 23:56:59 +00:00
add more metadata
This commit is contained in:
parent
75355b1517
commit
30aa59ce54
4 changed files with 22 additions and 4 deletions
|
@ -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) {
|
||||||
|
|
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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?,
|
||||||
)
|
)
|
|
@ -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()
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue