You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

This page covers miscellaneous topics about configuring the Eclipse IDE for work with Daffodil (or generally).

General

To develop on Daffodil using Eclipse, you will need Eclipse with the Scala IDE add-ins. Versions from 4.5 (Mars) seem to work acceptably.

You will need the Java SDK (not just the JRE), and Daffodil requires Java 8 (aka 1.8) at least.

The daffodil tree includes a sub-directory called eclipse-projects. These can all be imported to Daffodil

An Eclipse 'Linked Resource' named DAFFODIL_ROOT must be defined to be the path to the clone of the git repository for Daffodil.

These projects are all set up to use a common lib_managed project directory that is an Eclipse link to the DAFFODIL_ROOT/lib_managed which is populated using sbt. See the note below about "pre-build with sbt".

Pre-build with sbt to Retrieve Libraries

Before starting Eclipse, you must issue the 'sbt updateClassifiers compile' command. This pulls down all libraries needed, and puts them into lib_managed where the eclipse projects are setup to find them. This also pulls down all the source and javadoc jars for convenient access. The compile command forces some code-generator steps to run which create source code in the daffodil-lib module.

Build Macro Lib First

Before building the rest of the Daffodil modules, you must first build daffodil-macro-lib. This defines macros that are used in the other modules.

Eclipse Settings for DFDL Schema Authoring/Editing

The Eclipse IDE can be used to assist a user in the authoring of DFDL schemas.

DFDL extends a subset of XML Schema. Note however: an XML Schema is an XML document.

There are XML-Schema-Aware editors. So, if you have an editor that is aware of the XML Schema of an XML document, then that editor can provide intelligent assistance in authoring the XML document. It can show you the XML source code, or can show you diagrammatic ways of examining the document.

Now, turns out there is an XML Schema for DFDL Schemas. It was created by taking the XML Schema for XML Schemas, and subsetting it to just what DFDL uses, and then adding into it the XML Schema for DFDL's annotation objects.

Since there is an XML Schema for the XML Documents that just happen to be DFDL Schemas, an XML aware editor can provide assistance in authoring DFDL Schemas.

This section contains instructions for setting up the Eclipse Integrated-Development-Environment (IDE), and to configure it's XML editing features so that they provide some level of support for authoring DFDL schemas. In theory, based on this, if you have some other favorite XML-Schema-Aware editing environment, you could figure out how to enable it to provide you similar DFDL schema authoring assistance.

The XML settings all assume you have installed Eclipse's XML support. Given an Eclipse update site for your version of Eclipse, the  "Eclipse XML Editors and Tools" software is what you need, and what this page is referring to for XML settings.

(Caveat: The menu locations often vary from one Eclipse release to the next.)

Following are steps to modify the eclipse XML settings to aid in the creation of DFDL schemas:

  1. Window > Preferences > Validation
    1. turn off XML Schema Validator
    2. turn off DTD Validator and HTML Validator
    3. click the ... settings box to the right of XML Validator
      1. Select Include Group
      2. Click Add Rule
      3. Select File Extension
      4. Click Next
      5. Add extensions tdml
      6. Click Finish
      7. Repeat steps i-vi, replacing tdml with dfdl.xsd
  2. Window > Preferences > General > Content Types
    1. Select Text > XML
    2. Click Add...
    3. Set Content type to *.dfdl.xsd
    4. Repeat steps b-c with content type set to *.tdml
  3. Window > Preferences > XML > XML Files > Editor
    1. Uncheck Format comments

Graphics Problems on Linux/Fedora

 See content...

The problems I was having:

Windows/buttons/bars missing.

Frequent errors to where it would state something about SWT and recommend restarting Eclipse.

Window would go black and render Eclipse unusable until you quit and restart it.

Odd additional "DragPlaceholder" tabs added each and every time Eclipse would crash.

Below is the fix.

Whatever you use to execute eclipse, you have to add the following statement: export SWT_GTK3=0

https://bugs.eclipse.org/bugs/show_bug.cgi?id=497705

I added that export line to the script I use to launch my Eclipse and it fixed all of my issues.

You have the choice of either adding it to your /usr/share/applications eclipse.desktop file:

Exec=env SWT_GTK3=0 /bin/eclipse

Or adding it to whatever script you use to launch eclipse, which in my case is:

#!/bin/bash

export ECLIPSE_HOME="/home/username/Programs/eclipse"

export SWT_GTK3=0

$ECLIPSE_HOME/eclipse $*

I'd tried adding the '-Dswt.enable.autoScale=false' line to my eclipse.ini file and that didn't do anything, thus I resorted to altering the script above.

  • No labels