Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Eclipse store information about which files are "Derived"?

Tags:

eclipse

When you change the classpath of an Eclipse project, the .classpath file changes so that if you send the project to someone else (including the .classpath file) they have the same classpath. But when you change a resource to "Derived", there is no change in either .project or .classpath. So where is Eclipse storing the information about which files and folders are derived?

Edit: I found this: "currently the derived state is stored in a single bit within a flag integer associated with each resource in the workspace tree file" but if someone could explain more precisely where that flag integer is stored, and how to change it, that would be quite appreciated.

like image 749
Tyler Avatar asked Aug 01 '11 17:08

Tyler


People also ask

Where does Eclipse store project information?

By default projects in Eclipse are stored under your workspace. You get asked where your workspace is created or which one to open whenever you open Eclipse, but you can configure it to not ask you again.

What is derived file in Eclipse?

Derived files are those that have been automatically generated and should not be edited or the changes will be lost next time the files are regenerated. Clearly not all the files in the folder were derived.

How do I view files in Eclipse?

The Eclipse search dialog box allows you to search for files that contain a literal or a character pattern in the entire workspace, a set of projects, a specific project or folders selects in the package explorer view. Clicking on the Search menu and selecting Search or File or Java. Clicking Ctrl + H.


2 Answers

Long discussion on this eclipse bug which requests that derived state is persisted with the eclipse project settings (which can be shared), rather than in the workspace metadata (which can not). The bug is quite old, and remains unaddressed, but there is quite a lot of discussion.

My situation is that I'm generating a lot of java class files as part of an ant build in a workspace directory, and want to mark them as derived so they don't show up in searches. I think the option I will take is probably to adjust my automation so that it marks its generated resources as derived:

IResource.setDerived(true);

The OP's situation seems somewhat different. I'd probably try and base my project's build paths on a variable which each user can define independently, so your .classpath file is the same for all users.

like image 100
Stewart Francis Avatar answered Nov 15 '22 19:11

Stewart Francis


This is not an answer to the question, but something that is directly related what I believe to be the issue at hand. That being the ability to share which files should be derived in a project with others.

Found this plugin to address that: http://nodj.github.io/AutoDeriv/

like image 21
jlb Avatar answered Nov 15 '22 19:11

jlb