In Eclipse, how can I move all my source files to a different folder without screwing up the project? - eclipse

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?

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.

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.

Related

How to clear the eclipse .project files from maven project

After I import my maven project to eclipse, it created eclipse project files in my maven project. How do I clear them out?
After your comment "if I dont clean the project files, how to I hand it over to someone else? If they dont use eclipse would they be appreciate all those extra files unrelated to the project?" I have understood your need.
The best way to achieve it is to use a version control system (VCS) like git, svn etc. and add inside your project tree a special file call .[VCSofYourChoice]ignore. For example for git this file would be .gitignore for svn it would be .svnignore.
Once you created this file you add rules to exclude files or directories you don't want to share on your version control system of your choice. To find the syntax to use google it with keywords ".[VCSofYourChoice]ignore syntax".
Eclipse and eventually every IDE create specific files, in order to save project structure and other internals. Some of them prompt you to select in which folder you want to save these files, for example IntelliJ, but I am sure eclipse as well. So you every time you use and IDE and you import a project, some files are going to be generated. The cleanest way is to 1) select to save them in a folder not related with the actual project, and as it already suggested do not commit them and add them in an ignore list, on your VCS of choice (e.g git)

Why do projects that I add to my 'workspace' folder don't show up? [ECLIPSE]

I am using Eclipse Indigo, and after having successfully extracted my project folder into my Eclipse workspace, it does not show up in the package explorer. I tried refreshing eclipse and restarting it, to no avail. I am 100% certain my eclipse is using the right directory and the project is in it.
What could be the problem? Thank you.
EDIT: "import projects into workspace" worked for me, but why was that necessary?
Files in the directory are not automatically picked up by the package explorer. You need to import them.
Try using the File > import, then choose
Existing Projects into workspace.
There is a checkbox that says "Copy projects into workspace" which copies it to your workspace if it happens to be in a different folder. If you start with your files in another folder, you'll see how it's copied and set up with configuration files in your workspace directory.
To answer the question, "why is it necessary to import?" you have to realize that the Eclipse workspace is just a logical container for projects, not necessarily the physical container for them.
Also realize that a directory of project-related files does not make an Eclipse Project; Eclipse must be given or generate it's own set of configuration in order to understand a project (minimally, for Java projects, .project and .classpath). Without those, Eclipse has no idea what to do with an arbitrary folder that you call a "project." That's what the Import or Create Project wizards are doing under the covers, generating those config files.

Use eclipse as svn client

Running OSX.
I have used eclipse for years as a Java developer. I am now messing with all kinds of new technologies but still find myself using svn (don't ask its not my descision). Anyways I don't really like SVN command line as I find it almost impossible to sort through merge conflicts.
With that I was thinking about using eclipse (w/ subclipse plugin) as my SVN client whenever I need to do SVN type things. The one problem that I have found is that eclipse loves to create a .project file. I would never want to check this in as no one else is using eclipse. I know that I can add it to svn:ignore, but that has to actually commit that ignore to SVN as well, which I do not want to do either.
Anyway to create eclipse projects without the .project file. I know sounds dumb because I am sure that eclipse needs the .project file for all its projects. Would be nice just to create an SVN project (not Java project) and have eclipse leave off any other crap.
ideas?
There is no way to create an Eclipse project without the .project file (at least none that I know of), but you can tell Eclipse which files to ignore, as well.
Just go to Preferences -> Team -> Ignored Resources and add the pattern .project.
This setting is purely Eclipse-internal and does neither affect your global svn-ignores (defined in ~/.subversion/config) nor will it add any files to the repository.
Also, when checking out folders from SVN using Eclipse, make sure to create a General Project, not a Java Project, so the .project file is the only file Eclipse creates.
.project is actually not the only file that will be generated - depending on the "project natures" you add to a project.
To really separate the project from the source folders, you'll have to create the project in a separate folder - say the workspace - remove the original source folder and add the source folders as external links - see: Project Settings/Java Build Path/Source.

What does "Copy projects into workspace" mean?

When importing a project into Eclipse, there is a checkbox "Copy projects into workspace". I want to know what does this mean. Do I need to select this?
Basically, you want to do this if you want to copy the files of the project you are importing under the workspace folder, and have two copies of the project on your computer at once. This may or may not be what you want to do. In my case it is not what I want to do, as I already have my projects placed in the proper and final location before I import them. My "workspace" folder remains void of project files. This is completely acceptable and is likely what a newcomer to Eclipse working on a test project will want to do. If you are working for someone else, you should ask your employer the setup protocol.
Every project in Eclipse is part of a workspace, which can be any folder, but usually developers keep the workspace folder as a parent to project folders. So, in this context, Eclipse is asking you, if you already have a workspace, whether you want to copy the project you are importing, to that workspace.
I will explain with an example: for my Android work, I have workspace folder called Android-<Product-Name>. In this I have library projects lib1, lib2, and the base Android project (called <product-name>) that uses those libraries. Hope this makes sense.

How To Manually Add Project To Eclipse Without Using Eclipse

I'd like to manually create the folders/files on the file system that create a new project in a workspace in eclipse, and show up in the Project Explorer when eclipse is started and the workspace is selected.
What files would need to be created to do this and where would they need to be?
Please understand that I do not want to open eclipse and make a new project using eclipse. I want to make a new project without using eclipse.
I think you will need to do the following
create a .project file and whatever other files needed by your specific type of project (for example java projects need .classpath) in the project folder, you can find out what you need by looking at those files for another project.
In your workspace .metadata folder, this is where eclipse keeps information about the current workspace, I think the plugin responsible for project definition is .metadata/.plugins/org.eclipse.core.resources , you will need to create those files yourself, some of them are binary, so you will need to open up the source of that plugin to see exactly how it writes them. Depending on your project, you will need to write more .metadata plugin information (for maven for example).
There is no easy way of doing this. Each new project modifies many scattered files throughout the eclipse structure (if you want a list, make a new project and find files created/modified most recently, and/or search for the project name.)
Short of writing the files by hand, there's not much you can do. I found these links in my reseach, but they're both pretty old and seem to be dead ends:
http://www.eclipsezone.com/eclipse/forums/t107019.html
http://dev.eclipse.org/newslists/news.eclipse.tools/msg36546.html
Based on the answers of #shipmaster I think this will work.
Go the workspace and create a new folder as your new required project name.
Copy the contents like .project, .classpath, .includepath etc from any existing project and modify the same like project name, source folder, build folder etc in .project. Do the similar changes in .classpath etc as per the new project requirements.
Unfortunately this is not enough to create a project by just doing eclipse restart so we need to do an import project and point it to this folder and we are ready to use the same now and we see the new project created in eclipse!
try archiving the file .. right click on project ---> export --->archive file(in General section) ..after you archive it as a zip you can import it after.
IF you want to manually copy a pre-existing project to a new workspace,
I have a solution for you:
Copy the project folder.
Paste it into the new work space.
File > Import > General > Existing Project Into Workspace
Eclipse will now see the project you cut+pasted manually.
Why I am doing this:
I am doing this so I can build upon my scrum stories while keeping documentation via working files that each successive step was built upon.
E.g. Story #2 is built upon story#1 code. But I don't want to version them because I want to be able to open them up one after another to do a presentation on my work flow.