简体   繁体   English

HXML文档在哪里?

[英]Where's the HXML docs?

I've looked all over the Haxe Flash Command-line compiler website but was unable to find any detailed documentation of the HXML files (scroll down to the "Changing SWF properties" section) which describe the compile. 我查看了整个Haxe Flash命令行编译器网站,但无法找到HXML文件的任何详细文档 (向下滚动到“更改SWF属性”部分) ,其中描述了编译。

Anybody know of a reference source? 有人知道参考资料来源吗?


Found HXML: 找到HXML:

  • -swf MyApp.swf .... Compile to SWF -swf MyApp.swf .... 编译为SWF
  • -main MyAppClass .... Entry-point Class (.AS file) -main MyAppClass .... 入口点类(.AS文件)
  • -swf-header 200:300:25:FFFFFF .... Width:Height:FPS:BackColor (of SWF) -swf-header 200:300:25:FFFFFF .... 宽度:高度:FPS:BackColor(SWF)

Edit: Scroll down for my answer with the complete list of commands. 编辑:使用完整的命令列表向下滚动我的答案。

Got it! 得到它了! Here's the complete list of HXML / command line Options for the Haxe compiler 以下是Haxe编译器的HXML /命令行选项的完整列表

  • —cp : add a directory to find source files -cp:添加目录以查找源文件
  • —js : compile code to JavaScript file -js:将代码编译为JavaScript文件
  • —as3 : generate AS3 code into target directory -as3:将AS3代码生成到目标目录中
  • —swf : compile code to Flash SWF file -swf:将代码编译为Flash SWF文件
  • —swf9 : compile code to Flash9 SWF file -swf9:将代码编译为Flash9 SWF文件
  • —swf—version : change the SWF version (6 to 10) -swf-version:更改SWF版本(6到10)
  • —swf—header : define SWF header (width:height:fps:color) -swf-header:定义SWF标题(宽度:高度:fps:颜色)
  • —swf—lib : add the SWF library to the compiled SWF -swf-lib:将SWF库添加到已编译的SWF中
  • —neko : compile code to Neko Binary -neko:将代码编译为Neko Binary
  • —php : generate PHP code into target directory -php:将PHP代码生成到目标目录中
  • —x : shortcut for compiling and executing a neko file -x:编译和执行neko文件的快捷方式
  • —xml : generate XML types description -xml:生成XML类型描述
  • —main : select startup class -main:选择启动类
  • —lib : use an haxelib library -lib:使用haxelib库
  • —D : define a conditional compilation flag -D:定义条件编译标志
  • —resource [@name] : add a named resource file -resource [@name]:添加命名资源文件
  • —exclude : don't generate code for classes listed in this file -exclude:不为此文件中列出的类生成代码
  • —v : turn on verbose node -v:打开详细节点
  • —debug : add debug informations to the compiled code -debug:将调试信息添加到已编译的代码中
  • —prompt : prompt on error -prompt:出错时提示
  • —cmd : run the specified command after successful compilation -cmd:成功编译后运行指定的命令
  • ——flash—strict : more type strict flash API --flash-strict:更多类型严格的flash API
  • ——no—traces : don't compile trace calls in the program --no-traces:不编译程序中的跟踪调用
  • ——flash—use—stage : place objects found on the stage of the SWF lib --flash-use-stage:放置在SWF lib的舞台上找到的对象
  • ——neko—source : keep generated neko source --neko-source:保持生成neko源
  • ——gen—hx—classes : generate hx headers from SWF9 file --gen-hx-classes:从SWF9文件生成hx头
  • ——next : separate several haxe compilations --next:分开几个haxe编译
  • ——display : display code tips --display:显示代码提示
  • ——no—output : compiles but does not generate any file --no-output:编译但不生成任何文件
  • ——times : measure compilation times --times:测量编译时间
  • —-no—inline : disable inlining --no-inline:禁用内联
  • ——php—front : select the name for the PHP front file --php-front:选择PHP前端文件的名称
  • ——remap : remap a package to another one --remap:将包重新映射到另一个包
  • —help : Display this list of options -help:显示此选项列表
  • ——help : Display this list of options --help:显示此选项列表

Have you tried: 你有没有尝试过:

haxe --help

.hxml files are just a convenient way to pass commandline parameters as far as I know. 据我所知,.hxml文件只是传递命令行参数的一种方便方法。

For an advanced usage and some tips here is a great article by Andy Li ( https://stackoverflow.com/users/267998/andy-li ) 对于高级用法和一些提示,这是Andy Li的一篇很棒的文章( https://stackoverflow.com/users/267998/andy-li

http://blog.onthewings.net/2013/03/04/hxml-tricks-every-haxe-user-should-know/ http://blog.onthewings.net/2013/03/04/hxml-tricks-every-haxe-user-should-know/


Commenting a hxml file 评论hxml文件

Lines starting with hash (#) won't be treated as arguments. 以hash(#)开头的行不会被视为参数。

#Yay! Comments!

Run project right after compilation 编译后立即运行项目

Use -cmd to run any command line after successful compilation. 成功编译后,使用-cmd运行任何命令行。

#C++
-cpp bin
-main Test
-cmd ./bin/Test

#Flash
-swf Test.swf  
-main Test  
-cmd path/to/FlashDebugger Test.swf

#Neko
-neko Test.n  
-main Test  
-cmd neko Test.n

For Neko target there is special shortcut for building and running -x Test . 对于Neko目标,有一个特殊的快捷方式来构建和运行-x Test

Extra arguments 额外的论点

Appending arguments also works, for example if you want to build debug version 附加参数也有效,例如,如果要构建调试版本

haxe project.hxml -debug

Multiple compilations at once 一次多次编辑

Use --next to separate different target/configuration builds. 使用--next分隔不同的目标/配置构建。 Use --each to apply arguments to every build within hxml. 使用--each将参数应用于--each中的每个构建。

#lib will be used in every '--next' build
-lib jQueryExtern  
--each  

#build MainPage
-js script/MainPage.js  
-main MainPage  
--next  

#build ContactPage
-js script/ContactPage.js  
-main ContactPage  

#build AlbumPage
--next  
-js script/AlbumPage.js  
-main AlbumPage

Including hxmls 包括hxmls

You can further separate different build configurations by creating an hxml for every configuration. 您可以通过为每个配置创建一个hxml来进一步分离不同的构建配置。

client.hxml: client.hxml:

-main Client
-js client.js

server.hxml: server.hxml:

-main Server
-neko server.n

all.hxml: all.hxml:

client.hxml
--next
server.hxml

Builds both: haxe all.hxml 构建两者: haxe all.hxml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM