Skip to content

Adding a new command

Klortho edited this page Jan 5, 2013 · 3 revisions

Here are the steps to go through to add a new command-line tool to the collection. For the purposes of these instructions, we'll assume the tool is named "dtdexample".

Create command line scripts

  • Copy dtdanalyzerdtdexample and dtdanalyzer.batdtdexample.bat.
  • In each of the new scripts, change one and only one thing: the name of the class file invoked on the java command line: gov.ncbi.pmc.dtdanalyzer.DtdAnalyzergov.ncbi.pmc.dtdanalyzer.DtdExample.
  • Add dtdexample to the list of executable files, in the execfiles property, in build.xml. This ensures that the Unix scripts have execute permissions inside the generated zip files, when releases are done.

Create the executable Java class

  • In src/gov/ncbi/pmc/dtdanalyzer, copy DtdAppTemplate.javaDtdExample.java
  • Modify that class file according to the needs of your app. Use any of the others as examples.

Finish up

  • Write tests and examples in the test directory.
  • Test on both Unix and Windows.
  • Don't forget to add everything to the git repository.
close