11import * as path from "path" ;
22import * as Jimp from "jimp" ;
33import * as Color from "color" ;
4- import { Icons , SplashScreens , Operations } from "./image-definitions"
4+ import { Icons , SplashScreens , Operations } from "./image-definitions" ;
55import { exported } from "../../common/decorators" ;
66
77export class AssetsGenerationService implements IAssetsGenerationService {
88 constructor ( private $logger : ILogger ,
9- private $androidResourcesMigrationService : IAndroidResourcesMigrationService ) {
9+ private $androidResourcesMigrationService : IAndroidResourcesMigrationService ) {
1010 }
11-
11+
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 ) ;
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 . background ) ;
2323 this . $logger . info ( "Splash screens generation completed." ) ;
2424 }
2525
2626 private async generateImagesForDefinitions ( imagePath : string , resourcesPath : string , definitions : any [ ] , background : string = "white" ) : Promise < void > {
2727 const hasMigrated = this . $androidResourcesMigrationService . hasMigrated ( resourcesPath ) ;
28-
29- for ( let definition of definitions ) {
28+
29+ for ( const definition of definitions ) {
3030 const operation = definition . operation || Operations . Resize ;
3131 const scale = definition . scale || 0.8 ;
32- const path = hasMigrated ? definition . path : ( definition . pathBeforeMigration || definition . path )
32+ const path = hasMigrated ? definition . path : ( definition . pathBeforeMigration || definition . path ) ;
3333 const outputPath = this . convertToAbsolutePath ( resourcesPath , path ) ;
3434
3535 switch ( operation ) {
@@ -68,7 +68,7 @@ export class AssetsGenerationService implements IAssetsGenerationService {
6868 image = image . composite ( overlayImage , centeredWidth , centeredHeight ) ;
6969 }
7070
71- image . write ( outputPath )
71+ image . write ( outputPath ) ;
7272 }
7373
7474 private convertToAbsolutePath ( resourcesPath : string , resourcePath : string ) {
@@ -84,4 +84,4 @@ export class AssetsGenerationService implements IAssetsGenerationService {
8484 }
8585}
8686
87- $injector . register ( "assetsGenerationService" , AssetsGenerationService ) ;
87+ $injector . register ( "assetsGenerationService" , AssetsGenerationService ) ;
0 commit comments