Gradle - 如何一起构建 2 个多模块项目? (或来自其他项目的模块)

Gradle - How to build 2 multimodule projects together? (or a module from other project)

如何同时构建2个多模块项目? (或来自其他项目的模块)

几年没用后我又回到了gradle 并想一起编译更多模块 但是那些模块有自己的 settings.gradle,所以看起来 gradle 认为它们是完全独立的项目,不能混合。至少我尝试时会出错。

示例项目https://github.com/emeraldpay/polkaj

我加例子一起编译

// compiling 6 examples together with the polkaj library
include(':balance')
project(':balance').projectDir = file('./examples/balance')
include(':encoding')
project(':encoding').projectDir = file('./examples/encoding')
include(':keys')
project(':keys').projectDir = file('./examples/keys')
include(':rpc')
project(':rpc').projectDir = file('./examples/rpc')
include(':runtime-explorer')
project(':runtime-explorer').projectDir = file('./examples/runtime-explorer')
include(':types')
project(':types').projectDir = file('./examples/types')

但随后出现类似

的错误

Project 'MyProject' not found in root project 'MyProject'.

Android: Project 'MyProject' not found in root project 'MyProject'

如何一起构建 2 个多模块项目?(或来自其他项目的模块)

这听起来像是复合构建的工作:

https://docs.gradle.org/current/userguide/composite_builds.html

https://docs.gradle.org/current/samples/sample_composite_builds_basics.html