Usage of groovy SimpleTemplateEngine causes failures in gradle parsing long scripts in dependencies.gradle


(Natalia Yastrebova) #1

Hello,

We suffer from the issue related to usage of SimpleTemplateEngine in Gradle which is known by Groovy but not resolved yet.

http://stackoverflow.com/questions/19650956/using-groovy-templateengines-with-large-64k-template http://jira.codehaus.org/browse/GROOVY-3457

Details: we migrate from ant to gradle and provide some additional functionality for developers: we create a full description of dependencies with additional properties like optional, preferred etc and transitive dependencies together with information about repositories. If project contains too many dependencies, this description can be large the 64k.

And when we get error :

script ‘project_name/dependencies.gradle’: 160: String too long. The given string is 95787 Unicode code units long, but only a maximum of 65535 is allowed.

Gradle is unable to parse it due to restrictions in SimpleTemplateEngine and build fails.

We’ve tried to recompile Gradle with GroovyStreamingTemplateEngine (https://github.com/mbjarland/groovy-streaming-template-engine) and this is resolved our problem.

Could you please consider it as replacement of SimpleTemplateEngine? If needed we can provide changes which we made in gradle (we use version 1.11)

Best regards,

Natalia


(Peter Niederwieser) #2

Which usage of SimpleTemplateEngine in Gradle are you referring to?


(Natalia Yastrebova) #3

Hi, Peter,

It was my fault, it’s only groovy issue and not a gradle one.

We will try gradle 2.0 with the newer version of groovy to see if it solves the problem.