I have a complex java and flash project using ANT. I converting the project to use gradle instead. Can someone please help in converting the below sample ant target.
<target name="compile-flash">
<mxmlc file="./flash/src/com/test/Some1.as" output="${build.dir}/flash/Some1.swf" debug="${flash.debug}" fork="true" maxmemory="512m">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
<load-config filename="./flash/conf/config1.xml" />
</mxmlc>
<mxmlc file="./flash/src/com/test/editor/Some2.as" output="${build.dir}/flash/Some2.swf" debug="${flash.debug}" fork="true" maxmemory="512m">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
<load-config filename="./flash/conf/config2.xml" />
</mxmlc>
<mxmlc file="${build.dir}/flashtest/flexunitapplication.mxml" output="${build.dir}/flashtest/FlexUnitApplication.swf" debug="true" fork="true">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
<load-config filename="flash/test/flexunit-config.xml" />
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs" />
</compiler.library-path>
<compiler.library-path dir="${test.lib.dir}" append="true">
<include name="swc"/>
</compiler.library-path>
<compiler.library-path dir="flash" append="true">
<include name="lib/test" />
<include name="lib" />
<include name="bin" />
</compiler.library-path>
<compiler.headless-server>true</compiler.headless-server>
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
<compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>
</mxmlc>
<compc output="${build.dir}/swc/client_api_release.swc" incremental="false" benchmark="false" static-link-runtime-shared-libraries="true" compiler.debug="false" debug="false" compiler.optimize="true" compiler.strict="true" compiler.verbose-stacktraces="false" target-player="11.1.0">
<include-sources dir="${generated.actionscript.dir}" includes="**/*.as" />
<compiler.include-libraries dir="${dependencies.lib.dir}/swc/" append="true">
<include name="*.swc" />
<exclude name="*debug*.swc" />
</compiler.include-libraries>
<external-library-path file="${FLEX_HOME}/frameworks/libs/framework.swc" append="true"/>
</compc>
</target>
I know this is not in convention. But I can't change the structure bcoz it is a very old project. And I can't have different modules for different SWF or SWC.
Can someone help me achieving the same result using gradleFX gradle plugin
Thanks in advance.
You will likely want to make usage of Gradle's
UP-TO_DATEchecks so you'll want to set theTaskInputsandTaskOutputsfor each task. It would likely look something likeThis would probably start to get verbose so you might make a custom task so you could do something like
Perhaps someone has even written a gradle plugin to do this for you?