Sidharth Sidharth - 9 months ago 46
Groovy Question

How to get the path in build.gradle

I am working on build.gradle in a project directory. i want to know how can I get the path of the directory with one folder back in gradle task

task myTask << {
println file('.')
println projectDir}

This would return me the path which say is
which is current directory

but i want to go to the path

task currentDir << {
    println file('.')
    println projectDir

task previousDir << {
    println file('..')
    println file("$projectDir/..")