From 392702cc185fc92f62d5d3b48bcee569f901d92a Mon Sep 17 00:00:00 2001 From: cacaodev Date: Sun, 11 Mar 2012 21:13:55 +0100 Subject: [PATCH] nib2cib Converter.j : Add a flag to disable ibtool step in case the input is already compiled. Set SharedConverter class var in init (not a singleton, represents the current Converter). --- Tools/nib2cib/Converter.j | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Tools/nib2cib/Converter.j b/Tools/nib2cib/Converter.j index 654c5dd0a..7d9e78226 100644 --- a/Tools/nib2cib/Converter.j +++ b/Tools/nib2cib/Converter.j @@ -46,6 +46,7 @@ ConverterConversionException = @"ConverterConversionException"; NibFormat format @accessors(readonly); CPArray themes @accessors(readonly); CPArray userNSClasses @accessors; + BOOL compileNib @accessors; } + (Converter)sharedConverter @@ -63,6 +64,7 @@ ConverterConversionException = @"ConverterConversionException"; inputPath = aPath; format = nibFormat; themes = themeList; + compileNib = YES; } return self; @@ -114,11 +116,18 @@ ConverterConversionException = @"ConverterConversionException"; try { - // Compile xib or nib to make sure we have a non-new format nib. - temporaryNibFilePath = FILE.join("/tmp", FILE.basename(aFilePath) + ".tmp.nib"); + if (compileNib) + { + // Compile xib or nib to make sure we have a non-new format nib. + temporaryNibFilePath = FILE.join("/tmp", FILE.basename(aFilePath) + ".tmp.nib"); - if (OS.popen(["/usr/bin/ibtool", aFilePath, "--compile", temporaryNibFilePath]).wait() === 1) - [CPException raise:ConverterConversionException reason:@"Could not compile file: " + aFilePath]; + if (OS.popen(["/usr/bin/ibtool", aFilePath, "--compile", temporaryNibFilePath]).wait() === 1) + [CPException raise:ConverterConversionException reason:@"Could not compile file: " + aFilePath]; + } + else + { + temporaryNibFilePath = aFilePath; + } // Convert from binary plist to XML plist var temporaryPlistFilePath = FILE.join("/tmp", FILE.basename(aFilePath) + ".tmp.plist");