@@ -12,6 +12,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
12
12
protected $platformsDataService : IPlatformsDataService ,
13
13
protected $packageInstallationManager : IPackageInstallationManager ,
14
14
protected $packageManager : IPackageManager ,
15
+ private $androidResourcesMigrationService : IAndroidResourcesMigrationService ,
15
16
private $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
16
17
private $logger : ILogger ,
17
18
private $errors : IErrors ,
@@ -103,6 +104,8 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
103
104
this . $logger . trace ( `Error during auto-generated files handling. ${ ( error && error . message ) || error } ` ) ;
104
105
}
105
106
107
+ await this . migrateOldAndroidAppResources ( projectData ) ;
108
+
106
109
try {
107
110
await this . cleanUpProject ( projectData ) ;
108
111
await this . migrateDependencies ( projectData ) ;
@@ -112,6 +115,14 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
112
115
}
113
116
}
114
117
118
+ private async migrateOldAndroidAppResources ( projectData : IProjectData ) {
119
+ const appResourcesPath = projectData . getAppResourcesDirectoryPath ( ) ;
120
+ if ( ! this . $androidResourcesMigrationService . hasMigrated ( appResourcesPath ) ) {
121
+ this . $logger . info ( "Migrate old Android App_Resources structure." ) ;
122
+ await this . $androidResourcesMigrationService . migrate ( appResourcesPath ) ;
123
+ }
124
+ }
125
+
115
126
public async shouldMigrate ( { projectDir } : IProjectDir ) : Promise < boolean > {
116
127
const projectData = this . $projectDataService . getProjectData ( projectDir ) ;
117
128
@@ -134,6 +145,10 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
134
145
if ( ! hasDependency && dependency . shouldAddIfMissing ) {
135
146
return true ;
136
147
}
148
+
149
+ if ( ! this . $androidResourcesMigrationService . hasMigrated ( projectData . getAppResourcesDirectoryPath ( ) ) ) {
150
+ return true ;
151
+ }
137
152
}
138
153
139
154
for ( const platform in this . $devicePlatformsConstants ) {
0 commit comments