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

com.flyjingfish.android_aop_plugin.AndroidAopPlugin.kt Maven / Gradle / Ivy

Go to download

Lightweight Aop for Android platform, you deserve it, action is worse than your heartbeat

There is a newer version: 2.2.8
Show newest version
package com.flyjingfish.android_aop_plugin

import com.android.build.gradle.AppPlugin
import com.flyjingfish.android_aop_plugin.config.AndroidAopConfig
import com.flyjingfish.android_aop_plugin.plugin.CompilePlugin
import com.flyjingfish.android_aop_plugin.plugin.TransformPlugin
import org.gradle.api.Plugin
import org.gradle.api.Project

class AndroidAopPlugin : Plugin {
    override fun apply(project: Project) {
        project.extensions.add("androidAopConfig", AndroidAopConfig::class.java)
        if (project.rootProject == project){
            project.rootProject.childProjects.forEach { (_,value)->
                value.afterEvaluate {
                    val notApp = !it.plugins.hasPlugin(AppPlugin::class.java)
                    val noneHasAop = !it.plugins.hasPlugin("android.aop")
                    if (notApp && noneHasAop && it.hasProperty("android")){
                        CompilePlugin(true).apply(it)
                    }
                }
            }
        }
        CompilePlugin(false).apply(project)
        TransformPlugin.apply(project)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy