From 0df1fcdf08288f01fdaad672b86c80b1646f240b Mon Sep 17 00:00:00 2001 From: C10udburst <18114966+C10udburst@users.noreply.github.com> Date: Mon, 8 Aug 2022 12:35:17 +0200 Subject: [PATCH] added apiVersion --- .../lagradost/cloudstream3/gradle/CloudstreamExtension.kt | 2 ++ src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt | 6 ++++-- .../lagradost/cloudstream3/gradle/entities/PluginEntry.kt | 1 + .../cloudstream3/gradle/entities/PluginManifest.kt | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt index 5a68cfa..bee909a 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt @@ -9,6 +9,8 @@ import javax.inject.Inject abstract class CloudstreamExtension @Inject constructor(project: Project) { val userCache = project.gradle.gradleUserHomeDir.resolve("caches").resolve("cloudstream") + val apiVersion = 1 + var apkinfo: ApkInfo? = null internal set diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt index 6fdb7e3..5360878 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/Utils.kt @@ -19,7 +19,8 @@ fun Project.makeManifest(): PluginManifest { return PluginManifest( pluginClassName = extension.pluginClassName, name = this.name, - pluginVersion = this.version.toString() + pluginVersion = this.version.toString(), + apiVersion = extension.apiVersion ) } @@ -41,6 +42,7 @@ fun Project.makePluginEntry(): PluginEntry { authors = extension.authors.getOrElse(listOf()), description = extension.description.orNull, repositoryUrl = (if (repo == null) null else repo.url), - isAdult = extension.adult.getOrElse(false) + isAdult = extension.adult.getOrElse(false), + apiVersion = extension.apiVersion ) } \ No newline at end of file diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/entities/PluginEntry.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/entities/PluginEntry.kt index 459267b..71a0900 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/entities/PluginEntry.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/entities/PluginEntry.kt @@ -10,4 +10,5 @@ data class PluginEntry( val description: String?, val repositoryUrl: String?, val isAdult: Boolean, + val apiVersion: Int ) \ 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 f4a05c5..c176231 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/entities/PluginManifest.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/entities/PluginManifest.kt @@ -3,5 +3,6 @@ package com.lagradost.cloudstream3.gradle.entities data class PluginManifest( val pluginClassName: String?, val name: String, - val pluginVersion: String + val pluginVersion: String, + val apiVersion: Int ) \ No newline at end of file