Code Cleanup and Gradle Build Fixes

This commit is contained in:
shabinder 2021-05-20 22:24:34 +05:30
parent 60a80a1e94
commit be3ab5fc6f
2 changed files with 3 additions and 23 deletions

View File

@ -35,6 +35,9 @@ allprojects {
useIR = true useIR = true
} }
} }
tasks.withType<org.gradle.jvm.tasks.Jar> {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
afterEvaluate { afterEvaluate {
project.extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.let { kmpExt -> project.extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.let { kmpExt ->
kmpExt.sourceSets.removeAll { it.name == "androidAndroidTestRelease" } kmpExt.sourceSets.removeAll { it.name == "androidAndroidTestRelease" }

View File

@ -1,8 +1,6 @@
package com.shabinder.common.di.worker package com.shabinder.common.di.worker
import co.touchlab.kermit.Kermit import co.touchlab.kermit.Kermit
import com.github.k1rakishou.fsaf.FileManager
import com.github.k1rakishou.fsaf.file.AbstractFile
import java.io.File import java.io.File
/** /**
@ -26,24 +24,3 @@ fun cleanFiles(dir: File, logger: Kermit) {
} }
} catch (e: Exception) { e.printStackTrace() } } 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() }
}