Zc@sddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z dZ dZ dZidd6dd6dd 6dd 6d d 6d d6de d6dd6dd6dd6dd6dd6dd6dd6dd6de d6dd 6Zd!d"d#gZd$d!d"d#d%d&gZd!d"d#gZed'd(gZd)Zd*efd+YZd,Zd-Zd.Zejd/Zd0Zejd1Zd2Zd3Z d4Z!dS(5iNtINTERMEDIATE_DIRtSHARED_INTERMEDIATE_DIRtLIBRARY_SEARCH_PATHSttEXECUTABLE_PREFIXtEXECUTABLE_SUFFIXtlibtSTATIC_LIB_PREFIXtSHARED_LIB_PREFIXs.atSTATIC_LIB_SUFFIXs.dylibtSHARED_LIB_SUFFIXs$(%s)tmactOSs$(BUILT_PRODUCTS_DIR)t PRODUCT_DIRtLIB_DIRs$(INPUT_FILE_BASE)tRULE_INPUT_ROOTs$(INPUT_FILE_SUFFIX)tRULE_INPUT_EXTs$(INPUT_FILE_NAME)tRULE_INPUT_NAMEs$(INPUT_FILE_PATH)tRULE_INPUT_PATHs$(INPUT_FILE_DIRNAME)tRULE_INPUT_DIRNAMEs$(CONFIGURATION)tCONFIGURATION_NAMEtmac_bundle_resourcestmac_framework_headerstmac_framework_private_headerst mac_bundletmac_xctest_bundlet#xcode_create_dependents_test_runners$(SDKROOT)/usr/libs$(SDKROOT)/usr/local/libcCstjjigd6}t|dkr7dg}nx7|D]/}tjji|d6}|jd|q>W|jd|d|S(NtbuildConfigurationsitDefaulttnametdefaultConfigurationName(tgyptxcodeproj_filetXCConfigurationListtlentXCBuildConfigurationtAppendPropertyt SetProperty(tconfiguration_namestxccltconfiguration_nametxcbc((s*externals/gyp/pylib/gyp/generator/xcode.pytCreateXCConfigurationList]s    t XcodeProjectcBs,eZdZdZdZdZRS(cCs||_||_tjjd||_tjjtjj tjj |jtjj |pfd}|jj d|tjj i|jd6|_ ||_t|_ytj|jt|_Wn+tk r}|jtjkrqnXdS(Ntpatht.tprojectDirPatht rootObject(tgyp_pathR,RR t PBXProjecttprojecttcommont RelativePathtostdirnametabspathR%t XCProjectFilet project_filetbuild_file_dicttFalset created_dirtmakedirstTruetOSErrorterrnotEEXIST(tselfR0R,R:R.te((s*externals/gyp/pylib/gyp/generator/xcode.pyt__init__js       c% Cs[g}xt|jjdD]`}|jd}|jd}x9|D]1}|jd}||krD|j|qDqDWqWy#t|}|jjd|Wn!tjjd|jnX|j t d|j t dx9|j j dijD]\} } |j | | qWd |j krX|jj|j d } |j| n|j j d i} | r x|D]} | j | i}|rz|j| }x6|j dijD]\} } |j | | qWd |kr|jj| | d } |j| qqzqzWng}g}g}g}t}g}x|j dD]}|d }|d }tjj|j||}||}||jjdkst|j||j||jr|j|j|j|jnt|j d ts|j|n|jdkr6t}n|j drRt|}tjjid|d6|jdd6|d6d|j}|j||d}d}|j dr|dtjj|j d}n|j drG|dj g|j djD](\}}d|tjj|f^qd}nd} |r\d} n|d| dtjjtjj!|j d}tjj"i|d6dd6}!|j#d |!|j||j|||_$qRqRWt%|jjdt%|t%|kst||jjd<|jj&t|jj't%|d!kr| rt|}tjji|d6d"d6d|j}"x|D]}|"j|qW|jjdj(d|"nt%|d!krWt|}tjji|d6d#d6d|j}#x|D]}$|#j|$q#W|jjdj(d!|#ndS($NttargetstbuildConfigurationListRRsProblem with gyp file %s s,$(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION)s*$(SYMROOT)/DerivedSources/$(CONFIGURATION)txcode_settingstxcode_config_filetconfigurationst target_namettoolsettsuppress_wildcardtalltrun_assRun t productNametparentRtworking_directoryscd "%s" t environments sexport %s="%s"spython -c "import fcntl, subprocess, sys file = open('$TMPDIR/GYP_serialize_test_runs', 'a') fcntl.flock(file.fileno(), fcntl.LOCK_EX) sys.exit(subprocess.call(sys.argv[1:]))" sexec s %s exit 1 tactiont shellScriptitshowEnvVarsInLogt buildPhasesitAlls Run All Tests()R2t GetPropertytappendR*R%tsyststderrtwriteR0tSetBuildSettingt_intermediate_vart_shared_intermediate_varR:tgett iteritemstAddOrGetFileInRootGrouptSetBaseConfigurationtConfigurationNamedR;RR3tQualifiedTargett _propertiestAssertionErrortsupport_targettinttlowerR>R tPBXAggregateTargett AddDependencytConvertVariablesToShellSyntaxtjointEncodePOSIXShellListtPBXShellScriptBuildPhaseR$t test_runnerR"tRootGroupsTakeOverOnlyChildrent SortGroupstinsert(%RBt xcode_targetstserialize_all_testsRItxctR'txcbcsR)Rtxcktxcvt config_reftbuild_file_configurationst config_nametbuild_file_configuration_namedtxcctordinary_targetstrun_test_targetstsupport_targetsREthas_custom_allttargets_for_allttargetRJRKtqualified_targett xcode_targett run_targettcommandtscripttkeytvaltcommand_prefixtssbpt all_targettrun_all_tests_targettrun_test_target((s*externals/gyp/pylib/gyp/generator/xcode.pyt Finalize1s      (                      X                  cCsx~|jdD]o}t|jddr|d}|d}tjj|j||}||}t|tjj r}g}|j d} xN| D]F} | j d} | j d} t | d r|j | j qqWt|dkrztjj id |d 6|d 6d |j} x|D]}| j|q&W|jjdj|}|jjdj|d| qzq}qqWx*|jjjD]}|jj|qW|jj|jj|jjdS(NRERiRJRKt dependenciest targetProxytremoteGlobalIDStringRqs Run %s TestsRRORPi(R:RiR`RR3ReR0t isinstanceR RkRXthasattrRYRqR"R2RlRftindexRtt_other_pbxprojectstkeystAddOrGetProjectReferencetSortRemoteProductReferencesR9t ComputeIDstEnsureNoIDCollisions(RBRutxcode_target_to_target_dicttbf_tgtttgt_nameRKRRt all_run_teststpbxtdstpbxtdtpbxciptdependency_xcttrun_all_targetRtidxtother_pbxproject((s*externals/gyp/pylib/gyp/generator/xcode.pyt Finalize2cs:           +  cCsZtjddddd|j\}}ytj|d}|jj||jtjj|jd}t }yt j ||t }Wn+t k r}|j t jkrqnX|rtj|nAtjd}tj|tj|d |@tj||Wn@tk rUtj||jrOtj|jtnnXdS( Ntsuffixs.tmptprefixsproject.pbxproj.gyp.tdirtwbsproject.pbxproji?i(ttempfiletmkstempR,R5tfdopenR9tPrinttcloseRnR;tfilecmptcmpR?R@tENOENTtunlinktumasktchmodtrenamet ExceptionR<tshutiltrmtreeR>(RBt output_fdtnew_pbxproj_patht output_filet pbxproj_pathtsameRCR((s*externals/gyp/pylib/gyp/generator/xcode.pytWrites0       (t__name__t __module__RDRRR(((s*externals/gyp/pylib/gyp/generator/xcode.pyR+is  ?c Csdddddddg}dd d d g}tj|}tj|\}}|rj|d j}n||kr|d kr|jj|n;||kr|d kr|jj|n |j|dS(Ntctcctcpptcxxtmtmmtstatdylibt frameworktoitnone(t posixpathtbasenametsplitextRjt SourcesPhasetAddFiletFrameworksPhaseRb( tsourcettypetpbxpRwtsource_extensionstlibrary_extensionsRtroottext((s*externals/gyp/pylib/gyp/generator/xcode.pytAddSourceToTargetscCs|jj|dS(N(tResourcesPhaseR(tresourceRRw((s*externals/gyp/pylib/gyp/generator/xcode.pytAddResourceToTargetscCs(dd|}|jj||dS(Ns{ATTRIBUTES = (%s, ); }tPrivatetPublic(RR(t HeadersPhaseR(theaderRRwt is_publictsettings((s*externals/gyp/pylib/gyp/generator/xcode.pytAddHeaderToTargetss (\$\((.*?)\))cCstj|}|dkr|S|jxT|D]L}|\}}||krTq0n||}tjtj|||}q0W|S(sExpands Xcode-style $(VARIABLES) in string per the expansions dict. In some rare cases, it is appropriate to expand Xcode variables when a project file is generated. For any substring $(VAR) in string, if VAR is a key in the expansions dict, $(VAR) will be replaced with expansions[VAR]. Any $(VAR) substring in string for which VAR is not a key in the expansions dict will remain in the returned string. N(t_xcode_variable_retfindalltNonetreversetretsubtescape(tstringt expansionstmatchestmatcht to_replacetvariablet replacement((s*externals/gyp/pylib/gyp/generator/xcode.pytExpandXcodeVariables s       "s ([\\\"\' ])cCstjtd|S(sWe must escape the defines that we give to XCode so that it knows not to split on spaces and to respect backslash and quote literals. However, we must not quote the define, or Xcode will incorrectly intepret variables especially $(inherited).s\\\1(RRt_xcode_define_re(R((s*externals/gyp/pylib/gyp/generator/xcode.pytEscapeXcodeDefine'sc Cs|d}xy|jD]k\}}tjj|\}}|dkrMqn||jd}|jrtjj|j|}qqWxI|D]A} dd|g} | d| g7} d| | fGHtj| qWdS(Ntoptionss.gyps .xcodeprojt xcodebuilds-projects-configurationsBuilding [%s]: %s( RaR5R,RRtgenerator_outputRnt subprocesst check_call( tdataRItparamsRt build_fileR:tbuild_file_roottbuild_file_exttxcodeproj_pathtconfigt arguments((s*externals/gyp/pylib/gyp/generator/xcode.pyt PerformBuild/s    cq Cs|d}|jdi}|jdt}|jdt}|jdd}|jdt } i} xC|jD]5\} } tjj| \} }|dkrqxn| |jd}|jrtjj |j|}nt | || }|| | <|j }|r(|j d id d 6n|rA|j j|n|jd sx|jd }tjjidd6}|j|x%| dD]}|j|tqWqxqxWi}i}x#|D]}tjj|\} }}||}|ddkrtd|n|dg}x:t|djD]"}||kr6|j|q6q6W| | }|j }t|}idd6dd6dd6dd6dd6d d!6d"d#6d$d%6}i|d&6|d6}|d'} t|jd(d)}!t|jd*d)p |!}"| d+kr| }#|!rN|#d,7}#| dksatd-|n|"ra|#d.7}#ntjj}$y||#|d/g})d}*| d+kr,|(s|)r,t|}+i|+d&6|d?d6},|&r|&d?|,d4}?t.j|?\}@}Ai|@dW6|AdX6|?dY6|=dZ6|>d[6}Bg}CxC|8jdLgD]/}5t0|5|B}D|Cj|D|j1|DqW|9j|C|:j2|Ct|8jdRtrZx$|CD]}5t,|5| ||'q:Wn|=|6k}E|Est|8jdStrx!|CD]}5t-|5||'qWn|8jd@}/|/rtjj&|/}/t0|/|B}/n|;j|/tjj'|8dC}0t0|0|B}.|<j|.q\Wt3|:d)krB d\t4j5d]d^d_||8d`f}Ftjj | | j|F}Gt6|Gda}H|Hj7dbxgt8d)t3|9D]P}I|9|Id)}D|It3|9dQkr dB}Jndc}J|Hj7dd|D|Jfq Wxt9|8dV|9|;|<D]\}=}K}/}.|Hj7dDg}Lxt8d)t3|KD]s}I|K|I}D|Id)kry dB}Mnde}M|Hj7df|M|Dft.j:|D}N|NrT |N|LkrT |Lj|NqT qT W|Hj7dg|=g}O|Oj2|8jdGgxct8d)t3|OD]L}P|O|P}Q|Pt3|OdQkr? dB}Jndc}J|Hj7dd|Q|Jfq Wt3|Ld)kr |Hj7dhdij |Ln|/r |Hj7dj|/n|Hj7dk|.q W|Hj;dl|F}3tjj)idm|8d`dKd6|3dN6d)dO6}4|*r |*j#dP|4qB |'j*dPj+|-|4|-dQ}-ndGdng}R| r g|RD]}S|Sj<dos[ |S^q[ }Rnx8|RD]0}Tx'|8j|TgD]}U|j1|Uq Wq WqWxb|jdpgD]N}Vt.j|V\}W}X|XdQ|7kr t,|V| ||'q |j1|Vq W|"r xS|6D]K}Yt.j|Y\}Z}[|[dQ|7krn t-|Y||'q0 |j1|Yq0 Wx0|jdqgD]}\t=|\||'tq Wn|"s | dkr x0|jdrgD]}\t=|\||'tq Wni}]x|jdsgD]}^|^dt}_|_d)dkr=dw|_}_n|]j|_d}`|`dkrtjj>idx|^dtd6d5|'}`|`j?|_|'j*dPj+|-|`|`|]|_RRaR5R,RRRRnR+R2R%R9tSetXcodeVersionRXRR tPBXGroupt AppendChildtAddOrGetFileByPathR;R3tParseQualifiedTargetRtsortedRRYR*RiRgtPBXNativeTargettKeyErrortExceptionAppendRkR$RlRhtEncodePOSIXShellArgumentRoRmRpRfRtRRRtsplitRRbtextendR"RRtopenR\txrangetzipR6RtendswithRtPBXCopyFilesBuildPhasetSetDestinationRt startswithRtxcode_standard_library_dirstHasBuildSettingt_library_search_paths_vartGetBuildSettingtAppendBuildSettingRdRR]RcRRR(qt target_listt target_dictsRRRR tparallel_buildsRvtproject_versiontskip_excluded_filestxcode_projectsRR:RRRtxcpRt main_groupt build_groupt included_fileRuRRRJRKtspecR&R(R't_typesttarget_propertiesRt is_xctestt is_bundlettype_bundle_keyt xctarget_typeRCttarget_product_nameRwt spec_actionst spec_rulest support_xctt support_xccltsupport_target_propertiestprebuild_indexRSR$t action_stringt message_shtaction_string_shRRtoutputttgt_mac_bundle_resourcest rules_by_exttruletconcrete_outputs_by_rule_sourcetconcrete_outputs_alltmessagesR"t rule_sourcetrule_source_dirnametrule_source_basenametrule_source_roottrule_source_exttrule_input_dictt%concrete_outputs_for_this_rule_sourcetconcrete_outputtwas_mac_bundle_resourcet makefile_namet makefile_pathtmakefiletconcrete_output_indexteoltconcrete_outputstconcrete_output_dirstboltconcrete_output_dirt prerequisitestprerequisite_indext prerequisitetgroupstxtgrouptitemRt source_roottsource_extensionRt resource_roottresource_extensionRt pbxcp_dictt copy_grouptdesttpbxcptfileRt excluded_keyt postbuildt dependencytlibraryt library_dirt configurationR)t include_dirtdefinet set_defineRyRzR{t build_files((s*externals/gyp/pylib/gyp/generator/xcode.pytGenerateOutputAs                                            $                             +            +                   ("Rt gyp.commonRtgyp.xcodeproj_fileR@R5RZRRRRRR^R_R^tgenerator_default_variablest"generator_additional_path_sectionst+generator_additional_non_configuration_keyst!generator_extra_sources_for_rulest frozensetR\R*tobjectR+RRRtcompileRRRRRR(((s*externals/gyp/pylib/gyp/generator/xcode.pytst                   |