I am implementing a diff package generation task in my project\'s gradle build from the git command line output. Currently I have a method which will give me a list of changed f
My current plan is to split the string
repo/dir/file.java
on the forward slash, and create directories until the last element of the split result
Rather than splitting your string manually, you could try using File.mkdirs():
File newDirectoryStructureParent = new File('some/path/to/parent/dir')
def s = 'repo/dir/file.java'
def newContainer = new File(s, newDirectoryStructureParent).getParent()
newContainer.mkdirs()