gradle/groovy: A simple way to check if a gradle task name has been invoked (e.g. “assembleRelease” for Android developers)

If you google for this question, you’ll find a bunch of crap answers about creating tasks and checking the task graph, bullshit. All you need to do is check if a parameter has been passed to gradle. Keep it simple and stupid: [pastacode lang=”java” manual=”boolean%20isAssembleRelease%20%3D%20gradle.startParameter.taskNames.contains(%22assembleRelease%22)” message=”” highlight=”” provider=”manual”/] (If you’re working with an android project, […]