mirror of
https://github.com/recloudstream/gradle.git
synced 2024-08-14 23:56:59 +00:00
update PluginManifest
This commit is contained in:
parent
7c3e21eaf2
commit
c06ce1833e
5 changed files with 31 additions and 15 deletions
|
@ -21,9 +21,11 @@ abstract class CloudstreamExtension @Inject constructor(project: Project) {
|
|||
|
||||
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 repositoryUrl: Property<String> = project.objects.property(String::class.java)
|
||||
val description: Property<String> = project.objects.property(String::class.java)
|
||||
val authors: ListProperty<String> = project.objects.listProperty(String::class.java)
|
||||
val isAdult: Property<Boolean> = project.objects.property(Boolean::class.java)
|
||||
val status: Property<Int> = project.objects.property(Int::class.java)
|
||||
}
|
||||
|
||||
class ApkInfo(extension: CloudstreamExtension, release: String) {
|
||||
|
|
21
src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt
Normal file
21
src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt
Normal file
|
@ -0,0 +1,21 @@
|
|||
package com.lagradost.cloudstream3.gradle
|
||||
|
||||
import org.gradle.api.Project
|
||||
import com.lagradost.cloudstream3.gradle.getCloudstream
|
||||
import com.lagradost.cloudstream3.gradle.entities.PluginManifest
|
||||
import groovy.json.JsonBuilder
|
||||
|
||||
fun Project.makeManifest(): PluginManifest {
|
||||
val extension = this.extensions.getCloudstream()
|
||||
|
||||
return PluginManifest(
|
||||
pluginClassName = extension.pluginClassName!!,
|
||||
name = this.name,
|
||||
version = this.version.toString(),
|
||||
authors = extension.authors.get(),
|
||||
repositoryUrl = extension.repositoryUrl.get(),
|
||||
description = extension.description.get(),
|
||||
isAdult = extension.isAdult.get(),
|
||||
status = extension.status.get() ?: 3
|
||||
)
|
||||
}
|
|
@ -5,6 +5,8 @@ data class PluginManifest(
|
|||
val name: String,
|
||||
val version: String,
|
||||
val authors: List<String>,
|
||||
val sourceUrl: String?,
|
||||
val updateUrl: String?,
|
||||
val repositoryUrl: String?,
|
||||
val description: String?,
|
||||
val isAdult: Boolean?,
|
||||
val status: Int
|
||||
)
|
|
@ -17,7 +17,6 @@ abstract class DeployWithAdbTask : DefaultTask() {
|
|||
|
||||
@TaskAction
|
||||
fun deployWithAdb() {
|
||||
val extension = project.extensions.getCloudstream()
|
||||
val android = project.extensions.getByName("android") as BaseExtension
|
||||
|
||||
AdbServerLauncher(Subprocess(), android.adbExecutable.absolutePath).launch()
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.lagradost.cloudstream3.gradle.tasks
|
|||
|
||||
import com.lagradost.cloudstream3.gradle.getCloudstream
|
||||
import com.lagradost.cloudstream3.gradle.entities.PluginManifest
|
||||
import com.lagradost.cloudstream3.gradle.makeManifest
|
||||
import com.android.build.gradle.BaseExtension
|
||||
import com.android.build.gradle.tasks.ProcessLibraryManifest
|
||||
import groovy.json.JsonBuilder
|
||||
|
@ -66,16 +67,7 @@ fun registerTasks(project: Project) {
|
|||
}
|
||||
|
||||
manifestFile.writeText(
|
||||
JsonBuilder(
|
||||
PluginManifest(
|
||||
pluginClassName = extension.pluginClassName!!,
|
||||
name = project.name,
|
||||
version = project.version.toString(),
|
||||
authors = extension.authors.get(),
|
||||
sourceUrl = extension.sourceUrl.get(),
|
||||
updateUrl = extension.updateUrl.get()
|
||||
)
|
||||
).toPrettyString()
|
||||
JsonBuilder(project.makeManifest()).toPrettyString()
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue