Unverified Commit 41fd7a2b authored by Stanislav Baranov's avatar Stanislav Baranov Committed by GitHub

Don't parse APK unless explicitly requested (#25595)

parent ee3571c9
......@@ -424,18 +424,20 @@ Future<void> _buildGradleProjectV2(
}
printStatus('Built ${fs.path.relative(apkFile.path)}$appSize.');
final AndroidApk package = AndroidApk.fromApk(apkFile);
final File baselineApkFile =
fs.directory(buildInfo.baselineDir).childFile('${package.versionCode}.apk');
if (buildInfo.createBaseline) {
// Save baseline apk for generating dynamic patches in later builds.
final AndroidApk package = AndroidApk.fromApk(apkFile);
final Directory baselineDir = fs.directory(buildInfo.baselineDir);
final File baselineApkFile = baselineDir.childFile('${package.versionCode}.apk');
baselineApkFile.parent.createSync(recursive: true);
apkFile.copySync(baselineApkFile.path);
printStatus('Saved baseline package ${baselineApkFile.path}.');
}
if (buildInfo.createPatch) {
final AndroidApk package = AndroidApk.fromApk(apkFile);
final Directory baselineDir = fs.directory(buildInfo.baselineDir);
final File baselineApkFile = baselineDir.childFile('${package.versionCode}.apk');
if (!baselineApkFile.existsSync())
throwToolExit('Error: Could not find baseline package ${baselineApkFile.path}.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment