Sidharth Sidharth - 1 year ago 97
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

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

task previousDir << {
    println file('..')
    println file("$projectDir/..")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download