Moving files within codeblocks project - codeblocks

So this might be outright stupid question, but I found no answer looking on the internet or fiddling with different buttons.
Say you have a project with several physical folders which contain different source files. Now you've decided that you'll create a new folder and move parts of three old ones in there.
In order to do so, I had to do the following:
Go into my project folder via explorer and create a new folder
Manually move all the desired files into that folder
Return to code blocks and remove all the moved files from the project
Re-add all the removed files by selecting the whole new folder when adding existing files
Manually going through code and modifying all affected include directives to point to the proper path
It would be much simpler if you could right-click a folder, create a new nested folder and just drag-and-drop files to where you want them while code blocks would move them on disk and correct the includes for me.
It's the way that Eclipse does it for Java. Is there similar functionality for code blocks, maybe a plugin?

Related

TFS/Visual Studio: Move file in the solution without doing an "add-remove"

We recently had to do some refactoring, implicating that we had too move some files.
So in one branch, we did all thoses changes. In the trunk, we continued to work normally, but it appears that when merging, it causes a lot of troubles, since the files appears as removed on the old position and added to the new, making the merge very hard.
What is the correct way to proceed when moving file in the solution?
If you move a file inside a Project that is "bound" to source control, it should be recognised as a "Move" operation, and not do an Add/Delete. If the project isn't bound it might not work correctly.
If you are moving files between projects, you have to unload the Project/Solution and move the files in Source Control Explorer. This can be a bit tedious as you can only move one file/folder at a time*. Then you have to reload the projects and Exclude the files from the old one and Include them into the new one.
*There is an extension that allows you to move more than one file at one called TFS Source Control Explorer Extension.

I forgot to select option of 'Copy items into destination group’s folder' while adding files from a different project

I copied files from an old Xcode project and used it in my current one. I made a lot of changes in my current project, including in the files copied from the old project. Now I can't run them on another computer without including the old project.
Is there any way I can separate them now ?
I don't want to delete the files and add it again in the project.
Save a copy of the files in their current state. Then remove the references to the files in the new project. Now add the copies you saved off (and choose to copy them). Once done you can delete the copies you made earlier.
But keep in mind that this leaves the files from the original project with all of the changes you have made. Unless you have made proper use of source code control of you have backups, there is no way to revert the files in the old project back to their proper state.

Add a reference to a static folder from visual studio (2010 or 11)

I'd like to include some folders of static files shared between many projects and solutions.
These files could be images, script libraries or css that are shared between many projects.
I do not want to copy each time the folder inside the project structure but reference it just as we can link files between projects in the same solution so if any file changes in the referenced folder all the projects that link to it will have an updated version.
I know I can put it in a shared dll and embed resouces in it but I'd like to be able to choose witch folder to include.
Is this possible with Vs2010 or Vs11?
Sure, its possible, and not even that hard. Put the files in a well-known location in your hard drive, then add them to each project as a link. See the second section in the following article:
http://msdn.microsoft.com/en-us/library/9f4t9t92.aspx
If you use source control, I would strongly encourage you to have at least one separate folder per solution file, and nest the folder under your solution root somewhere. TFS, in particular, gets antsy if your solution file includes locations that are outside the current workspace. (It will work but you may get strange warnings or errors, particularly if someone else tries to get the solution for the first time.)

What is a blue folder in Xcode

I have opened a project from Github, which has blue folders in its file structure.
As far as I understand this is a physical folder reference rather than just a means of grouping files together which might just lay around loosely on your hard drive.
So my question: When do you use those blue folders over the "normal" Group, what are its advantages and drawbacks and how do you create them in Xcode?
If you use blue folder references for your resources these folders will also be created inside your application bundle, while resource files in groups will simply be copied to your mainBundle's root directory.
When folder structure is managed outside of XCode (for example, a cross-platform project which has project files for different versions of XCode, Visual Studio and other IDEs, all using mostly the same directory tree), you normally want folder references. Otherwise one would have to recreate every project file every time folder structure changes.

a few basic xcode questions

what is copy items into destination group's folder (if needed)
is this a good option? If I dont choose it will it just make a reference to my files?
Also if I have two images with the same name like /images/home.gif, /public/home.gif
but they are in different groups how does the compile know which image to use? is this even possible?
I'll have a crack at this :-)
1 & 2 - Used when adding files to a project. If selected, the file you are adding is copied into the projects directory from wherever it originally was. Note it is copied. If not selected, the project can still use it, it just has a reference to the original source file. Which means that if something happens to the original file, the project will not longer have a copy it can use. Personally for files such as images I copy them into the project so they stay with the project. For other things such as external apis, I don't because I don't want multiple copies everywhere.
3 - If you have two images with the same name you won't be able to copy them in without renaming one. XCode may do this for you, I've never tried. I'd suggest renaming one so you control it's name.
4 - Don't get confused by groups. They are logical groupings of files within XCode and do not refer to the underlying file system. Having said that you can actually assign a directory to a group so if you really wanted to you can match the two. I tend to do it a little. In my projects I generally have a src and test directory. I setup two groups and assign them to refer to these directories. Then when I create a new source code file I can create it in the src or test group and it will be created in the sub-directory instead of the project root directory. Often below src and test I will use other groups, but they do not map to any sub directories. The result is that the root directory of the project is free of source code files and the source code also has source and test code separated.

Resources