Eclipse - how to rename project folder (on filesystem) - windows

My workspace filesystem folder is currently C:\work\Eclipse-Workspace_PROJ and my code filesystem folder is C:\work\PROJ.
I want to rename C:\work\PROJ to C:\work\PROJ-1 but last time I renamed it . . . bad things happened.
QUESTION
What are the steps to rename my code filesystem folder without corrupting things?

You can use Move in the context menu of the Navigator view to move the project to a different folder. This will move the project to a different folder without renaming it.
I sometimes get an error message that the move failed, but the only thing I can see is that the root folder at the old project location is not deleted. After deleting it no further problems occurred (Eclipse Neon.1 / 4.6.1).
Note that the Move function in CDT's Project Explorer view cannot do this.
Since your projects are not inside the workspace directory, they are not at their default location. So renaming the project won't rename the folder.

You should always rename things like Projects inside Eclipse using 'Refactor > Rename'.
There are many things in Eclipse that need to know about the rename, refactor will deal with updating them all.
If you are asking about renaming the Workspace folder then you do that outside of Eclipse (with Eclipse not running). Provided all the plug-ins you have installed in Eclipse are written correctly Eclipse should not care what the workspace folder is called.
Take a backup first if you are worried things may go wrong.

The real answer, according to the comments to this SO answer is that CDT doesn't have the ability to move projects on disk. :(

Copy (not move/rename) the directory on the filesystem to the desired new location.
Delete the Eclipse .project file in that new directory
Delete the old project in Eclipse.
Create a new project in Eclipse at the new location.
Delete the old directory from the filesystem.

Related

Moving files within codeblocks project

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?

Visual Studio / Properties / Debug / Working Directory want it permanent but don't want to check in the *.user file

The project setting Debugging / Working Directory in Visual Studio 20015 will be saved by default in the *.user file wich I don't check in in to my repo because it's user specific. Still, I would like to have something other than $(ProjectDir) standing there when I do a clean checkout of my project. Is there an other place to store the Working Directory besides the *.user file?
Edit 1: The original idea is that I have a solution with multiple projects and all the binaries (dlls and exes) created end up in a folder called bin. If I want to debug it, I don't want to always edit the working directory again after a clean checkout.
Edit 2: In a post build step of every project within my solution, I copy the binaries in to the bin folder. If I start one of the executables from within VS, it starts them from the $(ProjectDir) folder, and of course not from the bin folder. This is why it does not find the dlls and why I want to set the working directory. I could change the output directory of my projects but then I get a lot of files ending up in the bin folder I don't want there. I will try it anyway; maybe I missed something. To be continued...
Edit 3: As expected, if I change the output directory to the bin folder, everything works fine except for some extra files that end up there and I don't want that (e.g. *.pbo, which would be okay, *.iobj, *.ipdb, etc.) Maybe that is the price I have to pay, but I don't like it.
So, the question remains: How can I have more control over which file ends up where after a build and still be able to run it from VS without changing the working dir?
The working directory should not have to be the directory that contains your DLLs. In fact, you definitely don't want that to be a requirement for running your application. Not only is it a hugely unexpected failure mode, but it could also be a potential security risk.
Put the required DLLs in the same directory as your application's executable. That's the first place that the loader will look. If necessary, use a post-build event in your library projects to copy them there.
Well since no body can help me I decided that I will change the output directory to the bin folder so VS will start my applications from the correct folder.
And how I can get rid of all the extra files that don't belong there I will find a way later.

How can I move a project in Intellij IDEA CE 14 (OSX) without losing my settings/history?

I've been working on a project for a little while called (for example) work-example in my work directory.
I'm refactoring a bit and want to move the project from ~/code/projects/work/work-example to ~/work/example. However, I've found that I can't move the project directory without loosing everything. Am I just not understanding something very fundamental about IntelliJ?
My searches have all returned how to move projects within the root folder via the refactor function. This is not what I want to do.
I want to just move the entire directory to a different location.
I'm running OSX.
Thanks so much for your time, everyone. :-)
You should be able to move a project folder. IntelliJ stores all project settings inside in .idea folder or in *.ipr, *.iws, *.iml files. Close your IntelliJ move the project folder and then open from a new location and it's done.

Mercurial - Add project which is not within repository folder

I am an inexperienced Mercurial user. I am using VS2010 with Mercurial. I had everything working nicely against a single repository, which contained a solution file and two projects nested within the 'parent' folder. Whenever I changed a file then the commit process would detect the change etc, etc.
Then I added a third project. I added this project in a new folder, where the new folder was a peer of the top-level folder containing the original solution file (with original 2 projects nested within). Although the third project has been added to the solution file, it is not being recognised by Mercurial as 'belonging' to the solution in terms of source control. Indeed, it is not showing as being under source control at all.
How do I add the third project to the same repository, even though it sits 'outside' the original folder which maps to the original Mercurial repository?
Thanks very much.
No, you cannot add anything that is not under the repository root. hg add will abort with X not under root message. Move your files into the repository, or move the repository so that all of your files are under the root (note that this will generate a lot of file moves, and you really shouldn't do that).
I found the best way to manage multiple folders in one repo by just creating a symlink (mklink in windows). I usually work in Visual Studio, so I typically have a code library and a website directory, but they are not in the same parent folder.
You can create a symlink on windows like so:
mklink /J "Target Path" "Source Path"
So I would have a structure like so:
project root
- Code Library
- Solution File
- Web Folder (symlink from locally-hosted website folder)
You should use a different repository for each project. This is because when you do a commit in hg, the commit is for the entire hierarchy, not just the directory (and below) that you are in. For more details have a look at the One last big conceptual difference section of http://hginit.com/00.html

Delete local folder when project is deleted in TFS?

We just started using TFS and it works great. I have one question though, if we delete a folder it's not deleted on my local workspace. We are currently reorganizing a project and I wish to not have heaps of unused folders on my local drive.
Where can I configure this?
Thanks in advance.
In you have the Visual Studio Power Tools (http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f) you can use the command line tools tfpt to clean up all your workspaces.
In a shell window
change directory to your workspace root
type \tfpt.exe treeclean /recurse .
This will remove any file or folder not in source control.
Another solution, which also checks how well your project is put together, is to cut the whole folder and move it elsewhere, then perform a get across the project. This will allow you to check if the project will build or if there are some "magic" DLLs missing. Anything that is missing can be retrieved from the copy of the structure and added into source control.

Resources