Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
jvasileff
7 years agoHelpful | Level 6
Feedback on the new desktop app "ignore files" feature.
@Daphne that's great news! I look forward to trying it out.
But it would also be nice to have a configuration file, like ".dropboxignore", to list paths or patterns to exclude. The reason is that e...
jvasileff
6 years agoHelpful | Level 6
> Dropbox team -- Pelase add a real .dropboxignore w/o reindexing
Ditto. Symbolic links are hacky workarounds with significant downsides, and the xattr approach has problems too.
But for the time being, for Java developers on macs, the code below can be added to `.gradle/init.gradle` to:
- Automatically reconfigure build directories to directories within `~/Downloads/builds` using the default build directory as a template. So, for example, a gradle project `~/Dropbox/Projects/myproject` will build to `~/Downlods/Dropbox/Projects/myproject/build`.
- Automatically create convenience symlinks as necessary. For example, after the build of `myproject`, the following symlink would be created: `~/Dropbox/Projects/myproject/build` -> `~/Downlods/Dropbox/Projects/myproject/build`
The idea is similar to the `node_modules` symlink workaround, but fully automated.
Code to add to `~/.gradle/init.gradle`:
import java.io.File
import java.nio.file.Files
import java.nio.file.LinkOption
def updateBuildPaths(p) {
// change build dir to
// ~/Downloads/builds/DEFAULT_BUILD_PATH_RELATIVE_TO_HOME
def homePath = new File(System.env.HOME).toPath()
def buildBasePath = homePath.resolve("Downloads/builds")
def projectPath = p.projectDir.toPath()
def relativeProjectPath = homePath.relativize(projectPath)
p.ext.defaultBuildDir = projectPath.resolve("build")
p.ext.newBuildDir = buildBasePath.resolve(relativeProjectPath)
.resolve("build")
p.buildDir = p.ext.newBuildDir
// recurse into subprojects
p.subprojects { s ->
updateBuildPaths(s)
}
}
def updateBuildDirSymlinks(p) {
def defaultExists = Files.exists(
p.ext.defaultBuildDir, LinkOption.NOFOLLOW_LINKS)
def newExists = Files.exists(
p.ext.newBuildDir, LinkOption.NOFOLLOW_LINKS)
def linkExists = Files.isSymbolicLink(p.ext.defaultBuildDir) &&
Files.readSymbolicLink(p.ext.defaultBuildDir) == p.ext.newBuildDir
// add symlinks for build directory if possible & necessary
if (!defaultExists && newExists) {
Files.createSymbolicLink(p.ext.defaultBuildDir, p.ext.newBuildDir)
}
// print warning if pre-existing default build file or dir exists but is
// not a link to the new build directory
if (defaultExists && !linkExists) {
println(
"WARNING: unused default build directory exists at '" +
"${p.ext.defaultBuildDir}'; please delete or link to " +
"actual build directory '${p.ext.newBuildDir}'"
)
}
// remove symlinks to non-existent build dirs
if (!newExists && linkExists) {
Files.delete(p.ext.defaultBuildDir)
}
// recurse into subprojects
p.subprojects { s ->
updateBuildDirSymlinks(s)
}
}
gradle.projectsLoaded {
updateBuildPaths(rootProject)
}
gradle.buildFinished {
updateBuildDirSymlinks(rootProject)
}
About Apps and Installations
Have a question about a Dropbox app or installation? Reach out to the Dropbox Community and get solutions, help, and advice from members.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!