0

My project has a subproject 'core', and way down inside core I want to have a separate subproject 'coercion'. All it has to do is generate one source file and compile it, but it depends on 'core' having been compiled, as the code generator lives there. I want the .gradle file to be called coercion.gradle.

So I tried this in settings.gradle

include 'core'
include "coercion"
project(':coercion').projectDir = file(settingsDir)
project(":coercion").buildFileName = "coercion.gradle"

This gives me an error:

* What went wrong:
Could not select the default project for this build. Multiple projects
in this build have project directory
'/Users/montyzukowski/temboo/development/branches/capella-github-build': 
[root project 'capella-github-build', project ':coercion']

Will it be possible to have coercion.gradle live in a subdirectory of 'core', or will that mess up gradle's dependency analysis?

monty0
  • 1,759
  • 1
  • 14
  • 22

1 Answers1

0

It turns out that the better way to deal with this was very similar to the integrationTest example in samples/java/withIntegrationTests. I created my own sourceSet for the code generator and was able to do everything I need from within the core subproject instead of separating this piece into its own subproject.

monty0
  • 1,759
  • 1
  • 14
  • 22