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

io.github.gmazzo.codeowners.compiler.CodeOwnersIrGenerationExtension.kt Maven / Gradle / Ivy

The newest version!
package io.github.gmazzo.codeowners.compiler

import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment

internal class CodeOwnersIrGenerationExtension(
    private val mappings: CodeOwnersMappings,
) : IrGenerationExtension {

    override fun generate(moduleFragment: IrModuleFragment, pluginContext: IrPluginContext) {
        mappings.noteFrontedFinished()

        val transformer = CodeOwnersIrTransformer(pluginContext, mappings)

        moduleFragment.accept(transformer, InvalidOwners)
    }

    private data object InvalidOwners : Set by emptySet() {
        override val size: Int get() = error("Invalid owners")
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy