次のプロジェクト構造があります。
- 応用
- build.gradle
- build.gradle
- settings.gradle
アプリケーション/build.gradle:
apply plugin: 'java'
settings.gradle:
include ':application'
build.gradle:
task custom << {
project.tasks.getByName("build").execute()
}
そこで、タスク「カスタム」内でタスク「ビルド」を実行したいと思います。しかし、「gradle custom」を実行すると、結果は次のようになります。
:custom FAILED
FAILURE: Build failed with an exception.
* Where:
Build file '/tmp/test/build.gradle' line: 3
* What went wrong:
Execution failed for task ':custom'.
> Task with name 'build' not found in root project 'test'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.183 secs
タスク「カスタム」内でタスク「ビルド」を実行するにはどうすればよいですか?