diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt index d998e89..f5ca43b 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt @@ -21,9 +21,11 @@ abstract class CloudstreamExtension @Inject constructor(project: Project) { internal var pluginClassName: String? = null - val updateUrl: Property = project.objects.property(String::class.java) - val sourceUrl: Property = project.objects.property(String::class.java) + val repositoryUrl: Property = project.objects.property(String::class.java) + val description: Property = project.objects.property(String::class.java) val authors: ListProperty = project.objects.listProperty(String::class.java) + val isAdult: Property = project.objects.property(Boolean::class.java) + val status: Property = project.objects.property(Int::class.java) } class ApkInfo(extension: CloudstreamExtension, release: String) { diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt new file mode 100644 index 0000000..70817d8 --- /dev/null +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt @@ -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 + ) +} \ No newline at end of file diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/entities/PluginManifest.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/entities/PluginManifest.kt index 4441af3..2dd3510 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/entities/PluginManifest.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/entities/PluginManifest.kt @@ -5,6 +5,8 @@ data class PluginManifest( val name: String, val version: String, val authors: List, - val sourceUrl: String?, - val updateUrl: String?, + val repositoryUrl: String?, + val description: String?, + val isAdult: Boolean?, + val status: Int ) \ No newline at end of file diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/DeployWithAdbTask.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/DeployWithAdbTask.kt index eef7e96..daae4d3 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/DeployWithAdbTask.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/DeployWithAdbTask.kt @@ -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() diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt index 6b2b0fe..9360f08 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/tasks/Tasks.kt @@ -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() ) }