My setup (remember I am 2 days old with gradle!)
wicket application was maven, I made it into gradle to get some experience.
So I need to copy a large textfile during build. The file is a normal txt file. During the processResources phase I get the following error:
Caused by: groovy.lang.GroovyRuntimeException: Failed to parse template script (
your template may contain an error or be trying to use expressions not currently
supported): startup failed:
SimpleTemplateScript5.groovy: 1: String too long. The given string is 813517 Uni
code code units long, but only a maximum of 65535 is allowed.
This seems to be because I have in my build file:
// define the profileProperties. This is basically the profile and properties like in maven
def profileProperties = [
dev:[
dbdriver:"org.apache.derby.jdbc.EmbeddedDriver",
dburl:"jdbc:derby:db/eveasset;create=true",
dbuser:"app",
dbpassword:"app"
],
test:[prop1:"devValue1", prop2:"devValue2"],
prod:[prop1:"prodValue1", prop2:"prodValue2"]
]
// define usedProfile as a global then test if it is set from the command line. If not, then set it to dev
def usedProfile = project.hasProperty("profile") ? project.getProperty("profile"): "dev"
//if (project.hasProperty("profile")) {
// usedProfile = project.getProperty("profile")
//} else {
// usedProfile = 'dev'
//}
task showProfile << {
println usedProfile
}
// Tell processResources to handle this.
processResources{
expand(profileProperties[usedProfile])
}
If I comment out the “processResources” part it works perfectly. Is there a way I can tell gradle to exclude the file from being filtered, but it has to be copied?