Is there any way to write to the XCode build transcript? What i want to do, is throw a warning if a device is not attached to the computer instead of an assertion failure in my unit test cases (some cases rely on an attached ipod).
I thought of something like the standard compiler warnings (only with custom message).
Thanks.
In shell build phases you can write to stderr using the following format:
<filename>:<linenumber>: error | warn | note : <message>\n
It's the same format gcc uses to show errors. The filename:linenumber part can be omitted. Depending on the mode (error, warn, note), Xcode will show your message with a red or yellow badge.
If you include an absolute file path and a line number (if the error occurred in a file), double clicking the error in the build log lets Xcode open the file and jumps to the line, even if it is not part of the project. Very handy.
Related
We have a project with a Unit Test target that has "Defines Module" enabled, due to a mix of Objective C and Swift. With that setting enabled, syntax highlighting and code completion stops for all non-language items. IE code completion will list language level stuff like NS_ENUM and for loop, but not NSString and not any of our classes.
The same thing happens if I create a new project, set "Defines Module" to YES. Syntax Highlighting and Code Completion fails in the Unit Test Code, set it to NO it starts working again.
We have tried all the usual ways to get things to work, Deleting "Derived Data", Checking/Unchecking "Suggest Completions While typing" and "Enable type-over Completions", deleting "~/Library/Caches/com.apple.dt.Xcode", deleting items in var/folders/, adding some clean up scripts to the post build phase, setting the main target to "Defines Module" as well, and of course endless restarts of Xcode and macOS.
I have repo'd this on 3 different Macs (Sierra) with Xcode 8.3.2 and Xcode 8.2. I have one team member that is not having this issue and the only real difference seems to be that he's still on El Cap.
Here is a list of some of the things we've tried:
Xcode 8 syntax highlighting doesn't work
How to Empty Caches and Clean All Targets Xcode 4
Xcode 8.2 Code Completion Not Working
One Weird Trick to Fix Autocomplete in Xcode
Apple Dev Forums
Has anybody had luck with getting this to work (other than turning off "Defines Module" in the Test Target)? My next step is to file a Radar.
Looks like you have arm64 in your Debug configuration for Valid Architectures. May be because of that you are getting this error. Try removing arm64 on your valid architecture inside debug configuration and try building it.
I'm using Netbeans IDE 8.1 version for MVC (Codeigniter). In Model i'm getting warning like Class Length is 251 Lines (200 allowed).
What is exact meaning of this warning and if not resolved, then what exactly will happen ?
First, this warning is nothing to do with CodeIgniter. NetBeans is simply giving you a friendly advisory warning that your PHP class is more than 200 lines long (251 lines in your case).
Nothing bad will happen if you get that message, but you may or may not appreciate it. Either way, it can be configured as follows:
The message can be suppressed entirely if it is considered unhelpful.
Alternatively, the message can be shown as an "Info", "Warning" or "Error" message. By default it is a warning message.
The number of lines allowed before the message is displayed can be adjusted up or down as desired. The default is 200 lines.
Configure the message as follows:
Tools menu -> Options -> click the Editor icon -> click the Hints tab.
Select PHP from the Language drop list.
Select the Too Many Lines node from the list of message categories, and expand it.
Simply uncheck Class Declaration if you don't want to see the message at all.
Otherwise, select the severity of the message from the Show As drop list, and adjust the default line threshold of 200 if appropriate.
Here's the configuration screen:
Finally, note that these configuration settings are global. I don't believe it is possible to customize the message individually for each PHP project.
I try to write some code... while at it the auto build kicks in (or I just manually build) since this action can take some time, I go on typing...
As soon as the build is done, and when it finds errors it just opens the file of the first error and jumps to the error line where I go on typing there...
Where is the off switch for that feature, please?
#yole was pretty close...
File -> Other Settings -> Default Settings -> Compiler -> Automatically show first error in editor.
Why things has to be so cryptic???
Settings | Compiler | Automatically show first error in editor
In Eclipse, when I make any code changes it automatically shows all compilation errors in the workspace in a console. It seems like in IntelliJ I have to make/build the project in order to see any compilation errors. Is there a window/tab to show all compilation errors?
Nowadays you have the same option as in eclipse to have automatic builds when you save.
Edit
Any changes in the editor will now trigger a compilation either when Ctrl+s is pressed or after a short interval.
This first image will show a main method and a class with a simple print method. No compilation errors.
In the next image I have removed the parameter message in the print method. That's the only thing I did, I did not even save I just waited a couple of seconds. And then suddenly the compilation error is shown below because the caller of the method has now supplied too many arguments.
I'm working with Intellij Idea 10 and Java 6 JDK Update 7. When I run Build --> Rebuild Project command, and the (javac) compilation generates warnings, Idea doesn't display what those warnings exactly are in the Messages view. I just see an "Information: XX warnings" node, but no way to expand it to see the actual warnings. Or I just see a message "Compilation completed successfully with XX warnings" on the status bar. For errors, Idea displays the error information (error message, filename, line number etc.) automatically. How can I get it to work similarly with warnings?
(For the record, I've already tried using additional command line parameters such as -Xlint, but it does not make a difference.)
Make sure that "Hide Warnings" option is disabled in the Messages panel on the left: