ó
    æ“–g\/  ã                   óH   • S r SSKrSSKrSSKrSSKrSSKrS rS r	S r
S rg)aÅ  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.
é    Nc                 óÔ  • [         R                  R                  U 5      u  p4US-   nUS   nUR                  (       a*  [         R                  R	                  UR                  U5      n [         R
                  " U5        SnX4 Hy  n	[         R                  R                  [         R                  R                  U	5      5      S   S-   n
[        R                  R                  R                  SU
-   5      n
USU
-  -  nM{     US	-  n[         R                  R	                  US
5      n [        U5       nUR                  5       nXØ:X  a
   SSS5        g SSS5        [        US5       nUR!                  U5        SSS5        g! [         a*  nUR                  [        R                  :w  a  e  SnAGN2SnAff = f! , (       d  f       Nl= f! [         a     N{f = f! , (       d  f       g= f)z7Create a workspace to wrap main and sources gyp paths. z.xcworkspaceÚoptionsNzC<?xml version="1.0" encoding="UTF-8"?>
<Workspace version = "1.0">
r   z
.xcodeprojzgroup:z$  <FileRef location = %s></FileRef>
z</Workspace>
zcontents.xcworkspacedataÚw)ÚosÚpathÚsplitextÚgenerator_outputÚjoinÚmakedirsÚOSErrorÚerrnoÚEEXISTÚbasenameÚxmlÚsaxÚsaxutilsÚ	quoteattrÚopenÚreadÚwrite)Úmain_gypÚsources_gypÚparamsÚbuild_file_rootÚbuild_file_extÚworkspace_pathr   ÚeÚoutput_stringÚgyp_nameÚnameÚworkspace_fileÚ
input_fileÚinput_stringÚoutput_files                  Ú1/usr/lib/python3/dist-packages/gyp/xcode_ninja.pyÚ_WriteWorkspacer&      sŸ  € ä(*¯©×(8Ñ(8¸Ó(BÑ%€_Ø$ ~Ñ5€NØ�YÑ€GØ××ÜŸ™Ÿ™ g×&>Ñ&>ÀÓOˆðÜ
�Š�NÔ#ð
 	Uð ð Ó+ˆÜ�w‰w×Ñ¤§¡× 0Ñ 0°Ó :Ó;¸AÑ>ÀÑMˆÜ�w‰w×Ñ×)Ñ)¨(°T©/Ó:ˆØÐ@À4ÑGÑGŠñ ,ð Ð%Ñ%€Mä—W‘W—\‘\ .Ð2LÓM€NðÜ�.Ô! ZØ%Ÿ?™?Ó,ˆLØÓ,Ø÷ "Ð!à,÷ "ô 
ˆn˜cÔ	" kØ×Ñ˜-Ô(÷ 
#Ð	"øô/ ó Ø�7‰7”e—l‘lÓ"Øõ #ûðú÷ "Õ!ûô ó áðú÷ 
#Õ	"úsZ   Á(F Ä&G	 Ä1F8ÅG	 ÅG	 Å&GÆ
F5ÆF0Æ0F5Æ8
GÇG	 ÇG	 Ç	
GÇGÇ
G'c           	      óx  • SnSnU(       ax  US   n[         R                  R                  UR                  [        R
                  R                  R                  U5      5      nUR                  S0 5      R                  SS5      nU R                  S5      nU R                  SU5      nU R                  S5      n0 nXXS'   XhS'   U(       a  XxS'   U R                  S	5      US	'   U R                  S
5      US
'   0 US'   0 n	U(       a  SU-  U	S'   SU ;   a`  U S    HW  n
U S   U
   R                  S0 5      nSU;   a  SU	S'   US   U	S'   S H  nXË;   d  M
  X¼   Xœ'   M     0 US   U
'   U	US   U
   S'   MY     U R                  SS5      US'   U R                  SS5      US'   U R                  SS5      US'   U R                  SS5      US'   U R                  SS5      US'   U S   US'   U(       aQ  SU-  / / SS[         R                  S   -  SSU	S   U/SU-  S./US '   US:”  a  US    S   S!   R                  S"U45        U$ )#z,Create fake target for xcode-ninja wrapper. Nr   r   Úgenerator_flagsÚxcode_ninja_jobsÚtarget_nameÚproduct_nameÚproduct_extensionÚtoolsetÚdefault_configurationÚconfigurationsz-%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)ÚCONFIGURATION_BUILD_DIRÚxcode_settingsÚIPHONEOS_DEPLOYMENT_TARGETÚNOÚCODE_SIGNING_REQUIRED)ÚBUNDLE_LOADERÚ	TEST_HOSTÚ
mac_bundleÚmac_xctest_bundleÚios_app_extensionÚios_watchkit_extensionÚios_watchkit_appÚtypezCompile and copy %s via ninjaÚenvzPATH=%sÚPATHÚninjaz-C)Úaction_nameÚinputsÚoutputsÚactionÚmessageÚactionsrC   z-j)r   r   r
   Útoplevel_dirÚgypÚ	generatorr?   ÚComputeOutputDirÚgetÚenvironÚextend)Úold_specr   Úninja_toplevelÚjobsr   r*   r+   r,   Úninja_targetÚnew_xcode_settingsÚconfigÚold_xcode_settingsÚkeys                r%   Ú_TargetFromSpecrU   :   sÎ  € ð €NØ€DÞØ˜Ñ#ˆÜŸ™Ÿ™Ø× Ñ ¤#§-¡-×"5Ñ"5×"FÑ"FÀvÓ"Nó
ˆð �z‰zÐ+¨RÓ0×4Ñ4Ð5GÈÓKˆà—,‘,˜}Ó-€KØ—<‘< °Ó<€LØ Ÿ™Ð%8Ó9Ðà€LØ"-�ÑØ#/�Ñ ÞØ,=Ð(Ñ)Ø&Ÿl™l¨9Ó5€L�ÑØ,4¯L©LÐ9PÓ,Q€LÐ(Ñ)Ø%'€LÐ!Ñ"ð ÐÞà;¸nÑLð 	Ð4Ñ5ð ˜8Ó#ØÐ/Ô0ˆFØ!)Ð*:Ñ!;¸FÑ!C×!GÑ!GØ  "ó"Ðð ,Ð/AÓAØ>BÐ"Ð#:Ñ;ØCUØ0ñDÐ"Ð#?Ñ@ó 6�ØÕ,Ø.@Ñ.EÐ&Ó+ñ 6ð 68ˆLÐ)Ñ*¨6Ñ2ð #ð Ð)Ñ*¨6Ñ2Ø óñ 1ð$ "*§¡¨l¸AÓ!>€L�ÑØ(0¯©Ð5HÈ!Ó(L€LÐ$Ñ%Ø(0¯©Ð5HÈ!Ó(L€LÐ$Ñ%Ø-5¯\©\Ð:RÐTUÓ-V€LÐ)Ñ*Ø'/§|¡|Ð4FÈÓ'J€LÐ#Ñ$Ø# FÑ+€L�ÑÞð  ?ÀÑLØØàØ¤§
¡
¨6Ñ 2Ñ2ØØØ&Ð'@ÑAØðð ;¸[ÑHñð#
ˆ�YÑð  �!‹8Ø˜Ñ# AÑ& xÑ0×7Ñ7¸¸t¸ÔEØÐó    c                 ó:  • UR                  S5      nU b  [        R                  " X5      (       a  g[        UR                  SS5      5      S:w  d,  UR                  SS5      S:X  a6  UR                  SS5      S	:w  a   Ub  [        R                  " X5      (       d  g
gg
)ab  Limit targets for Xcode wrapper.

Xcode sometimes performs poorly with too many targets, so only include
proper executable targets, with filters to customize.
Arguments:
  target_extras: Regular expression to always add, matching any target.
  executable_target_pattern: Regular expression limiting executable targets.
  spec: Specifications for target.
r*   Tr8   r   r<   Ú Ú
executabler,   ÚbundleF)rJ   ÚreÚsearchÚint)Útarget_extrasÚexecutable_target_patternÚspecr*   s       r%   ÚIsValidTargetForWrapperra   ‰   sŒ   € ð —(‘(˜=Ó)€KàÑ ¤R§Y¢Y¨}×%JÑ%JØô ˆ4�8‰8Ð'¨Ó+Ó,°Ó1Ø�‰�˜Ó Ó,Ø�H‰HÐ(¨"Ó-°Ó9ð %Ñ0Ü—9’9Ð6×DÑDØØØrV   c                 óz  • US   S   nUR                  5        H  u  pVXT:X  d  M  US   nM     UR                  S0 5      nUR                  SS5      n	U	c)  [        R                  R	                  U5      u  p«U
S-   U-   n	/ n0 n0 n0 Xé'   / Xé   S'   / Xé   S	'   X$   R                  S
0 5      Xé   S
'   UR                  SS5      nUR                  SS5      nU  H©  nUU   n[        UUU5      (       d  M  UR                  S5      nU	 SU S3nUR                  U5        [        UU5      UU'   UUR                  S5      S      S	    H6  nUS   U:X  d  M  0 nUS   US'   US   US'   Xé   S	   R                  U5        M8     M«     Sn[        USSSSS.S5      nSSW/00US'   UR                  SS5      (       + n/ nUR                  5        GH…  u  nn[        R                  R                  U5      nUR                  S/ 5      UR                  S/ 5      -   nU(       d4  UR                  UR                  S/ 5      UR                  S/ 5      -   5        UR                  S/ 5       HN  nUR                  UR                  S / 5      5        U(       a  M-  UR                  UR                  S!/ 5      5        MP     U V s/ s H  n U R                  S"5      (       a  M  U PM     nn [        R                  R                  U	5      n!UU V s/ s HA  n [        R                  R                  [        R                  R                  UU 5      U!5      PMC     sn -  nGMˆ     [        [        U5      5      US'   [        R                  R                  [        R                  R                  U	5      US#-   5      n"U" SU S3n#UR                  U#5        UUU#'   0 nUS   US'   UUS'   SUS'   0 UU"'   / UU"   S	'   / UU"   S'   X$   R                  S
0 5      UU"   S
'   UU"   S	   R                  U5        [!        U	U"U5        XÍU4$ s  sn f s  sn f )$aŠ  Initialize targets for the ninja wrapper.

This sets up the necessary variables in the targets to generate Xcode projects
that use ninja as an external builder.
Arguments:
  target_list: List of target pairs: 'base/base.gyp:base'.
  target_dicts: Dict of target properties keyed on target pair.
  data: Dict of flattened build files keyed on gyp path.
  params: Dict of global options for gyp.
Úbuild_filesr   Ú_DEPTHr(   Úxcode_ninja_main_gypNz.ninjaÚincluded_filesÚtargetsr1   Ú%xcode_ninja_executable_target_patternÚxcode_ninja_target_patternr*   Ú:z#targetr-   Úsources_for_indexingÚtargetÚDefaultÚ0rY   )r*   r-   r.   r7   r<   Úinclude_dirsr/   Úxcode_ninja_list_excluded_filesTÚsourcesÚmac_bundle_resourcesÚsources_excludedÚmac_bundle_resources_excludedrE   rA   Úinputs_excludedÚ$z.gyp)ÚitemsrJ   r   r   r   ra   ÚappendrU   ÚsplitÚdirnamerL   Ú
startswithÚrelpathr
   ÚsortedÚsetr&   )$Útarget_listÚtarget_dictsÚdatar   Úorig_gypr   Úgyp_dictÚdepthr(   r   r   r   Únew_target_listÚnew_target_dictsÚnew_datar_   r^   Úold_qualified_targetr`   r*   Únew_target_nameÚ
old_targetÚnew_data_targetÚsources_target_nameÚsources_targetÚskip_excluded_filesrq   rl   Útarget_dictÚbaseÚfilesrC   ÚfileÚrelative_pathr   Úfully_qualified_target_names$                                       r%   ÚCreateWrapperr•   ¦   s®  € ð �mÑ$ QÑ'€HØ"Ÿj™jžlÑˆØÕØ˜XÑ&ŠEñ +ð —j‘jÐ!2°BÓ7€OØ×"Ñ"Ð#9¸4Ó@€HØÑÜ,.¯G©G×,<Ñ,<¸XÓ,FÑ)ˆØ" XÑ-°Ñ>ˆð €OØÐØ€Hð €HÑØ+-€HÑÐ'Ñ(Ø$&€HÑ�yÑ!Ø+/©>×+=Ñ+=Ð>NÐPRÓ+S€HÑÐ'Ñ(ð
 !0× 3Ñ 3Ø/°ó!Ðð $×'Ñ'Ð(DÀdÓK€Mã +ÐØÐ0Ñ1ˆÜ" =Ð2KÈT×RÓRàŸ(™( =Ó1ˆKØ!) 
¨!¨K¨=¸Ð@ˆOØ×"Ñ" ?Ô3ô 1@ÀÀfÓ0MÐ˜_Ñ-ð #Ð#7×#=Ñ#=¸cÓ#BÀ1Ñ#EÑFÀyÔQ�
Ø˜mÑ,°Õ;Ø&(�OØ5?ÀÑ5N�O MÑ2Ø1;¸IÑ1F�O IÑ.ØÑ& yÑ1×8Ñ8¸ÖIó Rñ !,ð( 1ÐÜ$à.ØØ%.ØØ ñ	
ð 	ó	€Nð )2°NÀUÀGÐ3LÐ'M€NÐ#Ñ$ð .×1Ñ1Ø)¨4óô Ðð €GØ+×1Ñ1×3Ñˆ�Ü�w‰w�‰˜vÓ&ˆØ—‘ 	¨2Ó.°·±Ø" Bó2
ñ 
ˆö #Ø�L‰LØ—‘Ð 2°BÓ7Ø—/‘/Ð"AÀ2ÓFñGôð
 "—o‘o i°Ö4ˆFØ�L‰L˜Ÿ™ H¨bÓ1Ô2ç&Ð&Ø—‘˜VŸZ™ZÐ(9¸2Ó>Ö?ñ	 5ñ #(ÓD¢%˜$¨t¯©¸s×/C—¡%ˆÐDô Ÿ™Ÿ™¨Ó1ˆØÙQVó
ÚQVÈŒB�G‰G�O‰OœBŸG™GŸL™L¨¨tÓ4°mÖDÑQVñ
ñ 	
‹ñ1  4ô8 !'¤s¨7£|Ó 4€N�9Ñô —'‘'—,‘,œrŸw™wŸ™¨xÓ8Ð:MÐPVÑ:VÓW€KØ%0 M°Ð3FÐ2GÀwÐ"OÐð ×ÑÐ6Ô7Ø4BÐÐ0Ñ1Ø€OØ%3°MÑ%B€O�MÑ"Ø %€O�HÑØ!)€O�IÑØ€Hˆ[ÑØ')€Hˆ[Ñ˜)Ñ$Ø.0€Hˆ[ÑÐ*Ñ+Ø.2©n×.@Ñ.@ÐAQÐSUÓ.V€Hˆ[ÑÐ*Ñ+Øˆ[Ñ˜)Ñ$×+Ñ+¨OÔ<ô �H˜k¨6Ô2Ø¨xÐ8Ð8ùò; Eùò
s   Ê7P3ËP3ÌAP8)Ú__doc__r   Úgyp.generator.ninjarG   r   r[   Úxml.sax.saxutilsr   r&   rU   ra   r•   © rV   r%   Ú<module>rš      s3   ðñ
ó Û Û 	Û 	Û ò!)òHLò^ó:H9rV   