From 0b7e92aa5315a957f62d6476a54436bccca2e574 Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Tue, 23 Apr 2013 23:36:28 -0400 Subject: [PATCH] New: better logging of image bundle info in nib2cib. If an image comes from a framework, the framework's bundle identifier is logged if it is available. --- Tools/nib2cib/NSCustomResource.j | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Tools/nib2cib/NSCustomResource.j b/Tools/nib2cib/NSCustomResource.j index ad0886c38..3c131cbf1 100644 --- a/Tools/nib2cib/NSCustomResource.j +++ b/Tools/nib2cib/NSCustomResource.j @@ -42,7 +42,8 @@ var FILE = require("file"), _resourceName = [aCoder decodeObjectForKey:@"NSResourceName"]; var size = CGSizeMakeZero(), - framework = @""; + framework = @"", + bundleIdentifier = @""; if (_resourceName == "NSSwitch") return nil; @@ -53,9 +54,7 @@ var FILE = require("file"), } else { - var match = /^(.+)@(.+)$/.exec(_resourceName), - framework = @"", - bundleIdentifier = @""; + var match = /^(.+)@(.+)$/.exec(_resourceName); if (match) { @@ -80,8 +79,6 @@ var FILE = require("file"), { _resourceName += FILE.extension(resourceInfo.path); } - - CPLog.debug(" Resource: %s\n Framework: %s\n Path: %s\n Size: %d x %d", _resourceName, framework, resourceInfo ? FILE.canonical(resourceInfo.path) : "", size.width, size.height); } if (resourceInfo && resourceInfo.path && resourceInfo.framework) @@ -94,7 +91,16 @@ var FILE = require("file"), } _properties = @{ @"size":size, @"bundleIdentifier":bundleIdentifier, @"framework":framework }; - } + + CPLog.debug(" Resource: %s\n Framework: %s%s\n Path: %s\n Size: %d x %d", + _resourceName, + framework ? framework : "", + bundleIdentifier ? " (" + bundleIdentifier + ")" : + framework ? " ()" : "", + resourceInfo ? FILE.canonical(resourceInfo.path) : "", + size.width, + size.height); + } return self; }