gradle-task
How do I extend gradle’s clean task to delete a file?
You just need to use double quotes. Also, drop the << and use doFirst instead if you are planning to do the deletion during execution. Something like this: clean.doFirst { delete “${rootDir}/api-library/auto-generated-classes/” println “${rootDir}/api-library/auto-generated-classes/” } Gradle build scripts are written in Groovy DSL. In Groovy you need to use double quotes for string interpolation (when … Read more
Execute task before Android Gradle build?
You can do it in this way: task build << { println ‘build’ } task preBuild << { println ‘do it before build’ } build.dependsOn preBuild Thanks to that task preBuild will be automatically called before build task. If you want to run preBuild in configuration phase (previous example run preBuild in execution phase) you … Read more
Difference between test and check tasks in Gradle
The Gradle check task depends on the test task which means test is executed before check is run. The documentation states that check performs all verification tasks in the project, including test and also tasks plugins add to the project: If you for example add the checkstyle plugin to your project you can either run … Read more
How to pass arguments from command line to Gradle
project.group is a predefined property. With -P, you can only set project properties that are not predefined. Alternatively, you can set Java system properties (-D).