0

We recently started to migrate from a very old monolithic ant build to gradle. During the setup I realized that the gradle wrapper task only provides a gradlew script for the root project but not for the sub-modules.

Is there a way to also provide "copyies" of this script to the modules that point to the root project gradle directory for the jar?

u6f6o
  • 2,050
  • 3
  • 29
  • 54

2 Answers2

3

I use a custom bash script to be able to run gradlew from subdirectories. It looks in the parent directories for a gradlew script and calls it. Using this, you don't need to copy the gradlew script into the subproject directories. Just put the script on your path. The script is available at github: https://gist.github.com/breskeby/5913145

Rene Groeschke
  • 27,999
  • 10
  • 69
  • 78
2

There's no need to provide such copies. Single copy of gradle wrapper is enough and should be placed on the top of project's structure. If You need to run tasks that are located in subprojects You need to provide a path to such task. E.g.

 gradlew :view:module1:jar
Opal
  • 81,889
  • 28
  • 189
  • 210
  • Thx, I am aware that I can call the submodule tasks like this. It's more intended as a convenient feature for the other developers who atm tend to go to the sub-modules directly and do some ant magic there – u6f6o Aug 26 '14 at 13:25