...
Run Daffodil from the Command Line/Terminal
Windows
In the Windows Command Line (cmd.exe), CD to the root of your local DFDL repository. Default is likely "C:\Users\UserName\git\dfdl".
...
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 |
The script is created in daffodil-core/target/start
To execute daffodil:
Code Block | ||
---|---|---|
| ||
$ .\daffodil-cli\target\start.bat <options> |
...
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 | ||
---|---|---|
| ||
$ .\daffodil-cli\target\start.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 | ||
---|---|---|
| ||
$ .\daffodil-cli\target\start.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!
Linux
The command line of Daffodil is invoked through an autogenerated bash script.
Open a Terminal and cd to the root of your local DFDL repository. Likely "/home/username/git/dfdl".
To generate the script run:
Code Block | ||
---|---|---|
| ||
$ sbt stage |
The script is created in daffodil-core/target/start, to execute daffodil:
Code Block | ||
---|---|---|
| ||
$ ./daffodil-cli/target/start <options> |
To determine the usage, execute the script with the --help option
Code Block | ||
---|---|---|
| ||
$ ./daffodil-cli/target/start --help |
The above should printout information regarding the various options you can run Daffodil with. If it doesn't, please make sure that you've followed all of the steps.
Try this:
Here is the linux variations of the same command (same except slashes are flipped)
Code Block | ||
---|---|---|
| ||
$ ./daffodil-cli/target/start 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
...