@@ -16,6 +16,7 @@ import { XCConfigService } from "./xcconfig-service";
16
16
import * as simplePlist from "simple-plist" ;
17
17
import * as mobileprovision from "ios-mobileprovision-finder" ;
18
18
import { SpawnOptions } from "child_process" ;
19
+ import { BUILD_XCCONFIG_FILE_NAME } from "../constants" ;
19
20
20
21
export class IOSProjectService extends projectServiceBaseLib . PlatformProjectServiceBase implements IPlatformProjectService {
21
22
private static XCODE_PROJECT_EXT_NAME = ".xcodeproj" ;
@@ -87,8 +88,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
87
88
frameworkDirectoriesExtensions : [ ".framework" ] ,
88
89
frameworkDirectoriesNames : [ "Metadata" , "metadataGenerator" , "NativeScript" , "internal" ] ,
89
90
targetedOS : [ 'darwin' ] ,
90
- configurationFileName : "Info.plist" ,
91
- configurationFilePath : path . join ( projectRoot , projectData . projectName , projectData . projectName + "-Info.plist" ) ,
91
+ configurationFileName : constants . INFO_PLIST_FILE_NAME ,
92
+ configurationFilePath : path . join ( projectRoot , projectData . projectName , projectData . projectName + `- ${ constants . INFO_PLIST_FILE_NAME } ` ) ,
92
93
relativeToFrameworkConfigurationFilePath : path . join ( "__PROJECT_NAME__" , "__PROJECT_NAME__-Info.plist" ) ,
93
94
fastLivesyncFileExtensions : [ ".tiff" , ".tif" , ".jpg" , "jpeg" , "gif" , ".png" , ".bmp" , ".BMPf" , ".ico" , ".cur" , ".xbm" ] // https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/
94
95
} ;
@@ -336,7 +337,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
336
337
// Starting from tns-ios 1.4 the xcconfig file is referenced in the project template
337
338
const frameworkVersion = this . getFrameworkVersion ( this . getPlatformData ( projectData ) . frameworkPackageName , projectData . projectDir ) ;
338
339
if ( semver . lt ( frameworkVersion , "1.4.0" ) ) {
339
- basicArgs . push ( "-xcconfig" , path . join ( projectRoot , projectData . projectName , "build.xcconfig" ) ) ;
340
+ basicArgs . push ( "-xcconfig" , path . join ( projectRoot , projectData . projectName , BUILD_XCCONFIG_FILE_NAME ) ) ;
340
341
}
341
342
342
343
// if (this.$logger.getLevel() === "INFO") {
@@ -1037,7 +1038,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1037
1038
}
1038
1039
1039
1040
private validateFramework ( libraryPath : string ) : void {
1040
- const infoPlistPath = path . join ( libraryPath , "Info.plist" ) ;
1041
+ const infoPlistPath = path . join ( libraryPath , constants . INFO_PLIST_FILE_NAME ) ;
1041
1042
if ( ! this . $fs . exists ( infoPlistPath ) ) {
1042
1043
this . $errors . failWithoutHelp ( "The bundle at %s does not contain an Info.plist file." , libraryPath ) ;
1043
1044
}
@@ -1225,13 +1226,13 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1225
1226
const allPlugins : IPluginData [ ] = await ( < IPluginsService > this . $injector . resolve ( "pluginsService" ) ) . getAllInstalledPlugins ( projectData ) ;
1226
1227
for ( const plugin of allPlugins ) {
1227
1228
const pluginPlatformsFolderPath = plugin . pluginPlatformsFolderPath ( IOSProjectService . IOS_PLATFORM_NAME ) ;
1228
- const pluginXcconfigFilePath = path . join ( pluginPlatformsFolderPath , "build.xcconfig" ) ;
1229
+ const pluginXcconfigFilePath = path . join ( pluginPlatformsFolderPath , BUILD_XCCONFIG_FILE_NAME ) ;
1229
1230
if ( this . $fs . exists ( pluginXcconfigFilePath ) ) {
1230
1231
await this . mergeXcconfigFiles ( pluginXcconfigFilePath , pluginsXcconfigFilePath ) ;
1231
1232
}
1232
1233
}
1233
1234
1234
- const appResourcesXcconfigPath = path . join ( projectData . appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , "build.xcconfig" ) ;
1235
+ const appResourcesXcconfigPath = path . join ( projectData . appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , BUILD_XCCONFIG_FILE_NAME ) ;
1235
1236
if ( this . $fs . exists ( appResourcesXcconfigPath ) ) {
1236
1237
await this . mergeXcconfigFiles ( appResourcesXcconfigPath , pluginsXcconfigFilePath ) ;
1237
1238
}
@@ -1287,7 +1288,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1287
1288
1288
1289
private getBuildXCConfigFilePath ( projectData : IProjectData ) : string {
1289
1290
const buildXCConfig = path . join ( projectData . appResourcesDirectoryPath ,
1290
- this . getPlatformData ( projectData ) . normalizedPlatformName , "build.xcconfig" ) ;
1291
+ this . getPlatformData ( projectData ) . normalizedPlatformName , BUILD_XCCONFIG_FILE_NAME ) ;
1291
1292
return buildXCConfig ;
1292
1293
}
1293
1294
@@ -1348,7 +1349,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1348
1349
const choicePersist = await this . $prompter . promptForChoice ( "Do you want to make teamId: " + teamId + " a persistent choice for your app?" , choicesPersist ) ;
1349
1350
switch ( choicesPersist . indexOf ( choicePersist ) ) {
1350
1351
case 0 :
1351
- const xcconfigFile = path . join ( projectData . appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , "build.xcconfig" ) ;
1352
+ const xcconfigFile = path . join ( projectData . appResourcesDirectoryPath , this . getPlatformData ( projectData ) . normalizedPlatformName , BUILD_XCCONFIG_FILE_NAME ) ;
1352
1353
this . $fs . appendFile ( xcconfigFile , "\nDEVELOPMENT_TEAM = " + teamId + "\n" ) ;
1353
1354
break ;
1354
1355
case 1 :
0 commit comments