refreshVersions
refreshVersions copied to clipboard
extraArtifactVersionKeyRules not working with sub directory in Windows
Configuring "extraArtifactVersionKeyRules" with a file in a sub directory:
extraArtifactVersionKeyRules(file("gradle/refreshVersions-extra-rules.txt"))
This works just fine using Ubuntu. But when running in Windows, the extra rules are not evaluated (for me).
file("gradle/refreshVersions-extra-rules.txt").exists
returns true - on Windows.
Workaround
Moving the "refreshVersions-extra-rules.txt" file to the project root directory, solved the issue for me.
Did you test in command line?
@jschneider I'm still waiting for your reply.
I am quite sure I build it using the command line ("cmd") on Windows. I am using the workaround - therefore I have no idea if this is still an issue today.
I've come across a variation of this which also appears to not work on Windows. The kmdc project uses a rules file (see sandbox folder) with the content ../versions.rules
. On windows when building this produces the error:
Every artifact version key rule is made of two lines, but an odd count of rules lines has been found.
But when building within the Windows Subsystem for Linux the error does not occur.
Edit: Please ignore this. The issue was that Git on Windows handles symlinks by silently creating new placeholder files (and doesn't provide any warnings it is doing so).