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
|
internal var pluginClassName: String? = null
|
||||||
|
|
||||||
val updateUrl: Property<String> = project.objects.property(String::class.java)
|
val repositoryUrl: Property<String> = project.objects.property(String::class.java)
|
||||||
val sourceUrl: 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 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) {
|
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 name: String,
|
||||||
val version: String,
|
val version: String,
|
||||||
val authors: List<String>,
|
val authors: List<String>,
|
||||||
val sourceUrl: String?,
|
val repositoryUrl: String?,
|
||||||
val updateUrl: String?,
|
val description: String?,
|
||||||
|
val isAdult: Boolean?,
|
||||||
|
val status: Int
|
||||||
)
|
)
|
|
@ -17,7 +17,6 @@ abstract class DeployWithAdbTask : DefaultTask() {
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun deployWithAdb() {
|
fun deployWithAdb() {
|
||||||
val extension = project.extensions.getCloudstream()
|
|
||||||
val android = project.extensions.getByName("android") as BaseExtension
|
val android = project.extensions.getByName("android") as BaseExtension
|
||||||
|
|
||||||
AdbServerLauncher(Subprocess(), android.adbExecutable.absolutePath).launch()
|
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.getCloudstream
|
||||||
import com.lagradost.cloudstream3.gradle.entities.PluginManifest
|
import com.lagradost.cloudstream3.gradle.entities.PluginManifest
|
||||||
|
import com.lagradost.cloudstream3.gradle.makeManifest
|
||||||
import com.android.build.gradle.BaseExtension
|
import com.android.build.gradle.BaseExtension
|
||||||
import com.android.build.gradle.tasks.ProcessLibraryManifest
|
import com.android.build.gradle.tasks.ProcessLibraryManifest
|
||||||
import groovy.json.JsonBuilder
|
import groovy.json.JsonBuilder
|
||||||
|
@ -66,16 +67,7 @@ fun registerTasks(project: Project) {
|
||||||
}
|
}
|
||||||
|
|
||||||
manifestFile.writeText(
|
manifestFile.writeText(
|
||||||
JsonBuilder(
|
JsonBuilder(project.makeManifest()).toPrettyString()
|
||||||
PluginManifest(
|
|
||||||
pluginClassName = extension.pluginClassName!!,
|
|
||||||
name = project.name,
|
|
||||||
version = project.version.toString(),
|
|
||||||
authors = extension.authors.get(),
|
|
||||||
sourceUrl = extension.sourceUrl.get(),
|
|
||||||
updateUrl = extension.updateUrl.get()
|
|
||||||
)
|
|
||||||
).toPrettyString()
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue