Skip to content

Instantly share code, notes, and snippets.

@Palatis
Created November 1, 2020 11:48
Show Gist options
  • Save Palatis/9eebbe30a14b6eaef9ca122788c778ab to your computer and use it in GitHub Desktop.
Save Palatis/9eebbe30a14b6eaef9ca122788c778ab to your computer and use it in GitHub Desktop.
gradle ramdisk cache
org.gradle.daemon = true
org.gradle.caching = true
android.buildCacheDir = Z:/gradle/build-cache
def buildDir = 'Z:/gradle/build'
if (!buildDir?.trim())
buildDir = "build"
def configProject(p, buildDir) {
p.buildDir = "${buildDir}/${p.name}"
p.subprojects { s -> configProject(s, "${p.buildDir}") }
}
gradle.projectsLoaded {
if (ext.has("group"))
buildDir += "/${ext.group}"
configProject(rootProject, buildDir)
}
@Palatis
Copy link
Author

Palatis commented Nov 1, 2020

put the files under ~/.gradle/

where Z:/ points to your ramdisk partition.

  • Windows: ImDisk or AMD Radeon(TM) RAMDisk or whatever ramdisk application suitable.
  • Linux: mount a tmpfs partition.
  • Mac OS X: you're on your own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment