We are migrating from an ant based build to gradle. Our cmd build uses a lot of memory, which we have handled previously by configuring the ANT_OPTS as shown below in bash_profile.
export ANT_OPTS="-Xms128m -Xmx8192m"
When the equivalent Sencha Cmd targets are run via gradle, those memory settings do not appear to be honored/passed when gradle calls Cmd. And the following error occurs:
[INF] Compressing data with YuiJavascriptCompressor
[ERR]
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: Failed to compress input
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
[ERR] pl.java:43)
Running in debug gives us the additional information: Caused by: java.lang.OutOfMemoryError: Java heap space
We have tried a number of different ways to set the proper memory allocation, but none appear to be picked up by cmd. One that should work (IMO) is shown below:
Code:
task ext6ProdReportApp(type: Exec) {
group 'UI'
description 'Build Production Report App'
workingDir 'webroot/ext/workspace/reportApp'
environment JAVA_OPTS: "-Xms128m -Xmx8192m"
if(windows) {
commandLine 'cmd', '/c', senchaPath + '\\sencha.exe', 'app', 'build', senchaTheme, 'production'
} else {
commandLine senchaPath + '/sencha', 'app', 'build', senchaTheme, 'production'
}
inputs.files(senchaFiles)
outputs.dir('webroot/ext/workspace/build/production/reportApp')
}
Has anyone been able to address memory allocation settings getting passed from gradle to cmd? Any thoughts would be appreciated. Cmd 6.2.0.103, Ext 6.0.2.437
Note: setting -Xmx in sencha.vmoptions is picked up, however is not an optimal way to handle multiple build machines, developer machines, etc.