The Configure tool

The Configure tool is a Java application that is designed to be run in the build environment to capture and record JNode's build-time configuration settings. The first generation of this tool is a simple command-line application that asks the user questions according to an XML "script" file and captures and checks the responses, and records them in property files and other kinds of file.

The Configuration tool supports the following features:

  • Property types are specified in terms of regexes or value enumerations.
  • Properties are specified in terms of a property name and type, with an optional default value.
  • Property sets are collections of properties associated with files:
    • They are typically loaded from the file, updated by the tool and written back to the file.
    • Properties can be expanded into templates XML and Java source files as well as classic Java properties files.
    • A "FileAdapter" API allows new file formats to be added as plugin classes.
  • Property values are captured in "screens" consists of a sequence of "items" which define the questions that are presented to the user.
    • Each "item" consists of a property name and a multi-line "text" that explains the property to the user.
    • A screen can be made conditional, with a "guard" property that determines whether or not the properties in the screen are captured.
  • A configuration script file can "import" other script files, allowing the configuration process to modularised. All relative pathnames in scripts are resolved relative to the script file that specifies them.

The configuration tool is launched using the "configure.sh" script:

   $ ./configure.sh

When run with no command arguments as above, the script launches the tool using the configuration script at "all/conf-source/script.xml". The full command-line syntax is as follows:

   ./configure.sh
   ./configure.sh --help
   ./configure.sh [--verbose] [--debug] <script-file>

The command creates and/or updates various configuration files, depending on what the script says. Before a file is updated, a backup copy is created by renaming the existing file with a ".bak" suffix.