package com.gradle

import com.gradle.ares.AresTransform
import com.gradle.ares.CheckParamsTask
import org.gradle.api.Plugin
import org.gradle.api.Project

/**
 * Created by Glen on 2016/9/2.
 * modify by glen
 */
public class AresPlugin implements Plugin<Project> {

    @Override
    void apply(Project project) {
        def task = project.tasks.create("checkParams", CheckParamsTask)
        project.android.registerTransform(new AresTransform(project))
        project.tasks.whenTaskAdded { addTask ->
            if (addTask.name == "packageDebug") {
                task.dependsOn addTask
            }
        }
    }
}
