devRuntimeDir method

Directory? devRuntimeDir({
  1. String? projectDir,
})

.dart_tool/<name>/<runtimeId> under projectDir (the current directory by default), or null when there is no .dart_tool.

A per-project cache for development, so dart test in a checkout works without touching the home directory.

Implementation

Directory? devRuntimeDir({String? projectDir}) {
  final dartTool = Directory(
    _join([projectDir ?? Directory.current.path, '.dart_tool']),
  );
  if (!dartTool.existsSync()) return null;
  return Directory(_join([dartTool.path, name, runtimeId]));
}