ru.tinkoff.plugins.buildmetrics.android.utils.AndroidUtils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of build-metrics-android Show documentation
Show all versions of build-metrics-android Show documentation
Extension for tinkoff build metrics gradle plugin.
The newest version!
package ru.tinkoff.plugins.buildmetrics.android.utils
import java.io.File
internal fun findApkFiles(files: List): List = files.flatMap { file ->
if (file.isFile) {
if (file.extension == "apk") {
listOf(file)
} else {
error("File '$file' is not apk.")
}
} else if (file.isDirectory) {
file.walkTopDown().filter { childFile ->
childFile.isFile && childFile.extension == "apk"
}.toList()
} else {
emptyList()
}
}
internal fun findAabFiles(files: List): List = files.flatMap { file ->
if (file.isFile) {
if (file.extension == "aab") {
listOf(file)
} else {
error("File '$file' is not aab.")
}
} else if (file.isDirectory) {
file.walkTopDown().filter { childFile ->
childFile.isFile && childFile.extension == "aab"
}.toList()
} else {
emptyList()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy