@@ -120,7 +120,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
120
120
}
121
121
122
122
public async validate ( projectData : IProjectData , options : IOptions , notConfiguredEnvOptions ?: INotConfiguredEnvOptions ) : Promise < IValidatePlatformOutput > {
123
- this . validatePackageName ( projectData . projectId ) ;
123
+ this . validatePackageName ( projectData . projectIdentifiers . android ) ;
124
124
this . validateProjectName ( projectData . projectName ) ;
125
125
126
126
const checkEnvironmentRequirementsOutput = await this . $platformEnvironmentRequirements . checkEnvironmentRequirements ( {
@@ -269,16 +269,17 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
269
269
// will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user
270
270
const appGradleContent = this . $fs . readText ( projectData . appGradlePath ) ;
271
271
if ( appGradleContent . indexOf ( constants . PACKAGE_PLACEHOLDER_NAME ) !== - 1 ) {
272
- shell . sed ( '-i' , new RegExp ( constants . PACKAGE_PLACEHOLDER_NAME ) , projectData . projectId , projectData . appGradlePath ) ;
272
+ //TODO: For compatibility with old templates. Once all templates are updated should delete.
273
+ shell . sed ( '-i' , new RegExp ( constants . PACKAGE_PLACEHOLDER_NAME ) , projectData . projectIdentifiers . android , projectData . appGradlePath ) ;
273
274
}
274
275
} catch ( e ) {
275
- this . $logger . warn ( `\n ${ e } .\nCheck if you're using an outdated template and update it .`) ;
276
+ this . $logger . trace ( `Templates updated and no need for replace in app.gradle .`) ;
276
277
}
277
278
}
278
279
279
280
public interpolateConfigurationFile ( projectData : IProjectData , platformSpecificData : IPlatformSpecificData ) : void {
280
281
const manifestPath = this . getPlatformData ( projectData ) . configurationFilePath ;
281
- shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , projectData . projectId , manifestPath ) ;
282
+ shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , projectData . projectIdentifiers . android , manifestPath ) ;
282
283
if ( this . $androidToolsInfo . getToolsInfo ( ) . androidHomeEnvVar ) {
283
284
const sdk = ( platformSpecificData && platformSpecificData . sdk ) || ( this . $androidToolsInfo . getToolsInfo ( ) . compileSdkVersion || "" ) . toString ( ) ;
284
285
shell . sed ( '-i' , / _ _ A P I L E V E L _ _ / , sdk , manifestPath ) ;
@@ -287,8 +288,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
287
288
288
289
private getProjectNameFromId ( projectData : IProjectData ) : string {
289
290
let id : string ;
290
- if ( projectData && projectData . projectId ) {
291
- const idParts = projectData . projectId . split ( "." ) ;
291
+ if ( projectData && projectData . projectIdentifiers && projectData . projectIdentifiers . android ) {
292
+ const idParts = projectData . projectIdentifiers . android . split ( "." ) ;
292
293
id = idParts [ idParts . length - 1 ] ;
293
294
}
294
295
@@ -532,7 +533,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
532
533
const filesForInterpolation = this . $fs . enumerateFilesInDirectorySync ( resourcesDestinationDirectoryPath , file => this . $fs . getFsStats ( file ) . isDirectory ( ) || path . extname ( file ) === constants . XML_FILE_EXTENSION ) || [ ] ;
533
534
for ( const file of filesForInterpolation ) {
534
535
this . $logger . trace ( `Interpolate data for plugin file: ${ file } ` ) ;
535
- await this . $pluginVariablesService . interpolate ( pluginData , file , projectData ) ;
536
+ await this . $pluginVariablesService . interpolate ( pluginData , file , projectData . projectDir , projectData . projectIdentifiers . android ) ;
536
537
}
537
538
}
538
539
@@ -642,7 +643,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
642
643
643
644
public async cleanDeviceTempFolder ( deviceIdentifier : string , projectData : IProjectData ) : Promise < void > {
644
645
const adb = this . $injector . resolve ( DeviceAndroidDebugBridge , { identifier : deviceIdentifier } ) ;
645
- const deviceRootPath = `${ LiveSyncPaths . ANDROID_TMP_DIR_NAME } /${ projectData . projectId } ` ;
646
+ const deviceRootPath = `${ LiveSyncPaths . ANDROID_TMP_DIR_NAME } /${ projectData . projectIdentifiers . android } ` ;
646
647
await adb . executeShellCommand ( [ "rm" , "-rf" , deviceRootPath ] ) ;
647
648
}
648
649
0 commit comments