Slackbot
06/13/2022, 10:02 AMJavi
06/13/2022, 10:03 AMproject.layout.dir(...)
doesn't use the project dir as starting point for the file, right?Javi
06/13/2022, 10:04 AMprovider
project.layout.dir(project.provider { project.file("${project.gitDir}/refs/heads") })
Vampire
06/13/2022, 10:27 AMproject.layout.projectDirectory.dir(...)
results in a directory relative to the project directoryJavi
06/13/2022, 11:53 AMDirectory
?Vampire
06/13/2022, 11:58 AMJavi
06/13/2022, 11:58 AM> Configure project :
D:\Repos\gradle\semver-plugin-playground\.git\index
D:\Repos\gradle\semver-plugin-playground\.git\refs\heads
> Configure project :library-one-a
D:\Repos\gradle\semver-plugin-playground\.git\index
D:\Repos\gradle\semver-plugin-playground\.git\refs\heads
Javi
06/13/2022, 11:59 AM.git
, so I can't use the subproject directory as relative directoryJavi
06/13/2022, 12:00 PMproject.layout.dir(...)
picks whatever you passJavi
06/13/2022, 12:01 PMproject.gitDir
is doing under the hood project.rootDir
to fetch the .git
directoryVampire
06/13/2022, 12:54 PMproject.layout.dir(...)
picks whatever you pass.
I'm not sure how it handles relative paths though.Vampire
06/13/2022, 12:55 PMproject.layout.projectDirectory.dir
would work as it does not change absolute paths.Vampire
06/13/2022, 12:55 PMJavi
06/13/2022, 12:56 PMVampire
06/13/2022, 12:57 PMVampire
06/13/2022, 1:01 PMlayout.projectDirectory.dir(...)
with a known absolute path would have the potential pro that it gives back a Directory
not Provider<Directory>
, but you can of course as well simply call get()
on that.