Gradle 1.2: Exclude directory under resources sourceSets
Using Gradle 1.1, this works for me: apply plugin: ‘war’ sourceSets { main { resources { exclude ‘**/test/*’ exclude ‘certs/test’ } } }
Using Gradle 1.1, this works for me: apply plugin: ‘war’ sourceSets { main { resources { exclude ‘**/test/*’ exclude ‘certs/test’ } } }
This way I do custom copying of file assets in my android-gradle build system preBuild.dependsOn copyFiles
For some reason, running gradle in daemon mode causes a null console object. If you specify the appropriate command line flag, ./gradlew assembleRelease –no-daemon it’ll work.
This is my preferred syntax for getting the stdout from exec: def stdout = new ByteArrayOutputStream() exec{ commandLine “whoami” standardOutput = stdout; } println “Output:\n$stdout”; Found here: http://gradle.1045684.n5.nabble.com/external-process-execution-td1431883.html (Note that page has a typo though and mentions ByteArrayInputStream instead of ByteArrayOutputStream)
New: JUnit 5 support in Gradle 4.6 As pointed out in this GitHub issue from Gradle 4.6 onwards JUnit 5 is supported! Official release notes of 4.6 (at the moment of editing the latest, but check the GitHub releases page to make sure you use the latest version) at docs.gradle.org. The old setup will still … Read more
Downloading java dependencies is possible, if you actually really need to download them into a folder. Example: apply plugin: ‘java’ dependencies { runtime group: ‘com.netflix.exhibitor’, name: ‘exhibitor-standalone’, version: ‘1.5.2’ runtime group: ‘org.apache.zookeeper’, name: ‘zookeeper’, version: ‘3.4.6’ } repositories { mavenCentral() } task getDeps(type: Copy) { from sourceSets.main.runtimeClasspath into ‘runtime/’ } Download the dependencies (and their … Read more
Gradle 0.9 allows you to import a build script from another build script. Have a look at: Configuring the project using an external build script. Basically it’s apply from: ‘other.gradle’. One thing the user guide doesn’t mention is that the ‘from’ parameter can be a URL, so you can make your shared scripts available via … Read more
As pointed out by others as well, Volley is officially available on Github: Add this line to your gradle dependencies for volley: compile ‘com.android.volley:volley:1.0.0’ To install volley from source read below: I like to keep the official volley repository in my app. That way I get it from the official source and can get updates … Read more
you can call ./gradlew –stop in a Terminal and it will kill all gradle processes
To execute a task of a specific subproject, specify its task path. For example: gradle :ABC:build The leading : stands for the root project. ABC is the subproject, and build a task in that project.