This project uses a Git submodule to pull in the Ion test data suite.
You must either clone this project via git clone --recursive
or update
the submodule afterwards via git submodule update --init
. If you don't
do this, the unit tests will fail (obscurely, when run through Maven).
Regardless of whether you use the Oomph installer or the full download, you want to install the "Eclipse DSL Tools" product. This includes the Plug-in Development Tools (PDT) and Xtext features used by this project. The code requires Xtext 2.10; that comes standard with Neon but if you're using Mars you'll need to update those components.
When you import this project into your Eclipse workbench, be sure to enable the Search for nested projects option. Otherwise you'll only get the parent project, which only coordinates the build process, and not the numerous subprojects that contain the actual plugin code.
Most of the plug-in's code is generated by Xtext. When you first open the project, you'll need to generate this code manually.
- Go to Preferences | Plug-in Development | Target Platform and select
software.amazon.ionxtext.target
. - From the
software.amazon.ionxtext
subproject (not the parent project), browse tosrc/software/amazon/ionxtext
. SelectGenerateIon.mwe2
and Run As | MWE2 Workflow. - You'll probably get an error indicating that problems exist in the project, but that's because you've not yet generated necessary code, so proceed.
- You may need to clean all projects to eliminate errors.
You'll also need to do this when you modify various core resources such as the
grammar definition file Ion.xtext
.
If Eclipse is unable to resolve required plugin bundles, you may have a mangled
target platform definition. Go to
Preferences | Plug-in Development | Target Platform, select
software.amazon.ionxtext.target
, and Reload.
If the problem is with classes in software.amazon.ion
(i.e., the ion-java
library), then you've probably not built this project from Maven. That's needed
in order to copy POM-first dependencies from the Maven repository into a local
pom-first-plugins
directory that's linked into the target platform.
- Right-click on the
ionxtext.tests
project and Run As | JUnit Test. - Recommended to mark the resulting Run Configuration as a favorite for easy access at all times.
Do you see Could not initialize class software.amazon.ionxtext.tests.UnitTestUtils
?
It's probably failing to find the iontests
content, which means you forgot
to git submodule init
.
- Right-click on the
ionxtext
project and Run As | Eclipse Application.