import java.nio.file.Path;
import java.nio.file.Paths;
def path1 = ...
def path2 = ...
task hello {
Path pathBase = Paths.get(path1);
Path pathAbsolute = Paths.get(path2);
Path pathRelative = pathBase.relativize(pathAbsolute);
print pathRelative
}
Gradle 取相对路径
点赞
收藏