Xcode creates a duplicate of my project's root folder with build info, how to disable that - xcode8

I'm quite new in iOS development and I'm observing that next to the root folder of my project (let's say its name is 'Foo') another folder is created with a cryptic name (like 'Foo-gobovuchatrabdsdfg...'). In it some information about builds and simulator debugging is stored.
How can stop Xcode creating that folders or if not possible, how can I specify a different path for that folder?

The folder with a cryptic name is your derived data folder, which contains the files Xcode creates when it builds your project. If you don't want the derived data folder inside your project folder, change the derived date folder location to the default location. Refer to the following question to learn how to change the derived data location:
Xcode DerivedData folder

Related

Changing directory on mac affects all files in Xcode Project

I simply wish to change the name of a folder that lies in my root project folder.
I have changed the name of a project (say from Proj1 to Proj2).
I now have a folder on my desktop that reads Proj2. Inside is Proj2.xcodeproj and a folder called Proj1 with all of my source files and resources.
I want to change that folder to be consistent and read Proj1, however if I change it every file in my xCode proj becomes red.
Is there a technique to change this folder within xCode such that I can rename the folder and keep all my files intact with the appropriate structure (such as what groups the files are in)?
It's annoying, indeed.
However, there's no way to keep files on the hard drive (SSD, ..) and group names and the project structure in Xcode in sync automatically.
You can re-assign the locations of the files in your red folders manually to fix it.
Wish Xcode would offer a feature like this since we've switched to Xcode from MW CodeWarrior, but..
After you rename the folder, open the project in Xcode and select this folder. You can choose the renamed folder in the File Inspector Pane.

Something strange with Project Paths in IntelliJ 14.1.4

So, something has started to act weird in my intelliJ project. I even tried removing the iml and .idea data, to no avail.
I go to Project Structure. There, I have a content root. Withing, I have three folders - one for my jar (and jni lib), one for Samples and one for Tools (just tools written to use the jar). The jar, Samples and Tools are marked blue (sources).
In the jar folder, I have my source tree (com\company\projectname\XXX), a lib folder, a folder for my JNI lib and a folder I created call 'junit', which is the focus of this question. It is marked in Project Structure in green (Tests).
Within, I have a folder structure eerily similar to my code: com\company\projectname\junit.
When I open a file in junit\com\company\xxx\junit, I have a big red underline under my package com.company.xxx.junit; line which tells me: "Package name 'com.company.xxx.junit' does not correspond to the file path 'junit.com.company.xxx.junit'.
I was under the impression that marking a folder as 'Tests' would instruct the IDE to use that as a "parent" folder, if you will, eliminating the need to prepend another folder name.
How can I separate the code from unit tests and in fact, create two junit test suites (one is for internal use, the other is a 'skeleton' for distribution), park them under one "umbrella" folder and NOT have to prepend the package names with that folder name?
Update: Project structure:
Based on your screen shot, the issue is that the junit directory is a subdirectory of another source directory, namely MyProvider. A source directory (whether a "production" source or a unit test source directory) cannot be a subdirectory of another source directory.
You need to either:
move the junit directory out of MyProvider so it is a sibling directory, or
unmark MyProvider as a source directory, create a main (or some such directory) in MyProvider, mark it as a source directory, and then move the com directory/package into main.
Option 2 would be the preferred way to deal with this as it follows a very common directory structure standard.
UPDATE (Following comment from OP)
Here's a couple of screenshot showing the configuration you desire:
I removed the .IdeaIC15 folder and started over. Working for now. Something must have gotten confused in the config, either as part of the update, or in the course of operation. I have taken a backup copy as it is now, so if this happens again, I will have something to check.

IDEA: How do I see subdirectories in an empty project?

I wish to use IDEA to edit a directory full of files of no particular type. So, I create a new project of type Empty Project and point it at my directory.
The project view now shows the files in the directory itself. But, it doesn't show any subdirectories. This is very strange.
Even more strangely, I can still use New -> Directory to create a new directory. From the command line I can see that the directory has been created; but, from within IDEA, it's still not appearing.
What's going on here? And, more importantly, how can I actually get it to show me my subdirectories?
This is IntelliJ IDEA 12.1.1. I did find IntelliJ does not show project folders, which sounds similar. But, it is referring to a different version of IDEA and they're not using an Empty Project. So, I don't think it's relevant.
In IntelliJ, you have to create at least one module. As CrazyCoder said in the comments, adding a module sets the root folder of what to display in the Project pane.
Here are steps that I took to show empty folders.
In a terminal window
mkdir one
mkdir one/two
mkdir one/two/three
mkdir one/two/three/four
In Intellij 15.0.2, I created a new project, selected Empty Project and set the Project Location to the one folder.
After creating the project, IntelliJ prompts me with a Project Structure dialog with Modules selected in the navigation tree. I clicked the '+' button in the middle pane to add a module. I chose Static Web as the module type to prevent creation of an additional src folder. I set the Content root and the Module file location of the module to the same one folder.
I clicked Finish and then Ok. This gave me this structure

Wrong Filename for .mom file in momd folder in iOS Build

My team recently renamed the project of an Objective-C iOS app in Xcode and we've determined a larger problem to be the cause of the .mom file within the momd directory to be named wrongly.
Example (not real names):
Our project used to be named "ChinaTown", but was renamed to "Chinatown". Thus inside the Chinatown.momd directory is a ChinaTown.mom file.
How can we ensure that the .mom file within the momd directory is of the correct name and case?
Fixed by recreating the data model and deleting the old one. Reference stackoverflow thread

Auto include/compile source codes using folder reference in XCode4

In XCode4, when we add a new folder which is a folder reference under the Resource folder, the images found under this folder will be automatically copies to the device, no need to add them one by one.
How about for source code?
Is it possible to create a folder reference for the Classes folder, so when I add new source files under this folder in the file system, it will automatically compiled and linked?
Thanks.
The answer is no, something new in a referenced folder doesn't trigger the routine to add the .m file to the Compile Sources build phase, because a folder itself cannot be in that phase. A referenced folder in the resource folder is copied recursively.