Fixed: nib2cib did not allow xibs or images to be in subdirectories of Resources.

Previously, nib2cib would not correctly calculate the app/resource directories if the xib was in a subdirectory of Resources. Also, image resources in subdirectories did not have the subdirectory encoded with the image name.

Now xibs and images may be anywhere under Resources.

Fixes #1960.
This commit is contained in:
Aparajita Fishman
2013-07-14 18:11:31 -04:00
parent 54d13c8fc9
commit 083310c44f
2 changed files with 10 additions and 9 deletions
+5 -5
View File
@@ -73,11 +73,11 @@ var FILE = require("file"),
}
// Account for the fact that an extension may have been inferred.
if (resourceInfo &&
resourceInfo.path &&
FILE.extension(resourceInfo.path) !== FILE.extension(_resourceName))
if (resourceInfo && resourceInfo.path)
{
_resourceName += FILE.extension(resourceInfo.path);
// Include subdirectories in the name
match = /^.+\/Resources\/(.+)$/.exec(resourceInfo.path)
_resourceName = match[1];
}
}
@@ -100,7 +100,7 @@ var FILE = require("file"),
resourceInfo ? FILE.canonical(resourceInfo.path) : "",
size.width,
size.height);
}
}
return self;
}
+5 -4
View File
@@ -554,12 +554,13 @@ var FILE = require("file"),
{
appDirectory = @"";
var parentDir = FILE.dirname(aPath);
var parentDir = FILE.dirname(aPath),
match = /^(.+)(\/Resources(?:\/.+)?)$/.exec(parentDir);
if (FILE.basename(parentDir) === "Resources")
if (match)
{
appDirectory = FILE.dirname(parentDir);
appResourceDirectory = parentDir;
appDirectory = match[1];
appResourceDirectory = FILE.join(appDirectory, "Resources");
}
else
{