Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

避免在多个项目中重复编译同一个HX文件 #6

Open
Atry opened this issue Sep 12, 2014 · 4 comments
Open

避免在多个项目中重复编译同一个HX文件 #6

Atry opened this issue Sep 12, 2014 · 4 comments

Comments

@Atry
Copy link
Contributor

Atry commented Sep 12, 2014

如果项目B依赖于项目A,那么在编译项目A时,应该导出一个类列表文件classes-of-project-A.list,然后在编译项目B时,指定haxe --macro excludeFile("classes-of-project-A.list")以排除已经在项目A中编译过的类。


@Atry
Copy link
Contributor Author

Atry commented Sep 12, 2014

NativeInput的问题已经解决。给Haxe编译器打个补丁即可:https://bitbucket.org/qforce/qforce.bitbucket.org/wiki/%E6%90%AD%E5%BB%BA%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83#markdown-header-haxe


Original Comment By: 博 杨

@Atry
Copy link
Contributor Author

Atry commented Sep 12, 2014

暂时以以下方法解决:

在jsonStream的build.sbt文件加入以下内容


haxeOptions ++= Seq("-lib", "hxparse")

haxeOptions ++= Seq("-lib", "haxeparser")

haxeOptions ++= Seq("--macro", "com.qifun.util.ClassList.save('classes-of-project-json-stream.list')")

haxeOptions in Compile ++= Seq("java.io.NativeInput", "java.io.NativeOutput", "haxe.zip.Huffman")

haxeOptions in CSharp ++= Seq("cs.io.NativeInput", "cs.io.NativeInput")

val commonInclude = Seq("sys.io.FileInput", "sys.io.FileOutput", "haxeparser.HaxeParser")

haxeOptions in CSharp ++= commonInclude

haxeOptions in Compile ++= commonInclude

在entity的build.sbt文件加入以下内容

haxeOptions ++= Seq("--macro", "excludeFile('classes-of-project-json-stream.list')")

可以通过编译 以进行测试


Original Comment By: xiuyu zhang

@Atry
Copy link
Contributor Author

Atry commented Sep 12, 2014

ClassList.save完成之后,还需要修改sbt-haxe,自动生成上述--macro编译器选项。可能还需要把生成的类列表文件打进JAR包。


Original Comment By: 博 杨

@Atry
Copy link
Contributor Author

Atry commented Sep 12, 2014

在编译项目A时,应该使用haxe --macro com.qifun.util.ClassList.save('classes-of-project-A.list')命令行选项。其中com.qifun.util.ClassList是一个Haxe类,提供了save宏。

ClassListExporter应该放到独立的Haxe项目haxe-util中。


Original Comment By: 博 杨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant