AutoDeriv

v1.4.1

Eclipse plugin that handle the derived state of resources from a textual file.


Project maintained by nodj Hosted on GitHub Pages — Theme by mattgraham

AutoDeriv

AutoDeriv is an Eclipse plug-in that handle the 'derived' state of resources from a textual file in a similar way than .gitignore or svn ignore files work.
A file based filtering allows:

The plug-in aims to make all this totally transparent for the end user.
AutoDeriv is able to:


Installation

AutoDeriv is a classic Eclipse plugin, the installation process is also very classic.

First, we need to add the update site location so that eclipse can found the plugin.
Go to: Windows > Preference > Install/Update > Available Software Sites
Click the Add... button, enter the following settings

Then, go to Help > Install new Software > Work with: and select this server.
The plugin should now appear in the list below. Follow the usual install process.


Usage

AutoDeriv works with configuration text files. These configuration files are named .derived and contains a set of rules, one per line, which mark as derived (or as not derived) specific files, or folders, or resources filtered by regex...

The plugin offers two levels of configuration. A per-project  configuration, and a workspace configuration. The difference is just the configuration file emplacement: for each project you want to handle, create a new configuration file directly in the root folder. For a workspace-wide configuration, the .derived file should be located in the workspace root, or in the hidden .metadata folder (itself in the workspace root folder).

.derived file description:

Example

The file .derived in workspace/project/ may look like

# set the 'target' and 'ext' folders as derived
target
ext
# but don't affect the 'keep' sub-folder
!target/keep
# all files with a '.dep' extension are generated
*.dep
src/include/version.h# this specific file is also generated.

This will instantly set the folders ext and target and all its element (files, sub-folders,...) to be considered as derived. The folder target/keep will not be concerned thanks to the exclude rule starting with a ! character. In this example, the file version.h located in src/include will also be derived. This is nice for auto-generated files. There is also a regexp rule (the "*.dep" line) that will mark all the resources with an 'dep' extension as derived.

The previous sample exposes the basics, it is enough for many applications. That being said, AutoDeriv wants to be more flexible. Here are some other rules that can be used.

The root rule

In order not to mess with the workspace, resources which are not subject to a rule have their derived flags manually managed (this is the default Eclipse behavior).

Sometime, it is preferable to have a well determined default status for every resources. To achieve this, prepend a root rule  to your .derived file. A root rule is just a rule that affects the whole project tree by targeting the root folder ( aka / ). This is really useful, every .derived file I wrote starts that way.

# set the 'root' folder as NOT derived
# by doing this, all resources of the project are NOT derived by default.
!/

# other rules follows...

This way, all the resources status will be explicitly set. Note that it is equally possible to set all the resources as derived, but I can't think of a scenario to handle this case...

fnmatch style rules

You may want to filter resources by file extension. For instance, all the .o files of a specific folder should be derived. You can use simple regex to achieve that. Example:

!/         # default status: NOT derived
*.o # object files are a product of compilation, set as derived.
doc/*.html # html files from /doc/are generated. Not all project htmls.

Note: the * matches sequence, the ? character matches exactly one character.

Master conf file

You want a set of rules that is applied to the whole workspace? That is possible thanks to the master conf file. It is a standard .derived file that you put directly on the workspace root.

All the rules written in that file will be considered for every projects, before the local rules.

Decorations

Since v1.3.0, the plugin uses the eclipse decoration system so that you can see instantly which resources are derived, which are not. This is very handy when you write .derived files as you can see the effects as soon as you save the modification.

You may want to disable this in Eclipse preferences. Search for "decoration", or directly go to Windows > Preference > General > Appearance > Label Decorations From there, uncheck the AutoDeriv: decorate derived resources  checkbox. This should disable decoration instantly.

Plug-in configuration

Since v1.4.0, AutoDeriv has its own Preference Page. Many aspects of the plugin are customizable so that you can choose the features you really want, with the design you like.


Preference page


Uninstall

If this plugin doesn't help you, you can obviously uninstall it. Before that, you may want to clear all the attribute it has edited before. In order to do this easily, keep the .derived file, replace the whole content with one single line:

!/    # clear the whole project tree (set root as not derived)

Save the file in order that the update occurs, the whole project should now be clean. You can now delete the .derived file, and uninstall the plugin.

Please let me know if something is wrong, if I can improve the plugin, I'll try my best.


Contribute

If something is wrong, or if you have an idea, a suggestion, you should open and fill an issue or even a pull requests. I'd be glad to add your name to the contributor list!

If this plugin helped you, support it back with a donation! Many things can be improved!

Thank for your help!

-nodj-