@@ -164,10 +164,12 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
164
164
) ;
165
165
}
166
166
if ( projectData && projectData . platformsDir ) {
167
- const projectRoot = path . join (
168
- projectData . platformsDir ,
169
- AndroidProjectService . ANDROID_PLATFORM_NAME
170
- ) ;
167
+ const projectRoot = this . $options . nativeHost
168
+ ? this . $options . nativeHost
169
+ : path . join (
170
+ projectData . platformsDir ,
171
+ AndroidProjectService . ANDROID_PLATFORM_NAME
172
+ ) ;
171
173
172
174
const appDestinationDirectoryArr = [
173
175
projectRoot ,
@@ -266,10 +268,11 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
266
268
platformData : IPlatformData ,
267
269
projectData : IProjectData
268
270
) : string {
269
- const currentPlatformData : IDictionary < any > = this . $projectDataService . getRuntimePackage (
270
- projectData . projectDir ,
271
- < constants . PlatformTypes > platformData . platformNameLowerCase
272
- ) ;
271
+ const currentPlatformData : IDictionary < any > =
272
+ this . $projectDataService . getRuntimePackage (
273
+ projectData . projectDir ,
274
+ < constants . PlatformTypes > platformData . platformNameLowerCase
275
+ ) ;
273
276
274
277
return currentPlatformData && currentPlatformData [ constants . VERSION_STRING ] ;
275
278
}
@@ -281,9 +284,10 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
281
284
public getAppResourcesDestinationDirectoryPath (
282
285
projectData : IProjectData
283
286
) : string {
284
- const appResourcesDirStructureHasMigrated = this . $androidResourcesMigrationService . hasMigrated (
285
- projectData . getAppResourcesDirectoryPath ( )
286
- ) ;
287
+ const appResourcesDirStructureHasMigrated =
288
+ this . $androidResourcesMigrationService . hasMigrated (
289
+ projectData . getAppResourcesDirectoryPath ( )
290
+ ) ;
287
291
288
292
if ( appResourcesDirStructureHasMigrated ) {
289
293
return this . getUpdatedAppResourcesDestinationDirPath ( projectData ) ;
@@ -300,14 +304,13 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
300
304
this . validatePackageName ( projectData . projectIdentifiers . android ) ;
301
305
this . validateProjectName ( projectData . projectName ) ;
302
306
303
- const checkEnvironmentRequirementsOutput = await this . $platformEnvironmentRequirements . checkEnvironmentRequirements (
304
- {
307
+ const checkEnvironmentRequirementsOutput =
308
+ await this . $platformEnvironmentRequirements . checkEnvironmentRequirements ( {
305
309
platform : this . getPlatformData ( projectData ) . normalizedPlatformName ,
306
310
projectDir : projectData . projectDir ,
307
311
options,
308
312
notConfiguredEnvOptions,
309
- }
310
- ) ;
313
+ } ) ;
311
314
312
315
this . $androidToolsInfo . validateInfo ( {
313
316
showWarningsAsErrors : true ,
@@ -358,14 +361,14 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
358
361
}
359
362
360
363
private getResDestinationDir ( projectData : IProjectData ) : string {
361
- const appResourcesDirStructureHasMigrated = this . $androidResourcesMigrationService . hasMigrated (
362
- projectData . getAppResourcesDirectoryPath ( )
363
- ) ;
364
+ const appResourcesDirStructureHasMigrated =
365
+ this . $androidResourcesMigrationService . hasMigrated (
366
+ projectData . getAppResourcesDirectoryPath ( )
367
+ ) ;
364
368
365
369
if ( appResourcesDirStructureHasMigrated ) {
366
- const appResourcesDestinationPath = this . getUpdatedAppResourcesDestinationDirPath (
367
- projectData
368
- ) ;
370
+ const appResourcesDestinationPath =
371
+ this . getUpdatedAppResourcesDestinationDirPath ( projectData ) ;
369
372
return path . join (
370
373
appResourcesDestinationPath ,
371
374
constants . MAIN_DIR ,
@@ -413,13 +416,13 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
413
416
public async interpolateData ( projectData : IProjectData ) : Promise < void > {
414
417
// Interpolate the apilevel and package
415
418
this . interpolateConfigurationFile ( projectData ) ;
416
- const appResourcesDirectoryPath = projectData . getAppResourcesDirectoryPath ( ) ;
419
+ const appResourcesDirectoryPath =
420
+ projectData . getAppResourcesDirectoryPath ( ) ;
417
421
418
422
let stringsFilePath : string ;
419
423
420
- const appResourcesDestinationDirectoryPath = this . getAppResourcesDestinationDirectoryPath (
421
- projectData
422
- ) ;
424
+ const appResourcesDestinationDirectoryPath =
425
+ this . getAppResourcesDestinationDirectoryPath ( projectData ) ;
423
426
if (
424
427
this . $androidResourcesMigrationService . hasMigrated (
425
428
appResourcesDirectoryPath
@@ -479,8 +482,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
479
482
}
480
483
481
484
public interpolateConfigurationFile ( projectData : IProjectData ) : void {
482
- const manifestPath = this . getPlatformData ( projectData )
483
- . configurationFilePath ;
485
+ const manifestPath =
486
+ this . getPlatformData ( projectData ) . configurationFilePath ;
484
487
shell . sed (
485
488
"-i" ,
486
489
/ _ _ P A C K A G E _ _ / ,
@@ -521,9 +524,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
521
524
AndroidProjectService . MIN_RUNTIME_VERSION_WITH_GRADLE
522
525
)
523
526
) {
524
- const platformLowercase = this . getPlatformData (
525
- projectData
526
- ) . normalizedPlatformName . toLowerCase ( ) ;
527
+ const platformLowercase =
528
+ this . getPlatformData ( projectData ) . normalizedPlatformName . toLowerCase ( ) ;
527
529
await removePlatforms ( [ platformLowercase . split ( "@" ) [ 0 ] ] ) ;
528
530
await addPlatform ( platformLowercase ) ;
529
531
return false ;
@@ -585,9 +587,10 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
585
587
projectData : IProjectData
586
588
) : void {
587
589
const appResourcesDirectoryPath = projectData . appResourcesDirectoryPath ;
588
- const appResourcesDirStructureHasMigrated = this . $androidResourcesMigrationService . hasMigrated (
589
- appResourcesDirectoryPath
590
- ) ;
590
+ const appResourcesDirStructureHasMigrated =
591
+ this . $androidResourcesMigrationService . hasMigrated (
592
+ appResourcesDirectoryPath
593
+ ) ;
591
594
let originalAndroidManifestFilePath ;
592
595
593
596
if ( appResourcesDirStructureHasMigrated ) {
@@ -628,17 +631,17 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
628
631
const projectAppResourcesPath = projectData . getAppResourcesDirectoryPath (
629
632
projectData . projectDir
630
633
) ;
631
- const platformsAppResourcesPath = this . getAppResourcesDestinationDirectoryPath (
632
- projectData
633
- ) ;
634
+ const platformsAppResourcesPath =
635
+ this . getAppResourcesDestinationDirectoryPath ( projectData ) ;
634
636
635
637
this . cleanUpPreparedResources ( projectData ) ;
636
638
637
639
this . $fs . ensureDirectoryExists ( platformsAppResourcesPath ) ;
638
640
639
- const appResourcesDirStructureHasMigrated = this . $androidResourcesMigrationService . hasMigrated (
640
- projectAppResourcesPath
641
- ) ;
641
+ const appResourcesDirStructureHasMigrated =
642
+ this . $androidResourcesMigrationService . hasMigrated (
643
+ projectAppResourcesPath
644
+ ) ;
642
645
if ( appResourcesDirStructureHasMigrated ) {
643
646
this . $fs . copyFile (
644
647
path . join (
@@ -745,10 +748,12 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
745
748
projectData : IProjectData ,
746
749
dependencies : IDependencyData [ ]
747
750
) : IDependencyData [ ] {
748
- const platformDir = path . join (
749
- projectData . platformsDir ,
750
- AndroidProjectService . ANDROID_PLATFORM_NAME
751
- ) ;
751
+ const platformDir = this . $options . nativeHost
752
+ ? this . $options . nativeHost
753
+ : path . join (
754
+ projectData . platformsDir ,
755
+ AndroidProjectService . ANDROID_PLATFORM_NAME
756
+ ) ;
752
757
const dependenciesJsonPath = path . join (
753
758
platformDir ,
754
759
constants . DEPENDENCIES_JSON_NAME
0 commit comments