I add a property with -PPROPERTYNAME=/m/abc/def to my build call.
When I try to use the property PROPERTYNAME in my build.gradle the value is magically converted to an absolute file path as I work under Windows and I have a drive with letter “M”. The value is converted to M:/abc/def but I just want to have it unconverted, just as a plain string.
How can I use it as plain string? I did not find a way. I use the Groovy version of the build.gradle script.
That’s actually not a Gradle “problem”.
If you run what you said in a Cygwin shell it works perfectly fine.
If you run it from CMD, it works perfectly fine.
If you run it from PS, it works perfectly fine.
If you run it from Git Bash from Git for Windows, your behavior reproduces, so it is more an MSYS issue and a widely known one.
You can disable that behavior using the environment variable MSYS_NO_PATHCONV=1, so ´MSYS_NO_PATHCONV=1 ./gradlew print -PDIR=/c/tmp` for example outputs what you expect.