@@ -16,6 +16,7 @@ import { XCConfigService } from "./xcconfig-service";
1616import * as simplePlist from "simple-plist" ;
1717import * as mobileprovision from "ios-mobileprovision-finder" ;
1818import { SpawnOptions } from "child_process" ;
19+ import { BUILD_XCCONFIG_FILE_NAME } from "../constants" ;
1920
2021export class IOSProjectService extends projectServiceBaseLib . PlatformProjectServiceBase implements IPlatformProjectService {
2122 private static XCODE_PROJECT_EXT_NAME = ".xcodeproj" ;
@@ -89,8 +90,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
8990 frameworkDirectoriesExtensions : [ ".framework" ] ,
9091 frameworkDirectoriesNames : [ "Metadata" , "metadataGenerator" , "NativeScript" , "internal" ] ,
9192 targetedOS : [ 'darwin' ] ,
92- configurationFileName : "Info.plist" ,
93- configurationFilePath : path . join ( projectRoot , projectData . projectName , projectData . projectName + "-Info.plist" ) ,
93+ configurationFileName : constants . INFO_PLIST_FILE_NAME ,
94+ configurationFilePath : path . join ( projectRoot , projectData . projectName , projectData . projectName + `- ${ constants . INFO_PLIST_FILE_NAME } ` ) ,
9495 relativeToFrameworkConfigurationFilePath : path . join ( "__PROJECT_NAME__" , "__PROJECT_NAME__-Info.plist" ) ,
9596 fastLivesyncFileExtensions : [ ".tiff" , ".tif" , ".jpg" , "jpeg" , "gif" , ".png" , ".bmp" , ".BMPf" , ".ico" , ".cur" , ".xbm" ] // https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/
9697 } ;
@@ -338,7 +339,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
338339 // Starting from tns-ios 1.4 the xcconfig file is referenced in the project template
339340 const frameworkVersion = this . getFrameworkVersion ( this . getPlatformData ( projectData ) . frameworkPackageName , projectData . projectDir ) ;
340341 if ( semver . lt ( frameworkVersion , "1.4.0" ) ) {
341- basicArgs . push ( "-xcconfig" , path . join ( projectRoot , projectData . projectName , "build.xcconfig" ) ) ;
342+ basicArgs . push ( "-xcconfig" , path . join ( projectRoot , projectData . projectName , BUILD_XCCONFIG_FILE_NAME ) ) ;
342343 }
343344
344345 // if (this.$logger.getLevel() === "INFO") {
@@ -1039,7 +1040,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
10391040 }
10401041
10411042 private validateFramework ( libraryPath : string ) : void {
1042- const infoPlistPath = path . join ( libraryPath , "Info.plist" ) ;
1043+ const infoPlistPath = path . join ( libraryPath , constants . INFO_PLIST_FILE_NAME ) ;
10431044 if ( ! this . $fs . exists ( infoPlistPath ) ) {
10441045 this . $errors . failWithoutHelp ( "The bundle at %s does not contain an Info.plist file." , libraryPath ) ;
10451046 }
@@ -1227,13 +1228,13 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
12271228 const allPlugins : IPluginData [ ] = await ( < IPluginsService > this . $injector . resolve ( "pluginsService" ) ) . getAllInstalledPlugins ( projectData ) ;
12281229 for ( const plugin of allPlugins ) {
12291230 const pluginPlatformsFolderPath = plugin . pluginPlatformsFolderPath ( IOSProjectService . IOS_PLATFORM_NAME ) ;
1230- const pluginXcconfigFilePath = path . join ( pluginPlatformsFolderPath , "build.xcconfig" ) ;
1231+ const pluginXcconfigFilePath = path . join ( pluginPlatformsFolderPath , BUILD_XCCONFIG_FILE_NAME ) ;
12311232 if ( this . $fs . exists ( pluginXcconfigFilePath ) ) {
12321233 await this . mergeXcconfigFiles ( pluginXcconfigFilePath , pluginsXcconfigFilePath ) ;
12331234 }
12341235 }
12351236
1236- const appResourcesXcconfigPath = path . join ( projectData . appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , "build.xcconfig" ) ;
1237+ const appResourcesXcconfigPath = path . join ( projectData . appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , BUILD_XCCONFIG_FILE_NAME ) ;
12371238 if ( this . $fs . exists ( appResourcesXcconfigPath ) ) {
12381239 await this . mergeXcconfigFiles ( appResourcesXcconfigPath , pluginsXcconfigFilePath ) ;
12391240 }
@@ -1289,7 +1290,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
12891290
12901291 private getBuildXCConfigFilePath ( projectData : IProjectData ) : string {
12911292 const buildXCConfig = path . join ( projectData . appResourcesDirectoryPath ,
1292- this . getPlatformData ( projectData ) . normalizedPlatformName , "build.xcconfig" ) ;
1293+ this . getPlatformData ( projectData ) . normalizedPlatformName , BUILD_XCCONFIG_FILE_NAME ) ;
12931294 return buildXCConfig ;
12941295 }
12951296
@@ -1350,7 +1351,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
13501351 const choicePersist = await this . $prompter . promptForChoice ( "Do you want to make teamId: " + teamId + " a persistent choice for your app?" , choicesPersist ) ;
13511352 switch ( choicesPersist . indexOf ( choicePersist ) ) {
13521353 case 0 :
1353- const xcconfigFile = path . join ( projectData . appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , "build.xcconfig" ) ;
1354+ const xcconfigFile = path . join ( projectData . appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , BUILD_XCCONFIG_FILE_NAME ) ;
13541355 this . $fs . appendFile ( xcconfigFile , "\nDEVELOPMENT_TEAM = " + teamId + "\n" ) ;
13551356 break ;
13561357 case 1 :
0 commit comments