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

Compare with Current View Page History

« Previous Version 11 Next »

Contents

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:

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):

$ 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.

$ 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)

$ 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

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

Click the button circled in red below:

You should now see the following window:

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:

Now select the "Arguments" tab.

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:

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:

-Xms512M -Xmx1512M -XX:+HeapDumpOnOutOfMemoryError

When complete your dialog should resemble the following:

Click Apply.

Click Run.

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

 

 

 

 

  • No labels