Versions Compared

Key

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

Contents

Table of Contents
excludeContents

Run Daffodil from the Command Line/Terminal

To run the daffodil you just compiled, you need to generate the start script and invoke it.

To do this, run the sbt command:

Code Block
sbt stage

This creates the jars, doc, and the scripts that start the daffodil CLI from the command line.

They are generated in the daffodil-cli/target/universal/stage/bin directory. (Flip the slashes for the Windows path!)

There is a bash script for Linux (file name is just 'daffodil'), and a Windows script (named 'daffodil.bat').

If you put this directory on your PATH environment variable, then it is convenient to use from the command prompt.

If you have built everything successfully, and setup the PATH, then (e.g., on MS Windows):

Code Block
languagebash
$ daffodil.bat --help

The result of the above command should display several help options for the daffodil program.  If it doesn't, please make sure that you've followed all of the previous steps.

Here's an example that parses data, displaying XML output to the console.

Code Block
languagebash
$ daffodil.bat parse -s daffodil-test-ibm1\src\test\resources\test-suite\tresys-contributed\AB.dfdl.xsd daffodil-test-ibm1\src\test\resources\test-suite\tresys-contributed\AB006.in

If the above executes and prints out an infoset as a result, you've set up everything correctly and you're ready to start using Daffodil!

Here is the linux variations of the same command (same except slashes are flipped)

Code Block
languagebash
$ daffodil parse -s daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB.dfdl.xsd daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB006.in

If the above executes and prints out an infoset as a result, you've set up everything correctly and you're ready to start using Daffodil!

Run Daffodil from Eclipse

Open Eclipse.

Make sure that you are in the Scala Perspective.

Select the project "daffodil-cli"

From the top menu click Run -> Run Configurations

Image Removed

The Run Configurations dialog will appear.  Select "Scala Application" from the left menu.

Image Removed

Click the button circled in red below:

Image Removed

You should now see the following window:

Image Removed

For Name: Replace "New_configuration" with "Daffodil Main".

In the field beneath "Main class" enter "edu.illinois.ncsa.daffodil.Main"

The dialog should look like the following:

Image Removed

Now select the "Arguments" tab.

Image Removed

This is where you can pass in the various options that Daffodil recognizes as well as any JVM arguments you may need.

We're going to start wilth the following settings:

Program arguments:

Code Block
parse -s ../../daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB.dfdl.xsd ../../daffodil-test-ibm1/src/test/resources/test-suite/tresys-contributed/AB006.in

VM arguments:

Code Block
-Xms512M -Xmx1512M -XX:+HeapDumpOnOutOfMemoryError

When complete your dialog should resemble the following:

Image Removed

Click Apply.

Click Run.

After some period of time you'll see the following output:

Image Removed

 

 

 

 Page content removed(obsolete).