upload method

  1. @override
Future upload(
  1. String root
)
override

Implementation

@override
Future upload(String root) async {
  final apkPath = join(
      root, 'build', 'app', 'outputs', 'apk', 'release', 'app-release.apk');
  final channel = environment.androidChannel;
  final buildName = environment.buildName;
  final buildNumber = environment.buildNumber.toString();
  final copyDir = Directory(join(root, 'ignore_dir', 'android', 'apk'));
  if (!await copyDir.exists()) {
    await copyDir.create(recursive: true);
  }
  final copyFilePath =
      join(copyDir.path, '${channel}_${buildName}_$buildNumber.apk');
  await File(apkPath).copy(copyFilePath);
  if (!environment.upload) {
    return;
  }
  await UploadApk(root: root, log: log).upload();
}