This message was deleted.
# android
s
This message was deleted.
n
the best way to do this is to always apply the plugin but the plugin should allow you to configure itself only for a specific build variant.
d
I see, I already ask plugin author about it but seems they not allow this. Do you know how we can get "assembleDebug" from script when we run using command assembleDeb/assembleD?
n
@Doni HaHa, I’ve a good idea, and I’m sure it’s 100 percents work. Use this function will work:
Copy code
gradle.taskGraph.addTaskExecutionGraphListener(new TaskExecutionGraphListener() {
    @Override
    void graphPopulated(TaskExecutionGraph taskExecutionGraph) {
        taskExecutionGraph.allTasks.forEach({
            String taskname = it.name.toString()
            if (taskname.contains("package") && (taskname.endsWith("Debug") || taskname.endsWith("Release"))) {
                // Behaviour
            }
        })
    }
})
I learned this way from my team leader. This is so tricky, right? 😆