All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.tinkoff.plugins.buildmetrics.android.utils.AndroidUtils.kt Maven / Gradle / Ivy

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