Can't Use Absolute Path for installDist

plugins

(Chris Sphinx) #1

I’m trying to use installDist to dump a runnable build to a network drive and every time I give it into 'file:// ... it tries to append that path to the project path. I have tried to overwrite destinationDir property, but it seems it’s missing or has been removed?

distributions.main {
    contents {
        into 'file://C:\\Users\\etc\\etc\\etc'
    }
}

Results in:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':subproject:installDist'.
> Could not normalize path for file 'C:\path\to\workspace\and\project\src\submodule\build\install\subproject\C:'.

(Mark Vieira) #2

I believe all strings are treated as relative paths. You could try something like this:

into(new File('C:\\Users\\etc\\etc\\etc'))

(Chris Sphinx) #3

Actually, the syntax I was using was just fine for a custom Copy or
Sync type task. I remember reading that contents{} closures had the
same methods as a Copy type task, but apparently they aren’t quite the
same?


(Mark Vieira) #4

It should work the same. In the end this CopySpec is just being passed to a regular archive task.


(Chris Sphinx) #5

Anyone look into this? I’m pretty sure it is a bug of some kind …