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

com.likethesalad.stem.modules.common.helpers.dirs.VariantBuildResolvedDir.kt Maven / Gradle / Ivy

Go to download

This is a Gradle plugin for Android applications which resolves XML string references in other XML strings.

There is a newer version: 2.12.0
Show newest version
package com.likethesalad.stem.modules.common.helpers.dirs

import com.likethesalad.stem.providers.ProjectDirsProvider
import com.likethesalad.tools.agpcompat.api.bridges.AndroidVariantData
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import java.io.File

class VariantBuildResolvedDir @AssistedInject constructor(
    projectDirsProvider: ProjectDirsProvider,
    @Assisted androidVariantData: AndroidVariantData
) {
    @AssistedFactory
    interface Factory {
        fun create(androidVariantData: AndroidVariantData): VariantBuildResolvedDir
    }

    companion object {
        val RESOLVED_DIR_BUILD_RELATIVE_PATH = "generated${File.separator}resolved"

        fun getBuildRelativeResolvedDir(variantName: String): String {
            return "$RESOLVED_DIR_BUILD_RELATIVE_PATH${File.separator}$variantName"
        }
    }

    private val variantName by lazy { androidVariantData.getVariantName() }

    val resolvedDir: File by lazy {
        File(projectDirsProvider.getBuildDir(), getBuildRelativeResolvedDir(variantName))
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy