Gradle custom task which runs multiple tasks

If you need to execute some tasks in predefined order, then you need to not only set dependsOn, but also to set mustRunAfter property for this tasks, like in the following code: task cleanBuildPublish { dependsOn ‘clean’ dependsOn ‘build’ dependsOn ‘publish’ tasks.findByName(‘build’).mustRunAfter ‘clean’ tasks.findByName(‘publish’).mustRunAfter ‘build’ } dependsOn doesn’t define an order of tasks execution, it … Read more

Gradle version 3.3 does not support forTask() method on BuildActionExecuter

I’ve just had the same issue. Fixed it by changing Gradle distributionUrl in “gradle-wrapper.properties”. Here is what I have configured: #Wed Mar 22 16:13:58 BRT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip for more details Offical video to help migaration https://www.youtube.com/watch?v=oBsbI8ICYKg see also comment below from @TmTron

How to change the version of the ‘default gradle wrapper’ in IntelliJ IDEA?

The easiest way is to execute the following command from the command line (see Upgrading the Gradle Wrapper in documentation): ./gradlew wrapper –gradle-version 5.5 Moreover, you can use –distribution-type parameter with either bin or all value to choose a distribution type. Use all distribution type to avoid a hint from IntelliJ IDEA or Android Studio … Read more

How to detect the current OS from Gradle

Actually, I looked at the Gradle project, and this looks a little cleaner as it uses Ant’s existing structure: import org.apache.tools.ant.taskdefs.condition.Os task checkWin() << { if (Os.isFamily(Os.FAMILY_WINDOWS)) { println “*** Windows ” } } I found this in the following Gradle branch, and it seems to work nicely. gradle/gradle-core/branches/RB-0.3/build.gradle

Android Studio: Plugin with id ‘android-library’ not found

Instruct Gradle to download Android plugin from Maven Central repository. You do it by pasting the following code at the beginning of the Gradle build file: buildscript { repositories { mavenCentral() } dependencies { classpath ‘com.android.tools.build:gradle:1.1.1’ } } Replace version string 1.0.+ with the latest version. Released versions of Gradle plugin can be found in … Read more