mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-22 17:14:32 +01:00
Code Cleanup and Gradle Build Fixes
This commit is contained in:
parent
60a80a1e94
commit
be3ab5fc6f
@ -35,6 +35,9 @@ allprojects {
|
||||
useIR = true
|
||||
}
|
||||
}
|
||||
tasks.withType<org.gradle.jvm.tasks.Jar> {
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
afterEvaluate {
|
||||
project.extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.let { kmpExt ->
|
||||
kmpExt.sourceSets.removeAll { it.name == "androidAndroidTestRelease" }
|
||||
|
@ -1,8 +1,6 @@
|
||||
package com.shabinder.common.di.worker
|
||||
|
||||
import co.touchlab.kermit.Kermit
|
||||
import com.github.k1rakishou.fsaf.FileManager
|
||||
import com.github.k1rakishou.fsaf.file.AbstractFile
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
@ -26,24 +24,3 @@ fun cleanFiles(dir: File, logger: Kermit) {
|
||||
}
|
||||
} catch (e: Exception) { e.printStackTrace() }
|
||||
}
|
||||
/**
|
||||
* Cleaning All Residual Files except Mp3 Files
|
||||
**/
|
||||
fun cleanFiles(directory: AbstractFile, fm: FileManager, logger: Kermit) {
|
||||
try {
|
||||
logger.d("Files Cleaning") { "Starting Cleaning in ${directory.getFullPath()} " }
|
||||
val fList = fm.listFiles(directory)
|
||||
for (file in fList) {
|
||||
if (fm.isDirectory(file)) {
|
||||
cleanFiles(file, fm, logger)
|
||||
} else if (fm.isFile(file)) {
|
||||
if (file.getFullPath().substringAfterLast(".") != "mp3" ||
|
||||
fm.getLength(file) == 0L
|
||||
) {
|
||||
logger.d("Files Cleaning") { "Cleaning ${file.getFullPath()}" }
|
||||
fm.delete(file)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) { e.printStackTrace() }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user