Skip to content

Check sezpoz#5

Merged
dscho merged 6 commits into
masterfrom
check-sezpoz
Jul 14, 2013
Merged

Check sezpoz#5
dscho merged 6 commits into
masterfrom
check-sezpoz

Conversation

@dscho

@dscho dscho commented May 21, 2013

Copy link
Copy Markdown
Contributor

This should fix the issue that a JDK is needed to run the scijava-common unit tests in Eclipse.

dscho added 6 commits July 14, 2013 12:45
Admittedly, we shut up a few instead of fixing them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is more robust than expecting the 'apt' main class to be available
in the default class path.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
... but fall back to calling the apt class directly if we're not running inside a JDK.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
... instead of calling 'javac' directly.

This is more robust than expecting 'javac' to be in the PATH as long as
we are assuming that the regression tests are run within a JDK -- which
is usually the case because they are run in the context of building
scijava-common.

This fixes http://trac.imagej.net/ticket/1560.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is really a shame, but it seems that all of the following strategies
fail in Eclipse:

- try to figure out where a JDK might be (there might be none)

- try to figure out where Eclipse is and use its APT processing (first,
  we cannot really figure out where Eclipse is when running or debugging
  regular Java classes with a main() method -- with JUnit tests, we could
  at least figure out where Eclipse's JUnit support classes are and hence
  where the current Eclipse is -- and there is no platform-independent
  Java way to enquire the executable path of the parent process of the
  current JVM; second, even then we would have to deal with tons of
  Eclipse-specific things we would have to provide to call Eclipse's APT)

- run Sezpoz' Indexer6 directly (it cannot be run directly, you have to have
  a RoundEnvironment and provide scanners for annotations and classes and
  mirror classes)

The most promising solution to the problem that Eclipse is still unable to
conform to the Java Compiler specification, at this time and age, would have
been to call the Indexer6 directly.

But this developer thinks that the effort required to basically replicate
the complete APT functionality just to run Sezpoz is not worth it: we could
instead tell the developer to get their act together and install a JDK
already (which they need anyway because Eclipse is *not* the gold standard,
the JDK is, so if things compile/run correctly in Eclipse, you *still* have
to test with plain JDK).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This finally takes care of http://trac.imagej.net/ticket/1560.

While we did not really "fix" Eclipse's inability to run annotation
processors as required by the Java Compiler specification, at least
we have warnings in place that tell the developer (insofar competent)
that they are running crippled tests and that they should go and get
a JDK and use it from within Eclipse.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant