New: missing image/framework in xib is reported as an error.

Previously, if an image or framework in image@framework was missing, it was just a warning, and conversion would continue.

Now an exception is raised and conversion stops.
This commit is contained in:
Aparajita Fishman committed 2013-05-10 09:27:47 -04:00
1 parent 57d5dac72a
commit 9b3676fa4f
2 files changed
+30 -3

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
/*
* Nib2CibException.j
* nib2cib
*
* Created by Aparajita Fishman.
* Copyright 2013, The Cappucino Foundation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
Nib2CibException = @"Nib2CibException";
+7 -3
View File
@@ -22,6 +22,8 @@
@import <Foundation/CPKeyedUnarchiver.j>
@import "Nib2CibException.j"
@class Nib2Cib
var FILE = require("file");
@@ -45,8 +47,10 @@ var FILE = require("file");
{
var info = [frameworks valueForKey:framework];
if (!info || !info.resourceDirectory)
return nil;
if (!info)
[CPException raise:Nib2CibException format:@"The framework “%@” specified by the image “%@@%@” cannot be found.", framework, aName, framework];
else if (!info.resourceDirectory)
[CPException raise:Nib2CibException format:@"The framework “%@” specified by the image “%@@%@” has no Resources directory.", framework, aName, framework];
return { path:[self _resourcePathForName:aName inDirectory:info.resourceDirectory], framework:framework };
}
@@ -103,7 +107,7 @@ var FILE = require("file");
}
}
return nil;
[CPException raise:Nib2CibException format:@"The image “%@” cannot be found in %@.", aName, directory];
}
@end