我可以让 Flash Builder 在调试和发布模式下编译不同的文件吗?
我想将一些变量设置为不同的值,具体取决于我是在调试模式还是发布模式下进行编译:这可能吗?
无论哪种方式,包含不同的文件或诸如 #DEFINE
之类的内容都可以。
edit
如果不清楚,这必须自动发生:如果我每次编译时都必须手动更改某些内容,那么这是完全没有意义的。这个问题的全部要点是完全不必必须这样做。
- 我编译
DEBUG
-->我已经设置了 [x] - 编译
RELEASE
-->我已经设置了[y]
Another way to see it is: from the program itself, can I detect if it has been compiled in debug or release mode?
I'd like to have some variables set to different values depending if I'm compiling in Debug or in Release mode: is that possible?
Including different files or something like a #DEFINE
would be fine either way.
edit
In case it wasn't clear, this have to happen automatically: if I have to change something by hand every time I compile, it's completely pointless. The whole point of this question is exactly NOT having to do it.
- I compile
DEBUG
--> I have [x] set - I compile
RELEASE
--> I have [y] set
Another way to see it is: from the program itself, can I detect if it has been compiled in debug or release mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里有一些代码,您可以使用它们在运行时检查编译模式:
Here's some code which you can use to check the compile mode at runtime:
您可以使用编译参数将变量传递到 ActionScript。以下内容将在“CONFIG”命名空间中传入名为“debugging”的常量:
您可以在 ActionScript 中创建条件:
另请注意,有一个调试标志可以启用/禁用编译调试信息:
You can pass a variable into ActionScript using a compile argument. The following would pass in a constant named 'debugging' within the 'CONFIG' namespace:
You can than create a conditional in ActionScript:
Also note there is a debug flag to enable/disable compiling debug information: