Skip to content

Commit 884ad7c

Browse files
committed
Add a main() method to the EclipseHelper
... so that it can be called easily... We will need this for SciJava-common itself, in fact, because the annotation processor is now part of that library, therefore it cannot be called while compiling itself ;-) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent cb594d2 commit 884ad7c

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎src/main/java/org/scijava/annotations/EclipseHelper.java‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,22 @@ else if (file.isDirectory()) {
227227
}
228228
return true;
229229
}
230+
231+
/**
232+
* Updates the annotation index in the current Eclipse project.
233+
* <p>
234+
* The assumption is that Eclipse -- after failing to run the annotation
235+
* processors correctly -- will launch any tests or main classes with a class
236+
* path that contains the project's output directory with the {@code .class}
237+
* files (as opposed to a {@code .jar} file). We only need to update that
238+
* first class path element (or for tests, the first two), and only if it is a
239+
* local directory.
240+
* </p>
241+
*
242+
* @throws IOException
243+
*/
244+
public static void main(final String... args) {
245+
updateAnnotationIndex(Thread.currentThread().getContextClassLoader());
246+
}
247+
230248
}

0 commit comments

Comments
 (0)