ó  îRac@sjdZddlZddlZddlZddlZddlZd„Zd„Z d„Z d„Z dS(sÅXcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project itself is transformed into a list of executable targets, each with a build step to build with ninja, and a target with every source and resource file. This appears to sidestep some of the major performance headaches experienced using complex projects and large number of targets within Xcode. iÿÿÿÿNcCs‘tjj|ƒ\}}|d}|d}|jrPtjj|j|ƒ}nytj|ƒWn+tk rŽ}|jtjkr‚qnXdd}xa||gD]S} tjjtjj | ƒƒdd} t j j j d| ƒ} |d| 7}q¦W|d 7}tjj|d ƒ} y8t| d ƒ#} | jƒ} | |krMd SWd QXWntk rgnXt| d ƒ}|j|ƒWd QXd S(s8 Create a workspace to wrap main and sources gyp paths. s .xcworkspacetoptionss' s is .xcodeprojsgroup:s$ s scontents.xcworkspacedatatrNtw(tostpathtsplitexttgenerator_outputtjointmakedirstOSErrorterrnotEEXISTtbasenametxmltsaxtsaxutilst quoteattrtopentreadtIOErrortwrite(tmain_gypt sources_gyptparamstbuild_file_roottbuild_file_exttworkspace_pathRtet output_stringtgyp_nametnametworkspace_filet input_filet input_stringt output_file((sm/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_ninja.pyt_WriteWorkspaces6    &    c Csd#}d}|rd|d}tjj|jtjjj|ƒƒ}|j diƒj ddƒ}n|j dƒ}|j d|ƒ}|j dƒ}i}||d<||d<|rÁ||dR7t$s.gypN(titemsRDR?RRRRYtappendRNtsplittdirnameRFt startswithtrelpathRtsortedtsetR#(#t target_listt target_dictstdataRtorig_gypRtgyp_dicttdepthR$RRRtnew_target_listtnew_target_dictstnew_dataRWRVtold_qualified_targetRXR&tnew_target_namet old_targettnew_data_targettsources_target_nametsources_targetRgRct target_dicttbasetfilesR<tfilet relative_pathRtfully_qualified_target_name((sm/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_ninja.pyt CreateWrapper˜s†       "#  (9%     ( t__doc__R tgyp.generator.ninjaRARRRtxml.sax.saxutilsR R#RNRYR‡(((sm/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_ninja.pyt s      " F