如何在不使用任务的情况下通过Gradle脚本删除jar文件夹中的Java文件?
我像这样删除了'正在存储文件的路径'
但它没有被删除。有人可以帮忙吗
最佳答案
参见http://www.gradle.org/docs/current/userguide/working_with_files.html:
You can locate a file relative to the project directory using the Project.file() method.
file()方法返回File的实例,该实例具有delete()方法。
所以你只需要
file("the/path/of/the/file").delete()
关于gradle - 如何在Gradle脚本中不使用任务删除Java文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21874057/