@@ -119,7 +119,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
119
119
}
120
120
121
121
public async validate ( projectData : IProjectData ) : Promise < void > {
122
- this . validatePackageName ( projectData . projectId ) ;
122
+ this . validatePackageName ( projectData . projectIdentifiers . android ) ;
123
123
this . validateProjectName ( projectData . projectName ) ;
124
124
125
125
await this . $platformEnvironmentRequirements . checkEnvironmentRequirements ( this . getPlatformData ( projectData ) . normalizedPlatformName , projectData . projectDir ) ;
@@ -258,16 +258,17 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
258
258
// will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user
259
259
const appGradleContent = this . $fs . readText ( projectData . appGradlePath ) ;
260
260
if ( appGradleContent . indexOf ( constants . PACKAGE_PLACEHOLDER_NAME ) !== - 1 ) {
261
- shell . sed ( '-i' , new RegExp ( constants . PACKAGE_PLACEHOLDER_NAME ) , projectData . projectId , projectData . appGradlePath ) ;
261
+ //TODO: For compatibility with old templates. Once all templates are updated should delete.
262
+ shell . sed ( '-i' , new RegExp ( constants . PACKAGE_PLACEHOLDER_NAME ) , projectData . projectIdentifiers . android , projectData . appGradlePath ) ;
262
263
}
263
264
} catch ( e ) {
264
- this . $logger . warn ( `\n ${ e } .\nCheck if you're using an outdated template and update it .`) ;
265
+ this . $logger . trace ( `Templates updated and no need for replace in app.gradle .`) ;
265
266
}
266
267
}
267
268
268
269
public interpolateConfigurationFile ( projectData : IProjectData , platformSpecificData : IPlatformSpecificData ) : void {
269
270
const manifestPath = this . getPlatformData ( projectData ) . configurationFilePath ;
270
- shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , projectData . projectId , manifestPath ) ;
271
+ shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , projectData . projectIdentifiers . android , manifestPath ) ;
271
272
if ( this . $androidToolsInfo . getToolsInfo ( ) . androidHomeEnvVar ) {
272
273
const sdk = ( platformSpecificData && platformSpecificData . sdk ) || ( this . $androidToolsInfo . getToolsInfo ( ) . compileSdkVersion || "" ) . toString ( ) ;
273
274
shell . sed ( '-i' , / _ _ A P I L E V E L _ _ / , sdk , manifestPath ) ;
@@ -276,8 +277,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
276
277
277
278
private getProjectNameFromId ( projectData : IProjectData ) : string {
278
279
let id : string ;
279
- if ( projectData && projectData . projectId ) {
280
- const idParts = projectData . projectId . split ( "." ) ;
280
+ if ( projectData && projectData . projectIdentifiers && projectData . projectIdentifiers . android ) {
281
+ const idParts = projectData . projectIdentifiers . android . split ( "." ) ;
281
282
id = idParts [ idParts . length - 1 ] ;
282
283
}
283
284
@@ -519,7 +520,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
519
520
const filesForInterpolation = this . $fs . enumerateFilesInDirectorySync ( resourcesDestinationDirectoryPath , file => this . $fs . getFsStats ( file ) . isDirectory ( ) || path . extname ( file ) === constants . XML_FILE_EXTENSION ) || [ ] ;
520
521
for ( const file of filesForInterpolation ) {
521
522
this . $logger . trace ( `Interpolate data for plugin file: ${ file } ` ) ;
522
- await this . $pluginVariablesService . interpolate ( pluginData , file , projectData ) ;
523
+ await this . $pluginVariablesService . interpolate ( pluginData , file , projectData . projectDir , projectData . projectIdentifiers . android ) ;
523
524
}
524
525
}
525
526
@@ -629,7 +630,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
629
630
630
631
public async cleanDeviceTempFolder ( deviceIdentifier : string , projectData : IProjectData ) : Promise < void > {
631
632
const adb = this . $injector . resolve ( DeviceAndroidDebugBridge , { identifier : deviceIdentifier } ) ;
632
- const deviceRootPath = `${ LiveSyncPaths . ANDROID_TMP_DIR_NAME } /${ projectData . projectId } ` ;
633
+ const deviceRootPath = `${ LiveSyncPaths . ANDROID_TMP_DIR_NAME } /${ projectData . projectIdentifiers . android } ` ;
633
634
await adb . executeShellCommand ( [ "rm" , "-rf" , deviceRootPath ] ) ;
634
635
}
635
636
0 commit comments