I am trying to convert my ant builds to gradle. We currently use flexTasks to compile the flex application through ant. I want to define an ant task in Gradle however it doesn’t seem to like the fact that some of the inner elements of the mxml task are like the following:
<mxmlc fork="true" file="${flex.src.dir}/com/@{name}.mxml" output="${work.dir}/com/@{name}.swf">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${flex.src.dir}"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<compiler.debug>${flex.debug}</compiler.debug>
<compiler.library-path dir="${assets.dir}" append="true">
<include name="**/*.swc" />
</compiler.library-path>
<locale>locale1</locale>
<locale>locale2</locale>
<locale>locale3</locale>
</mxmlc>
When I try to convert this into an ant task this inner xml is in the closure as:
ant.mxmlc(fork:'true', file:'$flexSource/MainApplication.mxml', output:'$flexWorkDir/MainApplication.swf'){
load-config(filename:'$flexHome/frameworks/flex-config.xml')
source-path((path-element):'$flexHome/frameworks')
(compiler.debug): '$flexDebug'
compiler.library-path(dir:flexAssets append:'true'){
include(name:swcPattern)
}
locale: 'locale1'
locale: 'locale2'
locale: 'locale3'
}
When I try to build I get the error:
- What went wrong: Could not compile build file ‘C:\code\artim\artim-ui-cust\build.gradle’. > startup failed:
build file ‘C:\code\artim\artim-ui-cust\build.gradle’: 31: expecting ‘}’, found ‘:’ @ line 31, column 20.
(compiler.debug): ‘$flexDebug’
^