com.likethesalad.stem.modules.common.helpers.dirs.VariantBuildResolvedDir.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stem-plugin Show documentation
Show all versions of stem-plugin Show documentation
This is a Gradle plugin for Android applications which resolves XML string references in other XML strings.
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