ó
    æ“–gå2  ã                   óÄ   • S r SSKrSSKrSSKrSSKJr  SSKrS r\R                  " 5         SSS.r
SS jr " S	 S
5      r " S S\5      r " S S\5      r " S S5      rg)z7New implementation of Visual Studio project generation.é    N)Ú
attrgetterc                 ó   • X:„  X:  -
  $ ©N© )ÚxÚys     Ú-/usr/lib/python3/dist-packages/gyp/MSVSNew.pyÚcmpr
      s   € Ø‰E�a‘eÑÐó    z&{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}z&{2150E333-8FDC-42A3-9474-1A3956D46DE8})ÚprojectÚfolderc                 ó  • [         R                  " [        U5      [        U 5      -   R                  S5      5      R	                  5       R                  5       nSUSS -   S-   USS -   S-   USS -   S-   USS -   S-   USS	 -   S
-   nU$ )a  Returns a GUID for the specified target name.

Args:
  name: Target name.
  seed: Seed for MD5 hash.
Returns:
  A GUID-line string calculated from the name and seed.

This generates something which looks like a GUID, but depends only on the
name and seed.  This means the same name/seed will always generate the same
GUID, so that projects and solutions which refer to each other can explicitly
determine the GUID to refer to explicitly.  It also means that the GUID will
not change when the project for a target is rebuilt.
zutf-8Ú{Né   Ú-é   é   é   é    Ú})ÚhashlibÚmd5ÚstrÚencodeÚ	hexdigestÚupper)ÚnameÚseedÚdÚguids       r	   ÚMakeGuidr!       sË   € ô  	�Š”S˜“Y¤ T£Ñ*×2Ñ2°7Ó;Ó<×FÑFÓH×NÑNÓP€Að 	Ø
ˆBˆQˆ%ñ	à
ñ	ð ˆAˆbˆ'ñ	ð ñ		ð
 ˆBˆrˆ(ñ	ð ñ	ð ˆBˆrˆ(ñ	ð ñ	ð ˆBˆrˆ(ñ		ð ñ
	ð 	ð €Kr   c                   ó   • \ rS rSrS rSrg)ÚMSVSSolutionEntryéE   c                 ó‚   • [        U R                  U R                  5       4UR                  UR                  5       45      $ r   )r
   r   Úget_guid)ÚselfÚothers     r	   Ú__cmp__ÚMSVSSolutionEntry.__cmp__F   s.   € ä�D—I‘I˜tŸ}™}›Ð/°%·*±*¸e¿n¹nÓ>NÐ1OÓPÐPr   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r)   Ú__static_attributes__r   r   r	   r#   r#   E   s   † õQr   r#   c                   ó(   • \ rS rSrSrSS jrS rSrg)Ú
MSVSFolderéK   z.Folder in a Visual Studio project or solution.Nc                 ó  • U(       a  X l         O$[        R                  R                  U5      U l         Xl        X@l        [        U=(       d    / [        S5      S9U l        [        U=(       d    / 5      U l	        [        S   U l        g)a   Initializes the folder.

Args:
  path: Full path to the folder.
  name: Name of the folder.
  entries: List of folder entries to nest inside this folder.  May contain
      Folder or Project objects.  May be None, if the folder is empty.
  guid: GUID to use for folder, if not None.
  items: List of solution items to include in the folder project.  May be
      None, if the folder does not directly contain items.
Úpath©Úkeyr   N)r   Úosr4   Úbasenamer    Úsortedr   ÚentriesÚlistÚitemsÚENTRY_TYPE_GUIDSÚentry_type_guid)r'   r4   r   r:   r    r<   s         r	   Ú__init__ÚMSVSFolder.__init__N   sd   € ö Ø�Iô Ÿ™×(Ñ(¨Ó.ˆDŒIàŒ	ØŒ	ô ˜gŸm¨´¸FÓ1CÑDˆŒÜ˜%Ÿ+ 2Ó&ˆŒ
ä/°Ñ9ˆÕr   c                 óf   • U R                   c  [        U R                  SS9U l         U R                   $ )NÚmsvs_folder)r   )r    r!   r4   ©r'   s    r	   r&   ÚMSVSFolder.get_guidi   s(   € Ø�9‰9Ñä  §¡°Ñ?ˆDŒIØ�y‰yÐr   )r:   r>   r    r<   r   r4   )NNNN)r+   r,   r-   r.   Ú__doc__r?   r&   r/   r   r   r	   r1   r1   K   s   † Ù8ô:õ6r   r1   c                   óB   • \ rS rSrSr       S	S jrS rS rS rSr	g)
ÚMSVSProjectés   zVisual Studio project.Nc	                 ó`  • Xl         X@l        XPl        X`l        U=(       d?    [        R                   R                  [        R                   R                  U5      5      S   U l        [        U=(       d    / 5      U l	        [        S   U l        U(       a  Xpl        O0 U l        X€l        SU l        g)a…  Initializes the project.

Args:
  path: Absolute path to the project file.
  name: Name of project.  If None, the name will be the same as the base
      name of the project file.
  dependencies: List of other Project objects this project is dependent
      upon, if not None.
  guid: GUID to use for project, if not None.
  spec: Dictionary specifying how to build this project.
  build_file: Filename of the .gyp file that the vcproj file comes from.
  config_platform_overrides: optional dict of configuration platforms to
      used in place of the default for this target.
  fixpath_prefix: the path used to adjust the behavior of _fixpath
r   r   N)r4   r    ÚspecÚ
build_filer7   Úsplitextr8   r   r;   Údependenciesr=   r>   Úconfig_platform_overridesÚfixpath_prefixÚmsbuild_toolset)	r'   r4   r   rM   r    rJ   rK   rN   rO   s	            r	   r?   ÚMSVSProject.__init__v   s‡   € ð4 Œ	ØŒ	ØŒ	Ø$Œà×GœBŸG™G×,Ñ,¬R¯W©W×-=Ñ-=¸dÓ-CÓDÀQÑGˆŒ	ô ! ×!3°Ó4ˆÔä/°	Ñ:ˆÔæ$Ø-FÕ*à-/ˆDÔ*Ø,ÔØ#ˆÕr   c                 ó6   • [        U=(       d    / 5      U l        g r   )r;   rM   )r'   rM   s     r	   Úset_dependenciesÚMSVSProject.set_dependencies£   s   € Ü  ×!3°Ó4ˆÕr   c                 óh   • U R                   c  [        U R                  5      U l         U R                   $ r   )r    r!   r   rC   s    r	   r&   ÚMSVSProject.get_guid¦   s(   € Ø�9‰9Ñô ! §¡Ó+ˆDŒIØ�y‰yÐr   c                 ó   • Xl         g r   )rP   )r'   rP   s     r	   Úset_msbuild_toolsetÚMSVSProject.set_msbuild_toolset·   s   € Ø.Õr   )
rK   rN   rM   r>   rO   r    rP   r   r4   rJ   )NNNNNNN)
r+   r,   r-   r.   rE   r?   rS   r&   rX   r/   r   r   r	   rG   rG   s   s1   † Ù ð
 ØØØØØ"&Øô+$òZ5òõ"/r   rG   c                   óX   • \ rS rSrSr SS jr\R                  R                  4S jr	Sr
g)ÚMSVSSolutioné¾   zVisual Studio solution.Nc                 ó°   • Xl         XPl        X l        [        U=(       d    / 5      U l        U(       a  USS U l        O	SS/U l        U R                  5         g)a‘  Initializes the solution.

Args:
  path: Path to solution file.
  version: Format version to emit.
  entries: List of entries in solution.  May contain Folder or Project
      objects.  May be None, if the folder is empty.
  variants: List of build variant strings.  If none, a default list will
      be used.
  websiteProperties: Flag to decide if the website properties section
      is generated.
NzDebug|Win32zRelease|Win32)r4   ÚwebsitePropertiesÚversionr;   r:   ÚvariantsÚWrite)r'   r4   r_   r:   r`   r^   s         r	   r?   ÚMSVSSolution.__init__Á   sM   € ð Œ	Ø!2ÔØŒô ˜GŸM rÓ*ˆŒæà$¡Q˜KˆD�Mð +¨OÐ<ˆDŒMð 	�
‰
�r   c                 ón
  • [        5       nU R                  SS nU(       aU  UR                  S5      nXB;   a  M  UR                  U5        [	        U[
        5      (       a  X4R                  -  nU(       a  MU  [        U[        S5      S9nU" U R                  5      nUR                  SU R                  R                  5       -  5        UR                  SU R                  R                  5       -  5        [        R                  R                  U R                  5      S   nU GHÂ  n[        R                   R#                  UR                  U5      nUR%                  SS5      =(       d    S	nUR                  S
UR&                  < SUR(                  < SU< SUR+                  5       < S3	5        U R,                  (       a  UR                  S5        [	        U[
        5      (       a^  UR.                  (       aM  UR                  S5        UR.                   H  n	UR                  SU	 SU	 S35        M     UR                  S5        [	        U[0        5      (       az  UR2                  (       ai  UR                  S5        UR2                   H7  n
UR                  SU
R+                  5        SU
R+                  5        S35        M9     UR                  S5        UR                  S5        GMÅ     UR                  S5        UR                  S5        U R4                   H  nUR                  SU SU S35        M     UR                  S5        / n0 nU HU  n[	        U[0        5      (       d  M  UR7                  UR+                  5       5        UR8                  XÔR+                  5       '   MW     UR;                  5         UR                  S5        U He  nU R4                   HR  nXÞ   R=                  X»5      nUR                  SU< S	U< SU< S35        UR                  SU< S	U< SU< S35        MT     Mg     UR                  S5        UR                  S5        UR                  S5        UR                  S5        [?        S U 5       5      (       a‰  UR                  S5        U Ha  n[	        U[
        5      (       d  M  UR                   H7  nUR                  SUR+                  5        SUR+                  5        S35        M9     Mc     UR                  S5        UR                  S 5        URA                  5         g)!zZWrites the solution file to disk.

Raises:
  IndexError: An entry appears multiple times.
Nr   r4   r5   z:Microsoft Visual Studio Solution File, Format Version %s
z# %s
Ú/Ú\Ú.z	Project("z") = "z", "z"
z–	ProjectSection(WebsiteProperties) = preProject
		Debug.AspNetCompiler.Debug = "True"
		Release.AspNetCompiler.Debug = "False"
	EndProjectSection
z-	ProjectSection(SolutionItems) = preProject
z		z = z
z	EndProjectSection
z4	ProjectSection(ProjectDependencies) = postProject
zEndProject
zGlobal
z>	GlobalSection(SolutionConfigurationPlatforms) = preSolution
z	EndGlobalSection
z>	GlobalSection(ProjectConfigurationPlatforms) = postSolution
z.ActiveCfg = z.Build.0 = z2	GlobalSection(SolutionProperties) = preSolution
z		HideSolutionNode = FALSE
c              3   óh   #   • U  H(  n[        U[        5      (       d  M  UR                  v •  M*     g 7fr   )Ú
isinstancer1   r:   )Ú.0Úes     r	   Ú	<genexpr>Ú%MSVSSolution.Write.<locals>.<genexpr>b  s   é € ÐK¢+˜Q´¸A¼z×1J‹yˆq�yŽy¢+ùs   ‚2Ÿ2z.	GlobalSection(NestedProjects) = preSolution
zEndGlobal
)!Úsetr:   ÚpopÚaddrh   r1   r9   r   r4   Úwriter_   ÚSolutionVersionÚDescriptionr7   ÚsplitÚgypÚcommonÚRelativePathÚreplacer>   r   r&   r^   r<   rG   rM   r`   ÚappendrN   ÚsortÚgetÚanyÚclose)r'   ÚwriterÚall_entriesÚentries_to_checkrj   ÚfÚsln_rootÚrelative_pathÚfolder_nameÚir   ÚvÚconfig_guidsÚconfig_guids_overridesÚgÚnvÚsubentrys                    r	   ra   ÚMSVSSolution.Writeæ   s0  € ô “eˆØŸ<™<©˜?ÐÞØ ×$Ñ$ QÓ'ˆAð ÓÙà�O‰O˜AÔô ˜!œZ×(Ñ(Ø §I¡IÑ-Ð ÷ Ðô ˜[¬j¸Ó.@ÑAˆñ �4—9‘9ÓˆØ	�‰ð$Ø&*§l¡l×&BÑ&BÓ&DñEô	
ð 	
�‰�
˜TŸ\™\×5Ñ5Ó7Ñ7Ô8ô —7‘7—=‘= §¡Ó+¨AÑ.ˆÜˆAÜŸJ™J×3Ñ3°A·F±F¸HÓEˆMð (×/Ñ/°°TÓ:×A¸cˆKØ�GŠGð ×%Ô%Ø—F”FÛØ—J‘J–Lðôð ×%×%Ø—‘ð.ôô ˜!œZ×(Ñ(¨Q¯W¯WØ—‘ÐJÔKØŸœ�AØ—G‘G˜d 1 # S¨¨¨4Ð0Ö1ñ !à—‘Ð1Ô2ä˜!œ[×)Ñ)¨a¯n¯nØ—‘ÐQÔRØŸœ�AØ—G‘G˜d 1§:¡:£< .°°A·J±J³L°>ÀÐFÖGñ (à—‘Ð1Ô2à�G‰GÐ$×%ñI ðN 	
�‰�Ôð 	
�‰ÐSÔTØ—”ˆAØ�G‰G�d˜1˜#˜S   4Ð(Ö)ñ à	�‰Ð(Ô)ð ˆØ!#ÐÛˆAÜ˜!œ[×)Ó)Ø×#Ñ# A§J¡J£LÔ1Ø78×7RÑ7RÐ&§z¡z£|Ó4ñ ð 	×ÑÔà	�‰ÐSÔTÛˆAØ—]”]�Ø+Ñ.×2Ñ2°1Ó8�ð —’ó ÛÛð	ôð —’ó ÛÛð	öó #ñ ð. 	
�‰Ð(Ô)ð 	
�‰ÐGÔHØ	�‰Ð2Ô3Ø	�‰Ð(Ô)ô ÑK¡+ÓK×KÑKØ�G‰GÐGÔHÛ �Ü! !¤Z×0Ñ0ÙØ !§	¤	�HØ—G‘G˜d 8×#4Ñ#4Ó#6Ð"7°s¸1¿:¹:»<¸.ÈÐMÖNó !*ñ !ð
 �G‰GÐ,Ô-à	�‰�Ô à	�‰�	r   )r:   r4   r`   r_   r^   )NNT)r+   r,   r-   r.   rE   r?   rt   ru   ÚWriteOnDiffra   r/   r   r   r	   r[   r[   ¾   s'   † Ù!ð MQô#ðJ Ÿ:™:×1Ñ1÷ Gr   r[   )Úmsvs_new)rE   r   r7   ÚrandomÚoperatorr   Ú
gyp.commonrt   r
   r   r=   r!   r#   r1   rG   r[   r   r   r	   Ú<module>r‘      su   ðñ
 >ã Û 	Û Ý ã òð
 ‡‚„ð 8Ø6ñÐ ô÷JQñ Qô"Ð"ô "ôPE/Ð#ô E/÷Voò or   