feat(webpack): allow custom 'projectName' on Xcode project name from config (#10550)

This commit is contained in:
apburgess
2024-06-28 22:43:16 +01:00
committed by GitHub
parent c2f5e614da
commit b8fff3833e
3 changed files with 46 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ import { basename } from "path";
import { INativeScriptPlatform } from "../helpers/platform";
import { getProjectRootPath } from "../helpers/project";
import { env } from '../';
import { getValue } from '../helpers/config';
function sanitizeName(appName: string): string {
return appName.split("").filter((c) =>
@@ -10,7 +11,9 @@ function sanitizeName(appName: string): string {
).join("");
}
function getDistPath() {
const appName = sanitizeName(basename(getProjectRootPath()));
// try projectName from nativescript.config.ts, if not set, use original method
const appName = getValue('projectName') ?? sanitizeName(basename(getProjectRootPath()));
return `${env.buildPath ?? "platforms"}/ios/${appName}/app`;
}