compile method

Future<bool> compile()

Compiles the project to compileDir.

Implementation

Future<bool> compile() async {
  compileDir.create(recursive: true);

  var compileDirPath = compileDir.path;

  var projectPath = Directory.current.path;
  print('\n** Compiling Bone_UI project: $projectPath');

  print('-- BonesUI compile directory: $compileDirPath\n');

  var buildArgs = ['run', 'build_runner', 'build', '-o', compileDirPath];

  // dart run build_runner build -o /tmp/compileDir/
  var exitCode = await _dartRunner.runDartCommand(buildArgs,
      workingDirectory: projectPath);

  if (exitCode != 0) {
    throw StateError("Dart build error. Exit code: $exitCode");
  }

  linkWebDirToTestDir();

  return true;
}