1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-09-16 01:41:37 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

fix gradle check

This commit is contained in:
sunnylqm
2024-10-19 11:39:13 +08:00
parent 04f75cd51b
commit d5f468aa44
3 changed files with 15 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-update-cli",
"version": "1.30.4",
"version": "1.31.0",
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
"main": "index.js",
"bin": {

View File

@@ -33,7 +33,7 @@ async function runReactNativeBundleCommand(
gradleConfig = await checkGradleConfig();
if (gradleConfig.crunchPngs !== false) {
console.warn(
'androidcrunchPngs选项似乎尚未禁用如已禁用则请忽略此提示这可能导致热更包体积异常增大具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n',
'androidcrunchPngs 选项似乎尚未禁用(如已禁用则请忽略此提示),这可能导致热更包体积异常增大,具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n',
);
}
}
@@ -177,17 +177,19 @@ async function checkGradleConfig() {
let crunchPngs;
try {
const gradleConfig = await g2js.parseFile('android/app/build.gradle');
crunchPngs = gradleConfig.android.buildTypes.release.crunchPngs;
const projectConfig = gradleConfig['project.ext.react'];
for (const packagerConfig of projectConfig) {
if (
packagerConfig.includes('enableHermes') &&
packagerConfig.includes('true')
) {
enableHermes = true;
break;
if (projectConfig) {
for (const packagerConfig of projectConfig) {
if (
packagerConfig.includes('enableHermes') &&
packagerConfig.includes('true')
) {
enableHermes = true;
break;
}
}
}
crunchPngs = gradleConfig.android.buildTypes.release.crunchPngs;
} catch (e) {}
return {
enableHermes,
@@ -609,7 +611,6 @@ export const commands = {
const { version, major, minor } = getRNVersion();
console.log('Bundling with react-native: ', version);
printVersionCommand();
await runReactNativeBundleCommand(
bundleName,

View File

@@ -134,7 +134,9 @@ export const commands = {
let minPkgVersion = options.minPackageVersion;
let maxPkgVersion = options.maxPackageVersion;
let rollout = options.rollout;
if (rollout !== undefined) {
if (rollout === undefined) {
rollout = null;
} else {
try {
rollout = parseInt(rollout);
} catch (e) {