Skip to content

Better defaults for MAPTOOL_DATADIR#5981

Open
kwvanderlinde wants to merge 2 commits into
RPTools:developfrom
kwvanderlinde:refactor/5974-data-directory-defaults
Open

Better defaults for MAPTOOL_DATADIR#5981
kwvanderlinde wants to merge 2 commits into
RPTools:developfrom
kwvanderlinde:refactor/5974-data-directory-defaults

Conversation

@kwvanderlinde

@kwvanderlinde kwvanderlinde commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Identify the Bug or Feature request

Resolves #5974

Description of the Change

It is no longer required to provide -DMAPTOOL_DATADIR=.maptool-rptools to store MT data under ~/.maptool-rptools. The ~/.maptool directory will never be used as a default anymore. For situations like test runs, AppUtil will default the data directory to be local to the developmenet directory, under ./run/

The option is still supported, so users can still redirect the data directory to be in another location.

I changed some of the path handling in AppUtil to use Path rather than manipulating and joining String-based or File-based paths.

Possible Drawbacks

Should be none.

Documentation Notes

N/A

Release Notes

  • Changed the default value of the MAPTOOL_DATADIR system property to be .maptool-rptools.

This change is Reviewable

If the user provided it already, we will use the user-provided value. Otherwise, it defaults to `.maptool-rptools`. This
is handled in `LaunchInstructions` before anything else happens.

In `AppUtil`, the default behaviour when MAPTOOL_DATADIR is missing is to create a local directory instead of using the
user's home directory. This covers tests or other development runs that don't go through `LaunchInstructions`.
Operations to resolve paths are now based on `Path` instead of `File` or `String`, and we no longer manually join paths.
The higher-level methods still use `File` as it's not worth changing at this point in time.
@kwvanderlinde kwvanderlinde self-assigned this Jun 18, 2026
@github-actions github-actions Bot added the code-maintenance Adding/editing javadocs, unit tests, formatting. label Jun 18, 2026
@kwvanderlinde kwvanderlinde moved this from Todo to Awaiting-Review in MapTool 1.19 Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-maintenance Adding/editing javadocs, unit tests, formatting.

Projects

Status: Awaiting-Review

Development

Successfully merging this pull request may close these issues.

[Maintenance]: Update coded default for the maptool data directory

1 participant