Skip to content

Instantly share code, notes, and snippets.

@Atry
Created September 14, 2013 09:34
Show Gist options
  • Save Atry/6560527 to your computer and use it in GitHub Desktop.
Save Atry/6560527 to your computer and use it in GitHub Desktop.
生成textLayout的Haxe定义,并替换成2.10兼容的语法
--gen-hx-classes
-swf-lib haxelib-release/textLayout.swf
-swf no-output.swf
--no-output
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportFlowElement",true)
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportContainerFormattedElement",true)
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportListItem",true)
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportParagraphFormattedElement",true)
--macro removeField("flashx.textLayout.conversion.BaseTextLayoutExporter","exportList",true)
--macro removeField("flashx.textLayout.elements.FlowElement","abstract")
--macro removeField("flashx.textLayout.elements.FlowLeafElement","text")
--macro removeField("flashx.textLayout.compose.BaseCompose","computeNumberLineAlignment")
#!/bin/bash
find haxelib-release/flashx -name '*.hx' | xargs sed -e 's/\<extends \(I[A-Z]\)/#if haxe3 extends #else implements #end \1/g' -e 's/\<\(implements\|extends\) \([^ #]*\) implements\>/\1 \2 #if haxe #else , #end implements/g' -e 's/\<\(implements\|extends\) \([^ #]*\) implements\>/\1 \2 #if haxe #else , #end implements/g' -e 's/\<\(implements\|extends\) \([^ #]*\) implements\>/\1 \2 #if haxe #else , #end implements/g' -e 's/\<\(implements\|extends\) \([^ #]*\) implements\>/\1 \2 #if haxe #else , #end implements/g' -i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment