NXc @sddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z dZ dZdZidd6dd6dd 6dd 6d d 6d d6de d6dd6dd6dd6dd6dd6dd6dd6dd6ded6dd 6Zd!d"d#gZd$d%d&d'd!d"d#d(d)g Zd!d"d#gZeaed*d+gZd,Zd-efd.YZd/Zd0Zd1Ze jd2Zd3Z e jd4Z!d5Z"d6Z#d7Z$d8Z%dS(9iNtINTERMEDIATE_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_headerstios_app_extensiont ios_watch_apptios_watchkit_extensiont 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((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pytCreateXCConfigurationListcs    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/R"R#t PBXProjecttprojecttcommont RelativePathtostdirnametabspathR(t XCProjectFilet project_filetbuild_file_dicttFalset created_dirtmakedirstTruetOSErrorterrnotEEXIST(tselfR3R/R=R1te((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pyt__init__ps       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($NttargetstbuildConfigurationListRR sProblem 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()R5t GetPropertytappendR-R(tsyststderrtwriteR3tSetBuildSettingt_intermediate_vart_shared_intermediate_varR=tgett iteritemstAddOrGetFileInRootGrouptSetBaseConfigurationtConfigurationNamedR>R"R6tQualifiedTargett _propertiestAssertionErrortsupport_targettinttlowerRAR#tPBXAggregateTargett AddDependencytConvertVariablesToShellSyntaxtjointEncodePOSIXShellListtPBXShellScriptBuildPhaseR't test_runnerR%tRootGroupsTakeOverOnlyChildrent SortGroupstinsert(%REt xcode_targetstserialize_all_testsRLtxctR*txcbcsR,R txcktxcvt config_reftbuild_file_configurationst config_nametbuild_file_configuration_namedtxcctordinary_targetstrun_test_targetstsupport_targetsRHthas_custom_allttargets_for_allttargetRMRNtqualified_targett xcode_targett run_targettcommandtscripttkeytvaltcommand_prefixtssbpt all_targettrun_all_tests_targettrun_test_target((s4ext/snowcrash/tools/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(NRHRiRMRNt dependenciest targetProxytremoteGlobalIDStringRts Run %s TestsR RRRSi(R=RlRcR"R6RhR3t isinstanceR#RnR[thasattrR\RtR%R5RoRitindexRwt_other_pbxprojectstkeystAddOrGetProjectReferencetSortRemoteProductReferencesR<t ComputeIDstEnsureNoIDCollisions(RERxtxcode_target_to_target_dicttbf_tgtttgt_nameRNRRt all_run_teststpbxtdstpbxtdtpbxciptdependency_xcttrun_all_targetRtidxtother_pbxproject((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pyt Finalize2is:           +  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/R8tfdopenR<tPrinttcloseRqR>tfilecmptcmpRBRCtENOENTtunlinktumasktchmodtrenamet ExceptionR?tshutiltrmtreeRA(REt output_fdtnew_pbxproj_patht output_filet pbxproj_pathtsameRFR((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pytWrites0       (t__name__t __module__RGRRR(((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pyR.os  ?c Csddddddddg}d d d d g}tj|}tj|\}}|rm|d j}n||kr|dkr|jj|n;||kr|dkr|jj|n |j|dS(Ntctcctcpptcxxtmtmmtstswifttatdylibt frameworktoitnone(t posixpathtbasenametsplitextRmt SourcesPhasetAddFiletFrameworksPhaseRe( tsourcettypetpbxpRztsource_extensionstlibrary_extensionsRtroottext((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pytAddSourceToTargetscCs|jj|dS(N(tResourcesPhaseR(tresourceRRz((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pytAddResourceToTargetscCs(dd|}|jj||dS(Ns{ATTRIBUTES = (%s, ); }tPrivatetPublic(RR(t HeadersPhaseR(theaderRRzt is_publictsettings((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pytAddHeaderToTarget ss (\$\((.*?)\))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((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pytExpandXcodeVariabless       "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((s4ext/snowcrash/tools/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( RdR8R/RRtgenerator_outputRqt subprocesst check_call( tdataRLtparamsRt build_fileR=tbuild_file_roottbuild_file_exttxcodeproj_pathtconfigt arguments((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pyt PerformBuild5s    cCs|dj}|jddkrtjj|djp;d}|jdijdd}tjjtjj||}tjjtjj||d}nEtjjtjj|d }tjjtjj||d }i|d 6|d 6adS( NRtflavortninjaR0tgenerator_flagst output_dirtoutsgypfiles-xcode-ninjaRtgypfilesttopleveltqualified_out_dir( t toplevel_dirRcR8R/trelpathRtnormpathRqtgenerator_filelist_paths(RRt generator_dirRR((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pytCalculateGeneratorInputInfoGs !!cy CsG|jddk}|rBtjj||||\}}}n|d}|jdi}|jdt}|jdt}|jdd} | rt| } x#t| dkrd | } qWn|jd t } i} xZ|jD]L\} } t j j | \}}|d kr(qn||j d }|j r]t j j|j |}nt| || }|| | <|j}i}|rd |dkr)|"}(|#rJ|(d?7}(|"d kst d@|n|%rs|$sft dA||(dB7}(ne|&r|$st dC||(dD7}(n<|'r|$st dE||(dF7}(n|$r|(dG7}(ntjj!})y| |(|!dHkr|-s0|.r| rt|}0|jdXdY}1i|0d66||1d6}2|+r|+dY|2dM|>|=|>dojdpgD]}Ct0j1|C\}D}Et0j |E\}F}Gi|Fdq6|Gdr6|Eds6|Cdt6|Ddu6}Hg}IxC|>jdfgD]/};t2|;|H}J|Ij|J|j3|Jq^ W|?j|I|@j4|It|>jdltr x$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*|pjdgD]}r|qjHd|rqfWx^|pjdgD]J}o|otDkr|qjEtF s|o|qjGtFkr|qjHtF|oqqWd|pkr!x1|pdD]"}stJ|s}t|qjHd|tqWnd|pkrax1|pdjD]\}u}v|qjK|u|vq>Wnd|pkr|j3|pd}w|qjL|wqqWqUWg}xx9|jD]+\} } | j=d r|xj| qqWx"|xD]} | | jM||qWx"|xD]} | | jN||qWx|xD]} | | jOq+WdS(NR RRRtxcode_parallel_buildstxcode_serialize_all_test_runst#xcode_upgrade_check_project_versionit0txcode_list_excluded_filess.gyps .xcodeprojtYESt!BuildIndependentTargetsInParalleltLastUpgradeChecktLastTestingUpgradeChecktLastSwiftUpdateCheckt attributest standalonet mainGrouptBuildR tincluded_filesRNRs:Multiple toolsets not supported in xcode build (target %s)tdefault_configurationRLscom.apple.product-type.toolt executablescom.googlecode.gyp.xcode.bundletloadable_modules&com.apple.product-type.library.dynamictshared_librarys%com.apple.product-type.library.statictstatic_librarys'com.apple.product-type.kernel-extensiontmac_kernel_extensions"com.apple.product-type.applicationsexecutable+bundlescom.apple.product-type.bundlesloadable_module+bundles'com.apple.product-type.bundle.unit-testsloadable_module+xctests com.apple.product-type.frameworksshared_library+bundles$com.apple.product-type.app-extensionsexecutable+extension+bundles)com.apple.product-type.watchkit-extensions!executable+watch+extension+bundles+com.apple.product-type.application.watchappsexecutable+watch+bundlesmac_kernel_extension+bundleRIRRiRRRRRs+xctestsDmac_xctest_bundle targets must have type loadable_module (target %s)s6ios_app_extension flag requires mac_bundle (target %s)s+extension+bundles;ios_watchkit_extension flag requires mac_bundle (target %s)s+watch+extension+bundles2ios_watch_app flag requires mac_bundle (target %s)s +watch+bundles+bundlet productTypes/-- unknown product type while writing target %ss6mac_bundle targets cannot have type none (target "%s")s=mac_xctest_bundle targets cannot have type none (target "%s")t product_nameRRRSt force_outdirt product_dirt force_prefixtproduct_prefixtforce_extensiontproduct_extensionRHtactionstrulestsupport_target_suffixs Supporttmessages echo note: RRVs sexec s exit 1 tinputst inputPathssAction "t action_namet"toutputst outputPathsRWRXRYitprocess_outputs_as_sourcest'process_outputs_as_mac_bundle_resourcesRt extensiont rule_sourcestINPUT_FILE_BASEtINPUT_FILE_SUFFIXtINPUT_FILE_NAMEtINPUT_FILE_PATHtINPUT_FILE_DIRNAMEs%s.makes [^a-zA-Z0-9_]t_s%s_%st rule_nameRsall: \ s \s %s%s s s%s%s \ s : \ s @mkdir -p "%s" s" "s @echo note: %s s %s sJOB_COUNT="$(/usr/sbin/sysctl -n hw.ncpu)" if [ "${JOB_COUNT}" -gt 4 ]; then JOB_COUNT=4 fi exec xcrun make -f "${PROJECT_FILE_PATH}/%s" -j "${JOB_COUNT}" exit 1 sRule "tinputs_excludedt _excludedtsourcesRRtcopiest destinationt/t$s $(SRCROOT)/txcode_code_signs#{ATTRIBUTES = (CodeSignOnCopy, ); }sCopy to tfilestoutputs_excludeds$(BUILT_PRODUCTS_DIR)/t postbuildss($(BUILT_PRODUCTS_DIR)/$(EXECUTABLE_PATH)s Postbuild "tpostbuild_nameRt librariestmac_framework_dirstFRAMEWORK_SEARCH_PATHSt include_dirstHEADER_SEARCH_PATHSt library_dirstdefinestGCC_PREPROCESSOR_DEFINITIONSRJRK(RRRS(Ns#{ATTRIBUTES = (CodeSignOnCopy, ); }(PRcR"t xcode_ninjat CreateWrapperRARtstrR%RdR8R/RRRRqR.R5R(R[R#tPBXGroupt AppendChildtAddOrGetFileByPathR>R6tParseQualifiedTargetRtsortedRR\R-RlRjtPBXNativeTargettKeyErrortExceptionAppendRnR'RoRktEncodePOSIXShellArgumentRrRpRsRiRwRRRtsplitRRetextendRRtopenR_txrangetzipR9RtendswithRtPBXCopyFilesBuildPhasetSetDestinationRt startswithRtxcode_standard_library_dirstHasBuildSettingt_library_search_paths_vartGetBuildSettingtAppendBuildSettingRgRR`RfRRR(yt target_listt target_dictsRRt ninja_wrapperRRtparallel_buildsRytupgrade_check_project_versiontskip_excluded_filestxcode_projectsRR=RRR txcpRtproject_attributest main_groupt build_groupt included_fileRxRRRMRNtspecR)R+R*t_typesttarget_propertiesRt is_xctestt is_bundletis_app_extensiontis_watchkit_extensiont is_watch_appttype_bundle_keyt xctarget_typeRFttarget_product_nameRzt spec_actionst spec_rulest support_xctt support_xcclR:tsupport_target_propertiestprebuild_indexRVR;t action_stringt message_shtaction_string_shRRtoutputttgt_mac_bundle_resourcest rules_by_exttruletconcrete_outputs_by_rule_sourcetconcrete_outputs_alltmessagesR8t 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_grouptdestt code_signRtpbxcptfileRt excluded_keyt postbuildt dependencytlibraryt library_dirt configurationR,t include_dirtdefinet set_defineR|R}R~t build_files((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pytGenerateOutput[s'                                                          $                             +             +                   (&Rt gyp.commonR"tgyp.xcodeproj_filetgyp.xcode_ninjaRCR8R]RRRRRRaRbRxtgenerator_default_variablest"generator_additional_path_sectionst+generator_additional_non_configuration_keyst!generator_extra_sources_for_rulesRRt frozensetRvR-tobjectR.RRRtcompileRRRRR RR(((s4ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pyts                    |