Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To develop on Daffodil using Eclipse, you will need Eclipse with the Scala IDE add-ins. Versions from 4.5 (Mars) seem to work acceptablyThe ScalaIDE add-ins are not being maintained however (as of 2021-02-01), and latest version of them is from 2018. However, the ScalaIDE does still work quite well with Daffodil.

  • Downloading the entire ScalaIDE 4.7 (pre-built) works reliably.
  • Loading the ScalaIDE from the update site has been unreliable at creating a real working environment.
    • Specifically: Eclipse 20-12 does not  work with the ScalaIDE update site for ScalaIDE 4.7.

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

The ScalaIDE 4.7 also requires Java 8 (not newer), so Java 8 JDK is a hard requirement.

  • If you are also using other JVM versions or want the default Java to be a newer one, then you can setup the eclipse.ini for ScalaIDE to specifically always use the Java 8 installation.

Setup Eclipse Projects

You will need the sbtEclipse plugin. Version 5.2.4 is known to work.

...

For Daffodil 3.0.0 and older:

  1. Enable the sbt ecilpse plugin by create the file ~/.sbt/1.0/plugins/plugins.sbt  with the following content

    Code Block
    languagescala
    titleplugins.sbt
    addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")


  2. Set the DAFFODIL_HOME environment variable to the directory where you have Daffodil checked out. You can run the following, or put it in configureation file like ~/.bashrc

    Code Block
    export DAFFODIL_HOME="/path/to/daffodil.git"


  3. Run the following sbt command to generate eclipse project files:

    Code Block
    sbt updateClassifiers compile eclipse updateEclipseClasspaths

...


For Daffodil 3.1.0 and newer:

  1. Run the following sbt command to generate eclipse project files:

    Code Block
    sbt updateClassifiers compile eclipse


For all Daffodil versions:

The above This will create an Eclipse .project, .classpath and .settings within each sub-project.

...

  1. First turn off automatic build
    1. Project menu at top, ensure "Build Automatically" is unchecked.
  2. Import all the daffodil projects
    1. File -> Import, Projects from Git, Existing local repository,
    2. select the daffodil directory -> next -> Import existing Eclipse projects -> Next.
    3. All projects should be pre-selected for you. -> Next.
    4. You should now have a collection of project folders displayed in the package explorer.
  3. Fix daffodil-lib (This may be unnecessary. Check it, but 'sbt eclipse' seems to set this up properly.)
    1. resource_managed/main folder: right-click Build-Path → add as source folder.
    2. src_managed/main folder also add as source folder
  4. Fix daffodil-japi: Edit daffodil-japi/.settings/org.scala-ide.sdt.core.prefs
    1. Delete the line that begins with "XPlugin="
    2. Delete the line that begins with "P="
  5. Select and refresh all projects.

...