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?

4

2 回答 2

3

我使用自定义 bash 脚本能够从子目录运行 gradlew。它在父目录中查找 gradlew 脚本并调用它。使用它,您不需要将 gradlew 脚本复制到子项目目录中。只需将脚本放在您的路径上。该脚本在 github 上可用:https ://gist.github.com/breskeby/5913145

于 2014-08-26T13:14:52.753 回答
2

无需提供此类副本。gradle 包装器的单个副本就足够了,应该放在项目结构的顶部。如果您需要运行位于子项目中的任务,您需要提供此类任务的路径。例如

 gradlew :view:module1:jar
于 2014-08-26T12:57:09.710 回答