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

com.spirytusz.spi.weaver.transform.scan.base.InputScannerDispatcher.kt Maven / Gradle / Ivy

There is a newer version: 0.0.2
Show newest version
package com.spirytusz.spi.weaver.transform.scan.base

import com.android.build.api.transform.TransformInvocation
import com.spirytusz.spi.weaver.transform.data.ServiceImplInfo
import com.spirytusz.spi.weaver.transform.data.ServiceInfo

class InputScannerDispatcher(
    private val incrementalScanner: IInputScanner,
    private val fullScanner: IInputScanner
) : IInputScanner {

    private var incremental = false

    override val serviceMapping: Map>
        get() = if (incremental) {
            incrementalScanner.serviceMapping
        } else {
            fullScanner.serviceMapping
        }

    override fun onReceiveInput(transformInvocation: TransformInvocation) {
        incremental = transformInvocation.isIncremental
        if (transformInvocation.isIncremental) {
            incrementalScanner.onReceiveInput(transformInvocation)
        } else {
            fullScanner.onReceiveInput(transformInvocation)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy