Start the new project

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add the LICENSE.txt file

Generated by 'mvn license:update-project-license'.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a reader to de-serialize JSON-formatted annotation indexes

While we do not have a writer yet, let alone a class to access the
index, this is the first step.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a writer that serializes annotation data in JSON format

So now we have a writer for it all. Actually, we have an abstract base
class that knows how to write annotations, but no code that discovers them
yet.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a real indexer

The DirectoryIndexer class knows how to parse a single class path element
(if it is a plain directory) and writes JSON-formatted annotation indexes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add the @Indexable annotation

All annotations that are meant to be indexed by annindex need to be
annotated by this meta annotation.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a Java 6-compliant annotation processor

This is loosely modeled after the way SezPoz does it, for the obvious
reasons: SezPoz' goals and the goals of this here annotation indexer are
almost the same.

Therefore, this developer learnt a lot from inspecting the source code
of SezPoz' Indexer6 class and then went on to re-implement the part that
inspects the AnnotationMirror instances here.

Since we are building an annotation processor here, we need to switch
off annotation processing during the compilation.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add the Index class to access the annotation indexes

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add an integration test for the annotation processor

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add unit tests

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Verify that inner classes are handled correctly

Test both the directory indexer and the annotation processor (the latter
in the integration test).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Temporarily switch the unit tests to using SezPoz

... to generate legacy annotation indexes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Copy SezPoz-generated annotations for use in the legacy tests

These were generated by "mvn test" and then copying
target/test-classes/META-INF to src/test/resources/legacy/.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Revert "Temporarily switch the unit tests to using SezPoz"

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Refactor the DirectoryIndexerTest to facilitate testing

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement a legacy index reader

Our primary concern is SciJava-common; To maintain backwards
compatibility, we want to support reading annotation indexes created by
SezPoz, just in case one class path component was not switched to the
new annotation indexer yet.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Index: read legacy annotation indexes transparently

We fall back to using legacy annotation indexes now in case no modern
annotation index was found.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a helper for Eclipse

Eclipse is a bit challenged and challenging when it comes to following
the Java standard. For example, in the default mode Eclipse does not run
any annotation processors (as it would be mandated by the Java
specification).

To compensate for this, we simply run a custom annotation processor
whenever we encounter at Index.load() time to handle the case that there
might be some annotation index that is out-of-date.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
EclipseHelper: Support incremental annotation indexing

... which includes removing annotations that are now obsolete...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Index annotations even when running tests in Maven

There is an unfortunate interaction between Eclipse and Maven when the
developer runs the tests using Maven after Eclipse compiled code, failing
to run the annotation processors. The annotation index breaks down in that
case because no annotations got indexed.

Fix this by running the index annotation even when the tests are run from
Maven's surefire plugin (as opposed to from within Eclipse).

This will help us also when merging the annotation indexer into
scijava-common itself, because scijava-common has annotations itself that
need to be indexed, but after the merge, scijava-common itself is the
annotation processor (which needs to be disabled in order to compile
itself because of a chicken-and-egg problem).

While at it, remember which directories we already looked at (and clear
that cache when running the EclipseHelper unit test).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>