Add 'apps/mobile/' from commit '5fa30f365f21531094cd4d2045042bb4f1370ac3'
git-subtree-dir: apps/mobile git-subtree-mainline:86f8987dffgit-subtree-split:5fa30f365f
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// @ts-check
|
||||
const { withXcodeProject } = require("@expo/config-plugins");
|
||||
|
||||
/**
|
||||
* expo-widgets seeds ExpoWidgetsTarget with hardcoded MARKETING_VERSION/CURRENT_PROJECT_VERSION
|
||||
* and does not update them on later prebuilds. App Store Connect warns when the extension
|
||||
* does not match the containing app.
|
||||
*/
|
||||
/** @type {import('@expo/config-plugins').ConfigPlugin} */
|
||||
function withSyncWidgetVersions(config) {
|
||||
return withXcodeProject(config, (config) => {
|
||||
const marketingVersion = config.version ?? "1.0.0";
|
||||
const buildNumber = config.ios?.buildNumber ?? "1";
|
||||
const project = config.modResults;
|
||||
const configurations = project.pbxXCBuildConfigurationSection();
|
||||
|
||||
for (const key of Object.keys(configurations)) {
|
||||
const buildConfig = configurations[key];
|
||||
if (!buildConfig?.buildSettings) continue;
|
||||
|
||||
const bundleId = buildConfig.buildSettings.PRODUCT_BUNDLE_IDENTIFIER;
|
||||
if (!bundleId || !String(bundleId).includes("ExpoWidgetsTarget")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
buildConfig.buildSettings.MARKETING_VERSION = marketingVersion;
|
||||
buildConfig.buildSettings.CURRENT_PROJECT_VERSION = buildNumber;
|
||||
}
|
||||
|
||||
return config;
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = withSyncWidgetVersions;
|
||||
Reference in New Issue
Block a user