I need the build/ folder to be a symbolic link to another file system (100% linux). Is there a way to provide that to hundreds of users via a plugin? If yes, which type of plugin: Init, Settings, or Project?
For the clean task, it already supports followSymlinks = true.
Maybe I can provide a bit of background information. I am replacing a legacy build system, so not all parts are called from Gradle yet. If I could get Gradle to create symbolic links (as part of the overall build system setup) for all the sub-projects build folders, that would be a great step towards migration to Gradle in the long run.
I just need to do it “early enough” in the Gradle build flow, which is why I asked about the type of plugin: Init, Settings, or Project… if that makes sense to ask!
I still don’t see why you cannot just configure the Gradle projects to use that other build directory instead of using a symlink but well, you know your situation better than me.
I guess init or settings plugin would be best, in case some project plugin or build script for whatever reason already does something with it at configuration time.
I think Martin wants to map over (with Linux symlinks) the legacy build structure (which is still in use) and on the other hand start conforming (in his migration) the Gradle build standards.
That sounds like a kind of virtualization/bridging on Linux FS level.
I have been trying such “small steps tricks” - sometimes they work, but generally is it better to take a breath and make a bigger step.
PS.
If I had to try that I would not look for a plugin, which by nature will bring limitations, I would just try with my own set of script methods.
configure the Gradle projects to use that other build directory
It’s not for Gradle. I want Gradle to setup the links for the legacy build system. Right now the flow is:
#!/bin/bash
# Bash function
setup_symlinks
# Call gradle
gradle run_my_task
# Bash function
legacy_build_using_symlinks
I want Gradle to incorporate the symlink setup, so we run Gradle first. But I cannot integrate the legacy system, it’s just too big. So my intermediate step is:
#!/bin/bash
# I want gradle to setup the symlinks
gradle setup_symlinks_and_run_my_task
# Bash function
legacy_build_using_symlinks
I’ll try a Settings plugin, since settings.gradle knows the project structure, that should work.