In Eclipse, how can I move all my source files to a different folder without screwing up the project?
Solution 1
The project folder has 2 hidden files: .project and .classpath that have all the info of the project. You just need to copy those files along with your project files.
For instance, you have a project folder in workspace/myproject/, and you want to add it to a checkout svn folder, you just need to copy the complete folder content to the checkout and then add all the files to the svn (including the project hidden ones) and finally commit.
From now on, when you checkout from that svn, you will have the eclipse project files, so all you need to do is create new project, and select the option that says that you already have a project folder with the source files (I'm not near an eclipse IDE to tell exactly the steps, but it's something like this). Eclipse will then import the project with all the settings you had previously defined.
I hope that this answers your question.
Solution 2
Try refactoring your project. Rightclick on the folder to move and then choose Refactor->Move. Don't know if this will solve your problem but it will try to change the references in all projects according to the move.
Alejadro Xalabarder
Flash developer / games designer / creative technologist. Learning JAVA and C# + answering Flash / ActionScript questions.
Updated on June 04, 2022Comments
-
Alejadro Xalabarder almost 2 years
I have created my ActionScript source files in a folder on a Mac (I normally use Windows), and somehow managed to make an Eclipse/FDT project that can see them.
I now need to move them into a svn checkout of an existing project to get them under source control.
I just can't work out how you do this without losing all references in the project.
I'm new to Eclipse and don't really understand any of the terminology (e.g. workspace). Does Eclipse have project files or are they all hidden? Can the project file be moved?
Help me stackoverflow, you're my only hope.
Update: From the FDT Flash Explorer window I can only seem to be able to move files/folders within projects that exist. Should I create a new project in the place I want first?
Should I move them from within Eclipse or from the file system? Do I need to setup a new workspace afterwards?
-
Alejadro Xalabarder about 15 yearsFrom the FDT Flash Explorer window I can only seem to be able to move it within projects that exist. Should I create a new project in the place I want first?
-
Alejadro Xalabarder about 15 yearsand why would it HIDE your project files?!
-
Tuy Sotheara about 15 yearsbecause those files are just for eclipse to know which files are included in your project... You can open up a terminal go to your project directory and type "ls -a" .. it will show the hidden files.
-
Alejadro Xalabarder about 15 yearsShould I move them from within Eclipse or from the file system? Do I need to setup a new workspace?
-
Tuy Sotheara about 15 yearsno there's no need to create a new workspace. Just make sure that the hidden files are always there, and eclipse will be able to restore your project when importing the folder.
-
Alejadro Xalabarder about 15 yearsyou never said I should import the folder. I think you may have miswed out some vital steps in your answer. Bear in mind I am a total newb.
-
boutta about 15 yearsYou could try that, but I'm not sure of all the steps you mentioned.
-
Blaisorblade over 13 yearsA problem with this approach is that you lose all general settings stored in your workspace, i.e. all Eclipse configuration settings not related to a specific project.