@@ -12,21 +12,23 @@ export class AssetsGenerationService implements IAssetsGenerationService {
12
12
@exported ( "assetsGenerationService" )
13
13
public async generateIcons ( resourceGenerationData : IResourceGenerationData ) : Promise < void > {
14
14
this . $logger . info ( "Generating icons ..." ) ;
15
- await this . generateImagesForDefinitions ( resourceGenerationData . imagePath , resourceGenerationData . resourcesPath , Icons ) ;
15
+ await this . generateImagesForDefinitions ( resourceGenerationData . imagePath , resourceGenerationData . resourcesPath , Icons , resourceGenerationData . platform ) ;
16
16
this . $logger . info ( "Icons generation completed." ) ;
17
17
}
18
18
19
19
@exported ( "assetsGenerationService" )
20
20
public async generateSplashScreens ( splashesGenerationData : ISplashesGenerationData ) : Promise < void > {
21
21
this . $logger . info ( "Generating splash screens ..." ) ;
22
- await this . generateImagesForDefinitions ( splashesGenerationData . imagePath , splashesGenerationData . resourcesPath , SplashScreens , splashesGenerationData . background ) ;
22
+ await this . generateImagesForDefinitions ( splashesGenerationData . imagePath , splashesGenerationData . resourcesPath , SplashScreens , splashesGenerationData . platform , splashesGenerationData . background ) ;
23
23
this . $logger . info ( "Splash screens generation completed." ) ;
24
24
}
25
25
26
- private async generateImagesForDefinitions ( imagePath : string , resourcesPath : string , definitions : any [ ] , background : string = "white" ) : Promise < void > {
26
+ private async generateImagesForDefinitions ( imagePath : string , resourcesPath : string , definitions : any [ ] , platform ?: string , background : string = "white" ) : Promise < void > {
27
27
const hasMigrated = this . $androidResourcesMigrationService . hasMigrated ( resourcesPath ) ;
28
28
29
- for ( const definition of definitions ) {
29
+ const filteredDefinitions = platform ? _ . filter ( definitions , definition => _ . toLower ( definition . platform ) === _ . toLower ( platform ) ) : definitions ;
30
+
31
+ for ( const definition of filteredDefinitions ) {
30
32
const operation = definition . operation || Operations . Resize ;
31
33
const scale = definition . scale || 0.8 ;
32
34
const path = hasMigrated ? definition . path : ( definition . pathBeforeMigration || definition . path ) ;
0 commit comments