fun run()

in ruler-common/src/main/java/com/spotify/ruler/common/BaseRulerTask.kt [65:91]


    fun run() {
        val files = getFilesFromBundle() // Get all relevant files from the provided bundle
        val dependencies = provideDependencies() + mapOf(
            "kotlin" to listOf(DependencyComponent("kotlin", ComponentType.INTERNAL))
        ) // Get all entries from all dependencies
        // Split main APK bundle entries and dynamic feature module entries
        val mainFiles = files.getValue(FEATURE_NAME)
        val featureFiles = files.filter { (feature, _) -> feature != FEATURE_NAME }

        // The default component in Gradle is a "fake" application component.
        // In Bazel we already have an application component based on the target name of the app,
        // which we can reuse
        val defaultComponent = dependencies.values.flatten()
            .firstOrNull { it.name == rulerConfig.projectPath }
            ?: DependencyComponent(rulerConfig.projectPath, ComponentType.INTERNAL)

        // Attribute main APK bundle entries and group into components
        val attributor =
            Attributor(defaultComponent, provideStaticDependencies())
        val components = attributor.attribute(mainFiles, dependencies)

        val ownershipInfo = getOwnershipInfo() // Get ownership information for all components
        generateReports(components, featureFiles, ownershipInfo)

        val verificator = rulerConfig.verificationConfig.let(::Verificator)
        verificator.verify(components.values.flatten())
    }