[CodeFactor] Apply fixes

This commit is contained in:
codefactor-io 2022-10-16 08:15:02 +00:00 committed by Cloudburst
parent 711629926e
commit b13e35a442
6 changed files with 10 additions and 10 deletions

View File

@ -16,7 +16,7 @@ abstract class CloudstreamExtension @Inject constructor(project: Project) {
var repository: Repo? = null
internal set
var buildBranch: String = "builds"
fun overrideUrlPrefix(url: String) {
@ -46,7 +46,7 @@ abstract class CloudstreamExtension @Inject constructor(project: Project) {
}
fun setRepo(url: String) {
var type: String? = null
var split = when {
url.startsWith("https://github.com") -> {
type = "github"
@ -69,7 +69,7 @@ abstract class CloudstreamExtension @Inject constructor(project: Project) {
.removePrefix("/")
.removeSuffix("/")
.split("/")
setRepo(split[0], split[1], type)
}

View File

@ -11,7 +11,7 @@ fun Project.makeManifest(): PluginManifest {
require(extension.pluginClassName != null) {
"No plugin class found, make sure your plugin class is annotated with @CloudstreamPlugin"
}
val version = this.version.toString().toIntOrNull(10)
if (version == null) {
logger.warn("'${project.version}' is not a valid version. Use an integer.")

View File

@ -32,7 +32,7 @@ abstract class CompileDexTask : DefaultTask() {
@get:OutputFile
abstract val pluginClassFile: RegularFileProperty
@TaskAction
fun compileDex() {
val android = project.extensions.getByName("android") as BaseExtension

View File

@ -40,7 +40,7 @@ abstract class DeployWithAdbTask : DefaultTask() {
var file = make.outputs.files.singleFile
var path = "/storage/emulated/0/Cloudstream3/plugins/"
device.push(file, RemoteFile(path + file.name))
val args = arrayListOf("start", "-a", "android.intent.action.VIEW", "-d", "cloudstreamapp:")

View File

@ -34,7 +34,7 @@ abstract class MakePluginsJsonTask : DefaultTask() {
.build()
).toPrettyString()
)
logger.lifecycle("Created ${outputFile.asFile.get()}")
}
}

View File

@ -23,7 +23,7 @@ fun registerTasks(project: Project) {
if (project.rootProject.tasks.findByName("makePluginsJson") == null) {
project.rootProject.tasks.register("makePluginsJson", MakePluginsJsonTask::class.java) {
it.group = TASK_GROUP
it.outputs.upToDateWhen { false }
it.outputFile.set(it.project.buildDir.resolve("plugins.json"))
@ -105,7 +105,7 @@ fun registerTasks(project: Project) {
}
it.from(compileDexTask.outputFile)
val zip = it as Zip
if (extension.requiresResources) {
zip.dependsOn(compileResources.get())
@ -121,7 +121,7 @@ fun registerTasks(project: Project) {
task.logger.lifecycle("Made Cloudstream package at ${task.outputs.files.singleFile}")
}
}
project.rootProject.tasks.getByName("makePluginsJson").dependsOn(make)
project.rootProject.tasks.getByName("makePluginsJson").dependsOn(make)
}
project.tasks.register("cleanCache", CleanCacheTask::class.java) {