Skip to content

Commit b6c9176

Browse files
Add baseConfig option
Add baseConfig option that can be used to replace the default AndroidManifest.xml / Info.plist that is used for merge. It should be passed to all build related commands. It can be passed to platform add command as well.
1 parent 85c4ecf commit b6c9176

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

lib/declarations.ts

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ interface IOptions extends ICommonOptions {
8787
compileSdk: number;
8888
port: Number;
8989
copyTo: string;
90+
baseConfig: string;
9091
}
9192

9293
interface IProjectFilesManager {

lib/options.ts

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class Options extends commonOptionsLibPath.OptionsBase {
3434
compileSdk: {type: OptionType.Number },
3535
port: { type: OptionType.Number },
3636
copyTo: { type: OptionType.String },
37+
baseConfig: { type: OptionType.String }
3738
},
3839
path.join($hostInfo.isWindows ? process.env.LocalAppData : path.join(osenv.home(), ".local/share"), ".nativescript-cli"),
3940
$errors, $staticConfig);

lib/services/platform-service.ts

+5
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ export class PlatformService implements IPlatformService {
113113

114114
let sourceFrameworkDir = isFrameworkPathDirectory && this.$options.symlink ? path.join(this.$options.frameworkPath, "framework") : frameworkDir;
115115
platformData.platformProjectService.createProject(path.resolve(sourceFrameworkDir), installedVersion).wait();
116+
if(this.$options.baseConfig) {
117+
let newConfigFile = path.resolve(this.$options.baseConfig);
118+
this.$logger.trace(`Replacing '${platformData.configurationFilePath}' with '${newConfigFile}'.`);
119+
this.$fs.copyFile(newConfigFile, platformData.configurationFilePath).wait();
120+
}
116121

117122
if(isFrameworkPathDirectory || isFrameworkPathNotSymlinkedFile) {
118123
// Need to remove unneeded node_modules folder

lib/services/plugins-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class PluginsService implements IPluginsService {
114114
npmInstallationManager.addToCache(platformData.frameworkPackageName, frameworkVersion).wait();
115115

116116
let cachedPackagePath = npmInstallationManager.getCachedPackagePath(platformData.frameworkPackageName, frameworkVersion);
117-
let cachedConfigurationFilePath = path.join(cachedPackagePath, constants.PROJECT_FRAMEWORK_FOLDER_NAME, platformData.relativeToFrameworkConfigurationFilePath);
117+
let cachedConfigurationFilePath = this.$options.baseConfig ? path.resolve(this.$options.baseConfig) : path.join(cachedPackagePath, constants.PROJECT_FRAMEWORK_FOLDER_NAME, platformData.relativeToFrameworkConfigurationFilePath);
118118
let cachedConfigurationFileContent = this.$fs.readText(cachedConfigurationFilePath).wait();
119119
this.$fs.writeFile(platformData.configurationFilePath, cachedConfigurationFileContent).wait();
120120

0 commit comments

Comments
 (0)