0

Recently, my work computer was suffering hardware failures so I had the pleasure of migrating data over to a new computer. A project itself is much smaller than the generated output and a significant portion of time was spent moving those generated output.

Currently:

C:\workspace\Project\src\...
C:\workspace\Project\bin\...

Ideally:

C:\workspace\Project\src\...
C:\workspace_output\Project\bin\...

NOTE: For me the source is linked so they don't actually exist within the project.

I was able to change one particular project by following the directions here. However, I have numerous projects and it would be a fairly time-consuming to apply that change to each project (create an "output folder" then point the project to that folder).

Is there a better way to define this behavior within Eclipse? I couldn't find a ${PROJECT_NAME} system variable that I could use (e.g. something like this). I'm fine if the answer is NO as it appears that I have to manually set this for each project. Maybe the next best thing is to write a script to automatically create folders and modify the .project and .classpath.

An alternative like:

  1. Start Eclipse on new machine, point it to the old workspace
  2. Clean projects
  3. Then copy projects onto new machine
  4. Use Eclipse on new machine.

where I can cut out the work of "cleaning" the projects because they are already separate.

Community
  • 1
  • 1
nevets1219
  • 7,692
  • 4
  • 32
  • 47
  • Your "ideal" structure is far from ideal IMO, and not standard at all. Why don't you delete the bin directory before moving your projects? And why do you have to move your projects at all? You should be able to get the sources from your VCS system (Subversion, Git, or whatever). – JB Nizet Mar 24 '14 at 18:31
  • Because the computer suffered hardware failure, I only had access to the HD as raw data. There was uncommitted work which I needed and no way to work with it. A cleanup script is fine but it's work I can skip doing if it's in a separate directory. – nevets1219 Mar 24 '14 at 18:37
  • Additionally, I would argue where I keep the compiled output is somewhat irrelevant as long as it runs. Keeping it away from my projects is just a bonus when I have to move them around. – nevets1219 Mar 24 '14 at 22:14

1 Answers1

0

In general you'd want to use some kind of version control system or source code management, such as cvs, svn, git, Perforce, Visual SourceSafe, etc. Barring that, you can also use File > Export (or right-click on projects) to export a project or group of projects from Eclipse and it will, by default, exclude any derived content (such as compiled code). Then you can import those projects into another Eclipse workspace.

E-Riz
  • 31,431
  • 9
  • 97
  • 134
  • Export "File System"? That was the closest thing I saw but upon trying it, it doesn't seem to work. What I'm looking for is a preemptive solution where I don't have Eclipse running. – nevets1219 Mar 24 '14 at 22:10