def runargs(self, config, output_dir, filename, libraries): if not os.path.exists(output_dir): os.makedirs(output_dir) if len(libraries) == 0: raise UsageError("You need to specify at least one library name") filename = filename or libraries[0] filepath = os.path.join(output_dir, '%s.xcconfig' % filename) xcconfig = XCConfig(libraries) xcconfig.create(filepath) m.action('Created %s.xcconfig' % filename) m.message('XCode config file were sucessfully created in %s' % os.path.abspath(filepath))
def testXCConfig(self): tmp = tempfile.NamedTemporaryFile() xcconfig = XCConfig('gstreamer-0.10') xcconfig.create(tmp.name) with open(tmp.name, 'r') as f: self.assertEqual(f.read(), XCCONFIG)