0

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

I came back to gradle after not using for couples of years and wanted to compile more modules together But those modules have own settings.gradle, so it looks like gradle considers them fully independent project that can't be mixed. At least I get error when I try.

The example project https://github.com/emeraldpay/polkaj

I add examples to be compiled together

// 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')

But then get errors like

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

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

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

Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • This behavior (modules outside of the project directory) had been deprecated and will go away. Better make a build-pipeline with two steps, then you can let the one depend on the other. – Martin Zeitler Sep 08 '21 at 12:54

1 Answers1