add file size if extension built before json task

This commit is contained in:
C10udburst 2022-08-19 10:12:39 +02:00
parent 964c425973
commit ba11261aac
4 changed files with 5 additions and 1 deletions

View file

@ -37,6 +37,7 @@ abstract class CloudstreamExtension @Inject constructor(project: Project) {
}
internal var pluginClassName: String? = null
internal var fileSize: Long? = null
var requiresResources = false
var description: String? = null

View file

@ -47,6 +47,7 @@ fun Project.makePluginEntry(): PluginEntry {
language = extension.language,
iconUrl = extension.iconUrl,
apiVersion = extension.apiVersion,
tvTypes = extension.tvTypes
tvTypes = extension.tvTypes,
fileSize = extension.fileSize
)
}

View file

@ -8,6 +8,7 @@ data class PluginEntry(
val internalName: String,
val authors: List<String>,
val description: String?,
val fileSize: Long?,
val repositoryUrl: String?,
val language: String?,
val tvTypes: List<String>?,

View file

@ -116,6 +116,7 @@ fun registerTasks(project: Project) {
zip.destinationDirectory.set(project.buildDir)
it.doLast { task ->
extension.fileSize = task.outputs.files.singleFile.length()
task.logger.lifecycle("Made Cloudstream package at ${task.outputs.files.singleFile}")
}
}