in FlashProfessional, there is a concept called "Config constants" which get set in the Publish Settings. They can be used for conditional compilation as explained here http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WS3e7c64e37a1d85e1e229110db38dec34-7fa4a.html#WS7D94A7C3-8F91-421a-936C-F076374C470F
Question: how do you set config constants in the FlexBuilder IDE?
Thanks!
Set it in Additional compiler option in the following way: -define+=CONFIG::isRelease,false
Related
For the first time in a .NET Core project I've had to use a conditional compiler directive:
#if DEBUG
// Set something here ...
#endif
I wanted to double check that the DEBUG constant is actually defined for the Debug configuration, since I inherited this project from another dev team and I've learned not to take things for granted. The DEBUG constant isn't defined anywhere in the project file but I see tantalizing hints online that perhaps some default compiler constants are now defined implicitly. For example: https://github.com/dotnet/sdk/pull/565
However, I can't find any documentation about this feature. Can anyone explain how standard compiler constants, like DEBUG, are now defined in .NET Core?
The DEBUG should be defined in VS already. You can find it via the project's properties page on the build tab -> Define DEBUG constant.
And other predefined symbols include the DEBUG and TRACE constants. You can override the values set for the project using #define. The DEBUG symbol, for example, is automatically set depending on your build configuration properties ("Debug" or "Release" mode). More detail information, see C# Conditional compilation
You can so refer the following screenshot:
In Debug mode, and unchecked the "Define DEBUG constant" option:
In Release mode, and unchecked the "Define DEBUG constant" option:
In Debug mode, and checked the "Define DEBUG constant" option:
In Release mode, and checked the "Define DEBUG constant" option:
can phpunit-skelgen used in phpstorm IDE? how?
I am working this way now:
php phpunit-skelgen.phar generate-test Logger C:/Wnmp/html/linhe/tools/logger.php LoggerTest C:/Wnmp/html/linhe/phpunitTest/loggerTest.php
is there better solution?
No, skelgen is not included in PHPStorm (starting from version 7). See https://confluence.jetbrains.com/display/PhpStorm/Creating+PHPUnit+Tests+in+PhpStorm. If you need using it, try configuring it as external tool (Settings/External Tools)
External tool configuration in phpstorm 8.0.2:
Program: /home/myhome/projects/myproject/vendor/bin/phpunit-skelgen
Parameters: generate-test $SelectedText$ $FileDirRelativeToProjectRoot$/$FileName$ $SelectedText$Test tests/$FileDirRelativeToProjectRoot$/$FileNameWithoutExtension$Test.php
You have to select class name and then you can use this external tool
What flags should be set to build multithreading application?
I see that there are QMAKE_CFLAGS_THREAD and QMAKE_LFLAGS_THREAD. I've found this document, there are this flags described, but lacks information how to set them.
I've also found that I should add:
CONFIG += thread
You only need:
CONFIG += thread
This will set up appropriate compiler and linker flags. The _THREAD variables allow you to modify those default flags in case they don't suit you.
However, you shouldn't actually need to even add thread to CONFIG. The default nowadays is to build with threading support anyway.
In the simplest of Flex Projects, create an MXML Flex Module and then load it using the ModuleManager. No problem. Create an ActionScript class that extends Module and then configure your project to compile that into a Module. Load this new module instead. The project compiles, but crashes when running with the following error:
"Error: Could not find compiled resource bundle 'containers' for locale 'en_US'."
I believe the compiler is failing to compile the required class definitions into ActionScript only module, while it succeeds for the MXML module. I can see that my skeleton MXML module is slightly larger than my ActionScript module (66KB vs. 45KB).
How can I resolve this problem (if that is indeed the issue)?
A good approach in these sort of situations is to use -keep-generated-actionscript for two projects, one with the mxml approach, and one with the actionscript approach. You can then compare the code to see what might be missing from one project, but included in another.
Have you tried adding an explicit reference to [ResourceBundle("containers")] to your ActionScript project class? The mxmlc is different to the compc compiler in behaviour for many valid reasons.
I was having this same problem when compiling a library swc. I was able to fix it by adding the following section to the projects projectName-config.xml
<include-libraries append="true">
<library>${flexlib}/locale/{locale}/framework_rb.swc</library>
</include-libraries>
This forces the compiler to include the framework resource bundle for the specified locale.
for me the issue was finding out which project - in my case a library - and which class in this library caused this behavior (I needed to realize my last changes - no info from flashbuilder). Then applying the following attribute to the class:
[ResourceBundle("containers")]
public class IpChecker {
...
That did the trick.
I've written an NUnit test project against an ASP.Net project. The code being tested cannot find the configuration values (in Web.config) when invoked from my test project. What is the right way to provide these configuration settings so my tests will run?
Take a look on NUnit's documentation about Configuration Files - it's pretty good explained how to handle your case.
You can create an app.config file for your test project. Just put the configuration values you need in here.