@@ -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" ;
@@ -89,8 +90,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
89
90
frameworkDirectoriesExtensions : [ ".framework" ] ,
90
91
frameworkDirectoriesNames : [ "Metadata" , "metadataGenerator" , "NativeScript" , "internal" ] ,
91
92
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 } ` ) ,
94
95
relativeToFrameworkConfigurationFilePath : path . join ( "__PROJECT_NAME__" , "__PROJECT_NAME__-Info.plist" ) ,
95
96
fastLivesyncFileExtensions : [ ".tiff" , ".tif" , ".jpg" , "jpeg" , "gif" , ".png" , ".bmp" , ".BMPf" , ".ico" , ".cur" , ".xbm" ] // https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/
96
97
} ;
@@ -338,7 +339,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
338
339
// Starting from tns-ios 1.4 the xcconfig file is referenced in the project template
339
340
const frameworkVersion = this . getFrameworkVersion ( this . getPlatformData ( projectData ) . frameworkPackageName , projectData . projectDir ) ;
340
341
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 ) ) ;
342
343
}
343
344
344
345
// if (this.$logger.getLevel() === "INFO") {
@@ -1039,7 +1040,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1039
1040
}
1040
1041
1041
1042
private validateFramework ( libraryPath : string ) : void {
1042
- const infoPlistPath = path . join ( libraryPath , "Info.plist" ) ;
1043
+ const infoPlistPath = path . join ( libraryPath , constants . INFO_PLIST_FILE_NAME ) ;
1043
1044
if ( ! this . $fs . exists ( infoPlistPath ) ) {
1044
1045
this . $errors . failWithoutHelp ( "The bundle at %s does not contain an Info.plist file." , libraryPath ) ;
1045
1046
}
@@ -1227,13 +1228,13 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1227
1228
const allPlugins : IPluginData [ ] = await ( < IPluginsService > this . $injector . resolve ( "pluginsService" ) ) . getAllInstalledPlugins ( projectData ) ;
1228
1229
for ( const plugin of allPlugins ) {
1229
1230
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 ) ;
1231
1232
if ( this . $fs . exists ( pluginXcconfigFilePath ) ) {
1232
1233
await this . mergeXcconfigFiles ( pluginXcconfigFilePath , pluginsXcconfigFilePath ) ;
1233
1234
}
1234
1235
}
1235
1236
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 ) ;
1237
1238
if ( this . $fs . exists ( appResourcesXcconfigPath ) ) {
1238
1239
await this . mergeXcconfigFiles ( appResourcesXcconfigPath , pluginsXcconfigFilePath ) ;
1239
1240
}
@@ -1289,7 +1290,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1289
1290
1290
1291
private getBuildXCConfigFilePath ( projectData : IProjectData ) : string {
1291
1292
const buildXCConfig = path . join ( projectData . appResourcesDirectoryPath ,
1292
- this . getPlatformData ( projectData ) . normalizedPlatformName , "build.xcconfig" ) ;
1293
+ this . getPlatformData ( projectData ) . normalizedPlatformName , BUILD_XCCONFIG_FILE_NAME ) ;
1293
1294
return buildXCConfig ;
1294
1295
}
1295
1296
@@ -1350,7 +1351,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1350
1351
const choicePersist = await this . $prompter . promptForChoice ( "Do you want to make teamId: " + teamId + " a persistent choice for your app?" , choicesPersist ) ;
1351
1352
switch ( choicesPersist . indexOf ( choicePersist ) ) {
1352
1353
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 ) ;
1354
1355
this . $fs . appendFile ( xcconfigFile , "\nDEVELOPMENT_TEAM = " + teamId + "\n" ) ;
1355
1356
break ;
1356
1357
case 1 :
0 commit comments