codeplay-common 1.9.4 → 1.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/files/finalrelease +21 -10
- package/package.json +1 -1
package/files/finalrelease
CHANGED
|
@@ -629,25 +629,36 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
|
|
|
629
629
|
// Build Android AAB file
|
|
630
630
|
//child_process.execSync('cd android && ./gradlew bundleRelease', { stdio: 'inherit' });
|
|
631
631
|
|
|
632
|
+
|
|
633
|
+
// Build Android AAB or APK file based on store
|
|
634
|
+
console.log(`🏗️ Building release for ${storeName}...`);
|
|
632
635
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
+
let buildType = "AAB";
|
|
637
|
+
if (["VivoStore", "OppoStore", "MiStore"].includes(storeName)) {
|
|
638
|
+
buildType = "APK";
|
|
639
|
+
}
|
|
636
640
|
|
|
641
|
+
execSync('npx cap sync android', { stdio: 'inherit' });
|
|
642
|
+
execSync(`npx cap build android --androidreleasetype=${buildType}`, { stdio: 'inherit' });
|
|
637
643
|
|
|
644
|
+
// Determine output paths
|
|
645
|
+
let oldFilePath;
|
|
646
|
+
let newExt = buildType === "APK" ? "apk" : "aab";
|
|
638
647
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
648
|
+
if (buildType === "APK") {
|
|
649
|
+
oldFilePath = join("android", "app", "build", "outputs", "apk", "release", "app-release-signed.apk");
|
|
650
|
+
} else {
|
|
651
|
+
oldFilePath = join("android", "app", "build", "outputs", "bundle", "release", "app-release-signed.aab");
|
|
652
|
+
}
|
|
642
653
|
|
|
654
|
+
const checkFullPath = join("AAB", newFileName.replace(/\.aab$/, `.${newExt}`));
|
|
643
655
|
|
|
644
|
-
// Rename the output
|
|
645
|
-
const oldFilePath = join(aabDirectory, "app-release-signed.aab");
|
|
656
|
+
// Rename the output file
|
|
646
657
|
if (existsSync(oldFilePath)) {
|
|
647
658
|
renameSync(oldFilePath, checkFullPath);
|
|
648
|
-
console.log(`✅ Renamed output
|
|
659
|
+
console.log(`✅ Renamed output ${newExt.toUpperCase()} file to: ${path.basename(checkFullPath)}`);
|
|
649
660
|
} else {
|
|
650
|
-
console.error(
|
|
661
|
+
console.error(`❌ ${newExt.toUpperCase()} file not found after build.`);
|
|
651
662
|
}
|
|
652
663
|
|
|
653
664
|
} catch (error) {
|