<macrodef name="def-rsl">
		<attribute name="rsl-dir"/>
		<attribute name="swc-dir"/>
		<attribute name="swc-name"/>
		<sequential>
			<mkdir dir="@{swc-dir}"/>
			<mkdir dir="@{rsl-dir}"/>
			<delete>
				<fileset dir="@{rsl-dir}">
					<include name="@{swc-name}.swc"/>
				</fileset>
			</delete>
			<unzip src="@{swc-dir}/@{swc-name}.swc" dest="@{rsl-dir}" overwrite="true">
				<patternset>
					<include name="library.swf"/>
				</patternset>
				<mapper type="glob" from="library.swf" to="@{swc-name}.library.swf"/>
			</unzip>
			<exec executable="${FLEX3.SDK_BIN}/optimizer" output="@{rsl-dir}/[email protected]{swc-name}.log" append="true">
				<arg value="+flexlib=${FLEX.SDK_FRAMEWORKS}"/>
				<arg value="--keep-as3-metadata='Bindable,Managed,ChangeEvent,NonCommittingChangeEvent,Transient,Style'"/>
				<arg value="[email protected]{rsl-dir}/@{swc-name}.library.swf"/>
				<arg value="[email protected]{rsl-dir}/@{swc-name}.swf"/>
			</exec>
			<delete file="@{rsl-dir}/@{swc-name}.library.swf"/>
		</sequential>
	</macrodef>