Developer's Diary
Software development, with Terry Ebdon
02-Jun-2020 WebDoxy configuration

Config file

In version 1.0.0 run-time behaviour is controlled by three configuration files:

  1. ./config.groovy
  2. ./language.properties
  3. <project path>/<project_name>.cfg

The first two files are the same for every project. The third file is a project-specific Doxygen configuration, that overrides values in the default Doxygen configuration file.

The use of a single config.groovy file has worked fine for the last three years. Project specific files will be needed for the weekly enhancement.

project {
journal {
folders {
annually = true
monthly = true
daily = false
}
}
}

e.g. in the above snippet the folder structure is configured for all projects. But enhancement #12 introduces a new folder structure for weekly projects. This creates a conflict when managing both weekly and daily projects. I could implement a more sophisticated configuration scheme, but it doesn't seem justified. I think I can get away with looking for a project-specific config.groovy, then falling back to the default file if the project file doesn't exist. This will preserve the interface at the cost of some duplicated configuration.

The code will need to be reordered to accommodate this change. In version 1.0.0 config.groovy is loaded before the command is parsed. Also several projects can be referenced in one command. Currently --create, --generate, journal and --stub can process multiple projects. The new --week option should do the same, for consistency.

The config processing will be in a new function, but that's a little smelly. The command handlers are currently methods of the WebDoxy class. An extract class refactoring might be appropriate, pulling the command handlers out into a new class hierarchy. This would simplify WebDoxy.groovy, which, at 366 lines, is a little bloated.

01-JUN-2020 👈 Top of page 👉 03-JUN-2020

© 2020 Terry Ebdon.

Find me coding on GitHub, networking on LinkedIn, answering questions on Stack Exchange and hanging out on twitter.