@@ -12,21 +12,23 @@ export class AssetsGenerationService implements IAssetsGenerationService {
1212 @exported ( "assetsGenerationService" )
1313 public async generateIcons ( resourceGenerationData : IResourceGenerationData ) : Promise < void > {
1414 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 ) ;
1616 this . $logger . info ( "Icons generation completed." ) ;
1717 }
1818
1919 @exported ( "assetsGenerationService" )
2020 public async generateSplashScreens ( splashesGenerationData : ISplashesGenerationData ) : Promise < void > {
2121 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 ) ;
2323 this . $logger . info ( "Splash screens generation completed." ) ;
2424 }
2525
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 > {
2727 const hasMigrated = this . $androidResourcesMigrationService . hasMigrated ( resourcesPath ) ;
2828
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 ) {
3032 const operation = definition . operation || Operations . Resize ;
3133 const scale = definition . scale || 0.8 ;
3234 const path = hasMigrated ? definition . path : ( definition . pathBeforeMigration || definition . path ) ;
0 commit comments