@@ -164,10 +164,12 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
164164 ) ;
165165 }
166166 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+ ) ;
171173
172174 const appDestinationDirectoryArr = [
173175 projectRoot ,
@@ -266,10 +268,11 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
266268 platformData : IPlatformData ,
267269 projectData : IProjectData
268270 ) : 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+ ) ;
273276
274277 return currentPlatformData && currentPlatformData [ constants . VERSION_STRING ] ;
275278 }
@@ -281,9 +284,10 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
281284 public getAppResourcesDestinationDirectoryPath (
282285 projectData : IProjectData
283286 ) : string {
284- const appResourcesDirStructureHasMigrated = this . $androidResourcesMigrationService . hasMigrated (
285- projectData . getAppResourcesDirectoryPath ( )
286- ) ;
287+ const appResourcesDirStructureHasMigrated =
288+ this . $androidResourcesMigrationService . hasMigrated (
289+ projectData . getAppResourcesDirectoryPath ( )
290+ ) ;
287291
288292 if ( appResourcesDirStructureHasMigrated ) {
289293 return this . getUpdatedAppResourcesDestinationDirPath ( projectData ) ;
@@ -300,14 +304,13 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
300304 this . validatePackageName ( projectData . projectIdentifiers . android ) ;
301305 this . validateProjectName ( projectData . projectName ) ;
302306
303- const checkEnvironmentRequirementsOutput = await this . $platformEnvironmentRequirements . checkEnvironmentRequirements (
304- {
307+ const checkEnvironmentRequirementsOutput =
308+ await this . $platformEnvironmentRequirements . checkEnvironmentRequirements ( {
305309 platform : this . getPlatformData ( projectData ) . normalizedPlatformName ,
306310 projectDir : projectData . projectDir ,
307311 options,
308312 notConfiguredEnvOptions,
309- }
310- ) ;
313+ } ) ;
311314
312315 this . $androidToolsInfo . validateInfo ( {
313316 showWarningsAsErrors : true ,
@@ -358,14 +361,14 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
358361 }
359362
360363 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+ ) ;
364368
365369 if ( appResourcesDirStructureHasMigrated ) {
366- const appResourcesDestinationPath = this . getUpdatedAppResourcesDestinationDirPath (
367- projectData
368- ) ;
370+ const appResourcesDestinationPath =
371+ this . getUpdatedAppResourcesDestinationDirPath ( projectData ) ;
369372 return path . join (
370373 appResourcesDestinationPath ,
371374 constants . MAIN_DIR ,
@@ -413,13 +416,13 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
413416 public async interpolateData ( projectData : IProjectData ) : Promise < void > {
414417 // Interpolate the apilevel and package
415418 this . interpolateConfigurationFile ( projectData ) ;
416- const appResourcesDirectoryPath = projectData . getAppResourcesDirectoryPath ( ) ;
419+ const appResourcesDirectoryPath =
420+ projectData . getAppResourcesDirectoryPath ( ) ;
417421
418422 let stringsFilePath : string ;
419423
420- const appResourcesDestinationDirectoryPath = this . getAppResourcesDestinationDirectoryPath (
421- projectData
422- ) ;
424+ const appResourcesDestinationDirectoryPath =
425+ this . getAppResourcesDestinationDirectoryPath ( projectData ) ;
423426 if (
424427 this . $androidResourcesMigrationService . hasMigrated (
425428 appResourcesDirectoryPath
@@ -479,8 +482,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
479482 }
480483
481484 public interpolateConfigurationFile ( projectData : IProjectData ) : void {
482- const manifestPath = this . getPlatformData ( projectData )
483- . configurationFilePath ;
485+ const manifestPath =
486+ this . getPlatformData ( projectData ) . configurationFilePath ;
484487 shell . sed (
485488 "-i" ,
486489 / _ _ P A C K A G E _ _ / ,
@@ -521,9 +524,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
521524 AndroidProjectService . MIN_RUNTIME_VERSION_WITH_GRADLE
522525 )
523526 ) {
524- const platformLowercase = this . getPlatformData (
525- projectData
526- ) . normalizedPlatformName . toLowerCase ( ) ;
527+ const platformLowercase =
528+ this . getPlatformData ( projectData ) . normalizedPlatformName . toLowerCase ( ) ;
527529 await removePlatforms ( [ platformLowercase . split ( "@" ) [ 0 ] ] ) ;
528530 await addPlatform ( platformLowercase ) ;
529531 return false ;
@@ -585,9 +587,10 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
585587 projectData : IProjectData
586588 ) : void {
587589 const appResourcesDirectoryPath = projectData . appResourcesDirectoryPath ;
588- const appResourcesDirStructureHasMigrated = this . $androidResourcesMigrationService . hasMigrated (
589- appResourcesDirectoryPath
590- ) ;
590+ const appResourcesDirStructureHasMigrated =
591+ this . $androidResourcesMigrationService . hasMigrated (
592+ appResourcesDirectoryPath
593+ ) ;
591594 let originalAndroidManifestFilePath ;
592595
593596 if ( appResourcesDirStructureHasMigrated ) {
@@ -628,17 +631,17 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
628631 const projectAppResourcesPath = projectData . getAppResourcesDirectoryPath (
629632 projectData . projectDir
630633 ) ;
631- const platformsAppResourcesPath = this . getAppResourcesDestinationDirectoryPath (
632- projectData
633- ) ;
634+ const platformsAppResourcesPath =
635+ this . getAppResourcesDestinationDirectoryPath ( projectData ) ;
634636
635637 this . cleanUpPreparedResources ( projectData ) ;
636638
637639 this . $fs . ensureDirectoryExists ( platformsAppResourcesPath ) ;
638640
639- const appResourcesDirStructureHasMigrated = this . $androidResourcesMigrationService . hasMigrated (
640- projectAppResourcesPath
641- ) ;
641+ const appResourcesDirStructureHasMigrated =
642+ this . $androidResourcesMigrationService . hasMigrated (
643+ projectAppResourcesPath
644+ ) ;
642645 if ( appResourcesDirStructureHasMigrated ) {
643646 this . $fs . copyFile (
644647 path . join (
@@ -745,10 +748,12 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
745748 projectData : IProjectData ,
746749 dependencies : IDependencyData [ ]
747750 ) : 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+ ) ;
752757 const dependenciesJsonPath = path . join (
753758 platformDir ,
754759 constants . DEPENDENCIES_JSON_NAME
0 commit comments