overrideGeneratedOutputDirectory function

void overrideGeneratedOutputDirectory(
  1. String path
)

Overrides the generated directory name.

This is interpreted as a relative path under the cacheDir.

Implementation

void overrideGeneratedOutputDirectory(String path) {
  if (_generatedOutputDirectory != 'generated') {
    throw StateError('You can only override the generated dir once.');
  } else if (_generatedOutputDirectoryIsLocked) {
    throw StateError(
        'Attempted to override the generated dir after it was locked.');
  } else if (!p.isRelative(path)) {
    throw StateError('Only relative paths are accepted for the generated dir '
        'but got `$path`.');
  }
  _generatedOutputDirectory = path;
}