cacheRun method

  1. @override
FutureOr? cacheRun()
override

Implementation

@override
FutureOr? cacheRun() async {
  final platform = argResults?['platform'] ?? 'ios';
  final unity = argResults?['unity'];
  if (unity == null) {
    logger.log('unity版本对应执行文件路径不能为空', status: LogStatus.error);
    exit(1);
  }
  late UnityPlatform unityPlatform;
  late String workspace;
  if (platform == 'ios') {
    unityPlatform = UnityPlatform.ios;
    workspace = iosUnityDir.path;
  } else {
    unityPlatform = UnityPlatform.android;
    workspace = androidUnityDir.path;
  }
  // /Users/king/Documents/2021.3.16f1c1/Unity.app/Contents/MacOS/unity -quit -batchmode -executeMethod ExportAppData.exportAndroid -nographics -projectPath ./
  // 看到日志[Exiting batchmode successfully now!]代表成功
  await UpdateUnity(
    workspace: workspace,
    unityEnginePath: unity,
    platform: unityPlatform,
  ).update();
  if (platform == 'ios') {
    // FixIosUnityCache(root: )
  }
}