Gradle application plugin: Modify workingDir property

大憨熊 提交于 2019-12-06 01:49:44

You can access a property of a task by using tasks.<TaskToModify>.property = YourValue.

So, in this case, you would have to do this:

File runningDir = new File('build/run/')
runningDir.mkdirs()
tasks.run.workingDir = runningDir

The File#mkdirs() call is neccessary, since if the directories do not exist, the call to your system-dependent java executable will cause a error.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!