Skip to content

Commit af2381b

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
Process correctly androidManifest.xml from App_Resources
1 parent 825bdf4 commit af2381b

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

lib/definitions/project.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ interface IPlatformProjectService {
5757
afterPrepareAllPlugins(): IFuture<void>;
5858
getAppResourcesDestinationDirectoryPath(): IFuture<string>;
5959
deploy(deviceIdentifier: string): IFuture<void>;
60+
processConfigurationFilesFromAppResources(): IFuture<void>;
6061
}
6162

6263
interface IAndroidProjectPropertiesManager {

lib/services/android-project-service.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,16 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
267267
public preparePluginNativeCode(pluginData: IPluginData): IFuture<void> {
268268
return (() => {
269269
let pluginPlatformsFolderPath = this.getPluginPlatformsFolderPath(pluginData, AndroidProjectService.ANDROID_PLATFORM_NAME);
270-
271270
this.processResourcesFromPlugin(pluginData.name, pluginPlatformsFolderPath).wait();
271+
}).future<void>()();
272+
}
272273

274+
public processConfigurationFilesFromAppResources(): IFuture<void> {
275+
return (() => {
273276
// Process androidManifest.xml from App_Resources
274-
let manifestFilePath = path.join(this.$projectData.appResourcesDirectoryPath, this.platformData.configurationFileName);
277+
let manifestFilePath = path.join(this.$projectData.appResourcesDirectoryPath, this.platformData.normalizedPlatformName, this.platformData.configurationFileName);
275278
if (this.$fs.exists(manifestFilePath).wait()) {
276-
this.processResourcesFromPlugin("NativescriptAppResources", this.$projectData.appResourcesDirectoryPath).wait();
279+
this.processResourcesFromPlugin("NativescriptAppResources", path.dirname(manifestFilePath)).wait();
277280
}
278281
}).future<void>()();
279282
}

lib/services/ios-project-service.ts

+4
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,10 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
354354
}).future<void>()();
355355
}
356356

357+
public processConfigurationFilesFromAppResources(): IFuture<void> {
358+
return Future.fromResult();
359+
}
360+
357361
private get projectPodFilePath(): string {
358362
return path.join(this.platformData.projectRoot, "Podfile");
359363
}

lib/services/platform-service.ts

+3
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ export class PlatformService implements IPlatformService {
217217
let excludedDirs = [constants.APP_RESOURCES_FOLDER_NAME];
218218
this.$projectFilesManager.processPlatformSpecificFiles(directoryPath, platform, excludedDirs).wait();
219219

220+
// Process configurations files from App_Resources
221+
platformData.platformProjectService.processConfigurationFilesFromAppResources().wait();
222+
220223
this.$logger.out("Project successfully prepared");
221224
}).future<void>()();
222225
}

0 commit comments

Comments
 (0)