Settings.gradle: Method code too large!


(Jochen Hinrichsen) #1

When migrating a rather largish Maven project to Gradle (“gradle init”), the generated settings.gradle file contains 1500 lines in 220 KiB. Gradle cannot compile this startup file because the JVM has a 64 kb limit on any method.

Is there a way to split up settings files?


(Jochen Hinrichsen) #2

apply from: new File(…) will create separate compilation units and therefore do the trick


(uklance) #3

Can you post a snippet of the settings script?
Approx how many projects in the build?
Is it a single include invocation for all projects?
Or one include per project?

If a single include a fix might be to refactor from

include ':a', ':b', ':c', ':d'

To

include ':a', ':b'
include ':c', ':d'

In chunks of 250 projects

Possibly caused by GROOVY-7367