com.avito.android.network_contracts.configuration.CodegenConfiguration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of network-contracts-root Show documentation
Show all versions of network-contracts-root Show documentation
Collection of infrastructure libraries and gradle plugins of Avito Android project
The newest version!
package com.avito.android.network_contracts.configuration
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
public class CodegenConfiguration(
private val original: Configuration
) : Configuration by original {
internal fun setArtifactsExecutable() {
original.incoming.afterResolve {
it.files.forEach { it.setExecutable(true) }
}
}
public companion object {
public const val NAME: String = "codegen"
public fun getInstance(project: Project): CodegenConfiguration {
val configuration = project.configurations.findByName(NAME)
?: create(project)
return CodegenConfiguration(configuration)
}
private fun create(project: Project): Configuration {
return project.configurations.create(NAME) {
it.isTransitive = false
}
}
}
}
internal val Project.codegenConfiguration: CodegenConfiguration
get() = CodegenConfiguration.getInstance(this)
© 2015 - 2024 Weber Informatics LLC | Privacy Policy