Generate Windows icon only when needed

This commit is contained in:
Joshua Granick
2015-01-07 22:49:46 -08:00
parent 288ea1286e
commit 8a7cc34848

View File

@@ -139,6 +139,31 @@ class IconHelper {
public static function createWindowsIcon (icons:Array <Icon>, targetPath:String):Bool { public static function createWindowsIcon (icons:Array <Icon>, targetPath:String):Bool {
try {
var useCache = FileSystem.exists (targetPath);
if (useCache) {
var iconTime = FileSystem.stat (targetPath).mtime.getTime ();
for (icon in icons) {
if (FileSystem.exists (icon.path) && FileSystem.stat (icon.path).mtime.getTime () > iconTime) {
useCache = false;
break;
}
}
if (useCache) return true;
}
} catch (e:Dynamic) {}
var sizes = [ 16, 24, 32, 40, 48, 64, 96, 128, 256 ]; var sizes = [ 16, 24, 32, 40, 48, 64, 96, 128, 256 ];
var images = new Array <Image> (); var images = new Array <Image> ();