I am trying to use gradle tasks as kind of "OS agnostic shell-script". I have no problems in writing the logic of the build file, but I would like to be able to run it from any folder.
My first attempt was to put a folder with my build.gradle file on the path, and then try to execute:
gradle myMask
from a folder that doesn't contain build.gradle - but that doesn't work.
My next attempt was:
gradle -b /folder/containing/build.gradle myTask
But that worked only to some extend. In my task I would like to find all files in CURRENT DIRECTORY. current - meaning not the one that contains build.gradle but the one from within which I am executing "gradle ....."
I have tried:
file(".")
and
file("$projectDir")
and some more, but all of them point to the folder containing build script, no the one from which I am executing it.
Any ideas how can I do that?