BlazeDS 生成的文件导致 Flex 编译器失败
我以前从未使用过 Flash/BlazeDS 或 Ant,如果这太简单了,我很抱歉。
我有一个项目需要为其开发一些 Java 代码。该项目使用Flash 和BlazeDS。对于项目的初始构建,运行一个 Ant 脚本,最终运行我认为是 Flex 编译器(sdk 属性指向 FlashBuilder 4 sdk/4.1.0
目录)。
<exec executable='"@{sdk}/bin/mxmlc.exe"' failonerror="true">
//A bunch of <arg> tags
</exec>
最初运行时没有错误。
我完成了项目设置,其中包括连接到 FlashBuilder 中的 BlazeDS。在设置过程中,更新了一些服务和 valueObject 类(全部以下划线开头)。我相信这些只是 BlazeDS 生成的文件。
此时一切正常。但是,如果我尝试再次运行 Ant 构建脚本,
会失败,并显示以下输出(我涂黑了公司信息)。
根据我在线阅读的内容,Ant
的错误代码是 OS依赖。我使用的是 Windows 7 计算机,我发现了假定的错误代码。但是,错误35并不存在。
有谁知道错误是什么以及如何修复它?我有一个半猜测,问题可能在于我使用的是 FlashBuilder 4.5,并且生成的 BlazeDS 文件有所不同。我尝试更新 SDK 位置以指向 4.5.0 和 4.5.1 文件夹,但没有成功。
I have never worked with Flash/BlazeDS or Ant before, so sorry if this is simplistic.
I have a project that I need to develop some Java code for. The project is using Flash and BlazeDS. For the initial build of the project, an Ant script is run that eventually runs what I believe is the Flex compiler (the sdk attribute points to a FlashBuilder 4 sdk/4.1.0
directory).
<exec executable='"@{sdk}/bin/mxmlc.exe"' failonerror="true">
//A bunch of <arg> tags
</exec>
This initially ran without error.
I finished the project setup, which included connecting to BlazeDS in FlashBuilder. During the setup, some service and valueObject classes were updated (all beginning with underscores). I believe these are just the generated files BlazeDS makes.
Everything works fine at this point. However, if I try to run the Ant build script again, the <exec>
fails, with the following output (I blacked out company info).
From what I read online, the error code from Ant <exec>
is OS dependent. I am on a Windows 7 machine, and I found the supposed error codes. However, error 35 does not exist.
Does any one have an idea of what the error is and how to fix it? I have a semi-guess that maybe the issue lies in that I am using FlashBuilder 4.5 and the generated BlazeDS files are being made different. I've tried updating the SDK location to point to 4.5.0 and 4.5.1 folders, but no luck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不使用 FlexTask(adobe 提供了一个 Ant 任务来包装 mxmlc、compc 和 asdoc 工具)?当贡献的库不受欢迎时我可以理解,但这是 AS3 构建的一种标准。
错误代码是从 mxmlc 返回的,正如您正确指出的那样,mxmlc 是 Adobe Flex 编译器。然而,编译器的返回码是没有意义的。您需要实际的编译器输出(它打印错误类型和位置)。除非你可以正常运行编译器(以不忽略它产生的输出的方式),否则你可能会花几天时间试图找到错误:)如果你坚持使用 exec task,那么 exec 可以将程序的输出重定向到属性或文件。也许将其重定向到属性,然后回显属性的内容?
为什么需要使用 Blaze 生成 AS3 代码?它的代码生成器非常差。自己编写一个实际上可能是更好的举措。
Blaze 不会生成带下划线的类,除非原始 Java 类具有下划线(相当不寻常)。带下划线的类在 Flex 编译器生成的代码中更为常见,例如嵌入式资产、内联 MXML 组件、Flash Builder 生成的其他一些代码等。
Why not use FlexTask (adobe provides an Ant task to wrap mxmlc, compc and asdoc tools)? I can understand it when contributed libraries aren't warmly welcomed, but this one is kind of a standard for AS3 builds.
The error code is returned from mxmlc, which, as you rightly noted is the Adobe Flex compiler. However, the return code from compiler is meaningless. You need the actual compiler output (it prints the error kind and the location). Unless you can run the compiler normally (in the way that the output it produces is not ignored), you may spend days trying to find an error :) If you insist on using exec task, then exec can redirect the output of a program to either property or file. Maybe redirect it to property and then echo out the content of the property?
Why do you need to generate AS3 code using Blaze? It has a very poor code generator. Writing one yourself may actually be a better move.
Blaze doesn't generate classes with underscores, unless the original Java classes have underscores (rather unusual). The classes with underscores are more common in the code generated by Flex compiler for things like embedded assets, inline MXML components, some other code generated by Flash Builder etc.