Skip to end of metadata
Go to start of metadata

Contents

Build Daffodil Using SBT

Close Eclipse if it is open.

Open a terminal in Linux or the Command Line in Windows.

cd to the root folder of your local daffodil repository.

Run the following commands:

Building From Source
$ sbt updateClassifiers
$ sbt daffodil-cli/updateClassifiers
$ sbt compile
$ sbt test

These commands will generate the 'generated' code, retrieve all necessary libraries, build Daffodil and execute all tests.  At this point Daffodil is built and ready to use.

For more information on working with SBT commands for Daffodil go here.

Build Daffodil Using Eclipse

  1. Follow the directions above in 'Build Daffodil Using SBT'.  This needs to happen to generate the 'generated' code.
  2. Open Eclipse.
  3. From the Menu select Window → Preferences
  4. In Preferences select Scala → Compiler
    1. Under "Additional command line parameters" add the following without quotes: "-language:experimental.macros"
  5. In the Package Explorer select the daffodil-macro-lib project, and click right → Build Project. (to build it first, before others that use the macros).
  6. In the Package Explorer select all of the daffodil projects (click the first project, hold SHIFT, click the last project).  Right-click the first project -> Refresh.
    1. If there are still XML Errors after this you may have to select all daffodil-projects, right click -> Validate.
  7. From the top menu click Project -> Build Project or just check Project -> Build Automatically.
    1. Building automatically may not be the best choice → builds can take a long time.
  8. Once the project is built you can test by opening 'daffodil-core/src/test/scala/' from the Package Explorer.
  9. Expand the dsom package and select the TestDsomCompiler.scala file.  Right-click the file -> Run As -> JUnit Test
  10. At this point, all of the tests should have run successfully.  If so, you are good to go.

NOTE: If you run into build errors: 'missing required library' etc., be sure to build daffodil-macro-lib first, and then all the other projects.  If you have to 'clean-all', then clean all except daffodil-macro-lib. If you accidently clean-all and clean away daffodil-macro-lib, then build that project again first, then everything else.

Hint: keep as few projects open as you can get away with. With all projects closed, if you open the daffodil-test project, you'll see that only some of the other projects open as required by daffodil-test. This should reduce scala compilation time, though it is still long. (Over a minute sometimes.)

 

  • No labels