Ë bæYp@›¨Žãóò—dZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZd„ZGd„de«Zd„Zd„Zed k(r&e j*ee j,d d««yy) zˆUtility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. é)Úprint_functionNcój—t«}|j|«}|�tj|«yy©N)ÚMacToolÚDispatchÚsysÚexit)ÚargsÚexecutorÚ exit_codes ú1/usr/lib/python3.12/site-packages/gyp/mac_tool.pyÚmainrs0€Ü ‹Y€(Ø×Ñ Ó%€)ØÐ܇H�HˆYÕðócó¸—eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zy)rz‚This class performs all the Mac tooling steps. The methods can either be executed directly, or dispatched from an argument list.có†—t|«dkr td«‚d|j|d«z}t||«|ddŽS)z(Dispatches a string command to a method.ézNot enough argumentszExec%srN)ÚlenÚ ExceptionÚ_CommandifyNameÚgetattr)Úselfr Úmethods r rzMacTool.Dispatch&sL€ä ˆ4ƒy�1‚}Ü Ð,Ó -Ð-à ˜×,Ñ,¨T°!©WÓ5Ñ 5€FØ Œ7�4˜Ó  $ q r (Ð +Ð+rcóB—|j«jdd«S)zÓ?€Ið Ü×&Ñ& tÓ,€fð"ÐØ×!Ñ!Ö#ˆØ—[‘[ Ó)€lØ × Ñ  Ô .Ø!-ÑØ�‰˜|Õ,Ù !Ü Ð&Ô 'Ø#'Ð Ü ˆlÕð$ð øô × (Ñ (ò Ü ˆA�H‰H„oØ ûð úsÆ H È H9ÈH4È4H9c ó<—tjddddd||g«y)Nr6Úplutilú-convertÚbinary1ú-o)rQÚ check_call)rr1s r r/zMacTool._ConvertToBinary~s&€Ü×ÑØ�˜: y°$¸¸dðDõErcól—|j|«xsd}ddl}t|d«j«}|j d|t |««}|j d|dd«\}}|ryt|d«} | j|j|«jd««| j«y)zFCopies a .strings file using iconv to reconvert the input into UTF-16.úUTF-8rNÚrbÚwbúUTF-16) Ú_DetectInputEncodingÚCoreFoundationÚopenÚreadÚ CFDataCreaterÚCFPropertyListCreateFromXMLDataÚwriterWÚencodeÚclose) rr0r1Ú input_codermÚsÚdÚ_ÚerrorÚfps r r,zMacTool._CopyStringsFile‚sž€à×*Ñ*¨6Ó2Ò=°g€JóÜ ˆV�TÓ×ÑÓ!€AØ×#Ñ# D¨!¬S°«VÓ4€AØ×=Ñ=¸dÀAÀqÈ$ÓO�H€A€uÙ Ø ä ˆd�DÓ €B؇H�HˆQ�X‰X�jÓ !× (Ñ (¨Ó 2Ô3؇H�H…Jrcóú—t|d«} |jd«}|j«|jd«ry|jd«ry|jd«ryy#|j«YyxYw) z�Reads the first few bytes from file_name and tries to guess the text encoding. Returns None as a guess if it can't detect it.riéNsþÿrksÿþsrh)rnrortÚ startswith)rÚ file_namerzÚheaders r rlzMacTool._DetectInputEncoding–sv€ô ˆi˜Ó €BðØ�w‰w�q‹z€fð‡H�H„JØ ×јÔ%Ø Ø × Ñ ˜;Ô 'Ø Ø × Ñ ˜?Ô +Ø à øð؇h�h„jÙ ús ŽA&Á&A:cóL—t|d«}|j«}|j«tj|«}|r'|j t j|d««tj|«}tjd«}tjD]²} | jd«rŒd| z} tj| } |j| | «}d| z} |jdtj| «} |j| | «}d| z} |jdtj| «} |j| | «}Œ´|j!d «}t#t%|««D]2} || j'«jd «sŒ&d || <d || d z <Œ4d j)t+d „|««}t|d«}|j-|«|j«|j/|«|dk(r|j1|«y y )zCCopies the |source| Info.plist to the destination directory |dest|.Úrrz[_/\s]rxz${%s}z${%s:identifier}z${%s:rfc1034identifier}rÚ z ${Nrcó —|duSr©©Úxs r Úz+MacTool.ExecCopyInfoPlist..Ôs€ q°¡}rÚwr )rnrortÚplistlibÚreadPlistFromStringÚupdateÚjsonÚloadsÚwritePlistToStringrOrPr"rMr}rÚsubÚsplitÚrangerÚstriprLÚfilterrrÚ _WritePkgInfor/) rr0r1r2ÚkeysÚfdÚlinesÚplistÚIDENT_REÚkeyÚevarÚevalueÚis r ÚExecCopyInfoPlistzMacTool.ExecCopyInfoPlist©sÑ€ô ˆf�cÓ €BØ �G‰G‹I€E؇H�H„Jô × (Ñ (¨Ó /€EÙ Ø ‡l�l”4—:‘:˜d 1™gÓ&Ô'Ü × 'Ñ '¨Ó .€Eô�z‰z˜)Ó$€HÜ�zŒzˆØ �‰˜Ô ØØ �s‰]€dÜ�z‰z˜#‰€fØ�m‰m˜D &Ó)€eð  #Ñ %€dØ�|‰|˜C¤§¡¨C¡Ó1€fØ�m‰m˜D &Ó)€eà &¨Ñ ,€dØ�|‰|˜C¤§¡¨C¡Ó1€fØ�m‰m˜D &Ó)�eð'ð, �K‰K˜Ó €EÜ ”3�u“:Ö ˆØ ˆq‰�‰Ó × $Ñ $ \Õ 2؈ˆa‰Øˆˆa�!‰eŠ ðð �I‰I”fÑ4°eÓ<Ó =€Eô ˆd�C‹€B؇H�HˆU„O؇H�H„Jð ×Ñ�tÔà˜FÒ"Ø ×јDÕ!ð#rcój—tj|«}|sy|d}|dk7ry|jdd«}t|«dk7rd}tj j tj j|«d«}t|d«}|j|›|›�«|j«y) z@This writes the PkgInfo file from the data stored in Info.plist.NÚCFBundlePackageTypeÚAPPLÚCFBundleSignaturez????éÚPkgInforˆ) r‰Ú readPlistÚgetrr"r#rLrHrnrrrt)rÚ info_plistr˜Ú package_typeÚsignature_coder1rzs r r”zMacTool._WritePkgInfoâs›€ä × Ñ ˜zÓ *€EÙ Ø ðÐ.Ñ/€LØ�vÒØ ð —Y‘YÐ2°FÓ;€NÜ ˆ>Ó˜aÒØ€nä �7‰7�<‰<œŸ™Ÿ™¨ Ó3°YÓ ?€DÜ ˆd�C‹€B؇H�H‘|¡^Ð 4Ô5؇H�H…Jrcó—tj|tjtjztjzd«}t j |t j«tj|«S)z5Emulates the most basic behavior of Linux's flock(1).i¶) r"rnÚO_RDONLYÚO_NOCTTYÚO_CREATÚfcntlÚflockÚLOCK_EXrQÚcall)rÚlockfileÚcmd_listr–s r Ú ExecFlockzMacTool.ExecFlockùsM€ô �‰�œ2Ÿ;™;¤r§{¡{Ñ2´2·:±:Ñ=¸uÓ E€BÜ ‡K�K�”E—M‘MÔ"Ü �?‰?˜8Ó $Ð$rcóÒ—tjd«}tjd«}tjj «}d|d<t j |t j|¬«}|j«\}}|j«D]R}|jd«} |j| «rŒ&|j| «rŒ8t| tj¬«ŒT|jset!t#|«dz «D]K} || d k(sŒ || dzj%d «sŒ$tj&|| dzd «|jS|jS) zQCalls libtool and filters out '/path/to/libtool: file: foo.o has no symbols'.z?^.*libtool: (?:for architecture: \S* )?file: .* has no symbols$zƒ^.*libtool: warning for library: .* the table of contents is empty \(no object file members in the library define global symbols\)$Ú1Ú ZERO_AR_DATE)ÚstderrÚenvrG©Úfilerrez.aN)rOrPr"rMr.rQÚPopenÚPIPEÚ communicaterVrWrXrTrr¸Ú returncoder‘rÚendswithÚutime) rr³Ú libtool_reÚ libtool_re5r¹Ú libtooloutrxÚerrr_r`r�s r ÚExecFilterLibtoolzMacTool.ExecFilterLibtools3€ô—‘ð8ó9€Jä—*‘*ð LóM€Kô �*‰*�/‰/Ó €Cð €CˆÑÜ×!Ñ! (´:·?±?ÈÔL€JØ × #Ñ #Ó %�F€A€sØ—‘Ö ˆØ—[‘[ Ó)€lØ × Ñ ˜lÕ +°K×4EÑ4EÀlÕ4SÜ ˆl¤§¡Ö,ð!ð × Ò Ü”S˜“] QÑ&Ö'ˆ!Ø �A‰;˜$Ó  8¨A¨a©C¡=×#9Ñ#9¸$Õ#?Ü �(‰(�8˜A˜a™C‘= $Ô 'Ø Ø × Ñ Ð ð (ð × Ñ Ð rcó¶—tjj|«jd«d}tjj |d«}tjj |«stj |«d|›d|›d�}ttjj |d«d«}|j|«|j«y) NÚ.rÚModuleszframework module z { umbrella header "z*.h" export * module * { export * } } zmodule.modulemaprˆ) r"r#Úbasenamer�rLr'Úmkdirrnrrrt)rÚ frameworkÚbinaryÚ module_pathÚmodule_templateÚ module_files r ÚExecPackageIosFrameworkzMacTool.ExecPackageIosFrameworks�€ä �W‰W× Ñ ˜iÓ (× .Ñ .¨sÓ 3°AÑ 6€FÜ—'‘'—,‘,˜y¨)Ó4€KÜ �7‰7�>‰>˜+Ô &܇h�hˆ{Ôøò &¢vð /€Oô”r—w‘w—|‘| KÐ1CÓDÀcÓJ€KØ×Ñ�oÔ&Ø×ÑÕrcó’—tjj|«jd«d}d}d}d}tjj tjj ||||««sytj «}tj|«|j|tjj ||««|jtjj |||«|«|jtjj |||«|«tj|«y)zeTakes a path to Something.framework and the Current version of that and sets up all the symlinks.rÈrÚCurrentÚ ResourcesÚVersionsN) r"r#rÊr�r'rLÚgetcwdÚchdirÚ_Relink)rrÌÚversionrÍÚCURRENTÚ RESOURCESÚVERSIONSÚpwds r ÚExecPackageFrameworkzMacTool.ExecPackageFramework/sä€ô�W‰W× Ñ ˜iÓ (× .Ñ .¨sÓ 3°AÑ 6€Fà€GØ€IØ€Hä �7‰7�>‰>œ"Ÿ'™'Ÿ,™, y°(¸GÀVÓLÔ Mð ô �)‰)‹+€C܇H�HˆYÔð ‡L�L�œ"Ÿ'™'Ÿ,™, x°Ó9Ô:ð ‡L�L”—‘—‘˜h¨°Ó8¸&ÔA؇L�L”—‘—‘˜h¨°Ó;¸YÔGô‡H�HˆS…Mrcó˜—tjj|«rtj|«tj||«y)zZCreates a symlink to |dest| named |link|. If |link| already exists, it is overwritten.N)r"r#ÚlexistsÚremoveÚsymlink)rr1Úlinks r rØzMacTool._RelinkLs-€ô ‡w�w‡��tÔ܇i�i�„o܇J�Jˆt�TÕrcóf—tjj|«jd«d}t tjj |«}i}|D]I}tjj|«}|||<||tjj ||«<ŒKt||«y)NrÈr)r"r#rÊr�ÚmapÚabspathrLÚ WriteHmap)rÚoutrÌÚ all_headersÚframework_nameÚfilelistrÚfilenames r Ú ExecCompileIosFrameworkHeaderMapz(MacTool.ExecCompileIosFrameworkHeaderMapSsŒ€Ü—W‘W×%Ñ% iÓ0×6Ñ6°sÓ;¸AÑ>€NÜ”b—g‘g—o‘o {Ó3€KØ€Hۈܗ‘×!Ñ! &Ó)€hØ!€hˆxÑØ9?€hŒr�w‰w�|‰|˜N¨HÓ5Ò6ðôˆc�8Õrc ó\—tjj|d«}tjj|«stj|«|D]S}t j |tjj|tjj|«««ŒUy)NÚHeaders)r"r#rLr'Úmakedirsr(r.rÊ)rrÌÚ copy_headersÚ header_pathrs r ÚExecCopyIosFrameworkHeadersz#MacTool.ExecCopyIosFrameworkHeaders]sh€Ü—'‘'—,‘,˜y¨)Ó4€KÜ �7‰7�>‰>˜+Ô &܇k�k�+ÔÛˆÜ ‡k�k�&œ"Ÿ'™'Ÿ,™, {´B·G±G×4DÑ4DÀVÓ4LÓMÕNñrcó—gd¢}dtjv}|r†tjdjd«d}|dvrd}|jd|d d d d d tjdd tjj tjd«g «nX|jddd dd tjdd tjj tjd«g«|rÅt j|«}|j«D]�\}}d|z}t|t«r|sŒ|j|«Œ0t|t«r3|D]-} |j|«|jt| ««Œ/Œs|j|«|jt|««ŒŸ|jttjj |««tj |«y)a¤Compiles multiple .xcassets files into a single .car file. This invokes 'actool' to compile all the inputs .xcassets files. The |keys| arguments is a json-encoded dictionary of extra arguments to pass to 'actool' when the asset catalogs contains an application icon or a launch image. Note that 'actool' does not create the Assets.car file if the asset catalogs does not contains imageset. )r6ÚactoolrDrEz--compress-pngsr:r9r8r=Ú CONFIGURATIONréÿÿÿÿ)ÚiphoneosÚiphonesimulatorrùz --platformr>r?r@rArFÚCONTENTS_FOLDER_PATHÚmacosxrBrCÚ!UNLOCALIZED_RESOURCES_FOLDER_PATHz--N)r"rMr�rNr#rærŒr�ÚitemsÚ isinstanceÚboolÚappendÚlistÚstrrårQrf) rr•ÚinputsÚ command_lineÚis_iphone_targetÚplatformršÚvalueÚarg_nameÚvs r ÚExecCompileXcassetszMacTool.ExecCompileXcassetsds°€ò€Lð4´r·z±zÐAÐÙÜ—‘˜OÑ,×2Ñ2°3Ó7¸Ñ;€hØ Ð8Ñ 8Ø$ˆØ×ÑØ ˜Ð"3°XØ ˜VÐ%BÜ �*‰*Ð1Ñ 2°KÜ �'‰'�/‰/œ"Ÿ*™*Ð%;Ñ<Ó =ð õ ð×ÑØ ˜Ð"3°UØ '¬¯©Ð4NÑ)OØ Ü �'‰'�/‰/œ"Ÿ*™*Ð%HÑIÓ Jð ô ñ  Ü �Z‰Z˜Ó €dØŸ ™ ž ‰*ˆ#ˆuؘ#‘:ˆÜ �eœTÔ "Ú Ø × Ñ  Õ )Ü ˜œtÔ $ÛˆaØ × Ñ  Ô )Ø × Ñ ¤ A£Õ 'ñð × Ñ ˜hÔ 'Ø × Ñ œc %›jÕ )ð%ð×ÑœœBŸG™GŸO™O¨VÓ4Ô5Ü×ј,Õ'rcóˆ—i}|D]%}|j|«}|j||«Œ'tj||«y)z6Merge multiple .plist files into a single .plist file.N)Ú_LoadPlistMaybeBinaryÚ _MergePlistr‰Ú writePlist)rrUrÚ merged_plistr#r˜s r ÚExecMergeInfoPlistzMacTool.ExecMergeInfoPlist˜sC€à€LÛˆØ×(Ñ(¨Ó.€eØ ×Ñ�| UÕ+ðô ×ј  fÕ-rcó$—|j||j««\}}|j|||«}ddd|g} |dk(r| jddg«n| jd|g«| jd|g«t j | «y ) amCode sign a bundle. This function tries to code sign an iOS bundle, following the same algorithm as Xcode: 1. pick the provisioning profile that best match the bundle identifier, and copy it into the bundle as embedded.mobileprovision, 2. copy Entitlements.plist from user or SDK next to the bundle, 3. code sign the bundle. Úcodesignz--forcez--signr z--deepz+--preserve-metadata=identifier,entitlementsz--entitlementsz--timestamp=noneN)Ú_InstallProvisioningProfileÚ_GetCFBundleIdentifierÚ_InstallEntitlementsrNrQrf) rršÚ entitlementsÚ provisioningr#ÚpreserveÚ substitutionsÚ overridesÚentitlements_pathr s r ÚExecCodeSignBundlezMacTool.ExecCodeSignBundle sœ€ð $×?Ñ?Ø�d×1Ñ1Ó3ó 5Ñ€M�9à×1Ñ1Ø�m Yó0Ðð ˜  8¨SÐ 1€DØ�6ÒØ ‡k�k�8ÐJÐKÕLà ‡k�kÐ#Ð%6Ð7Ô8؇K�KÐ# TÐ*Ô+Ü×ј$Õrcó—|j||«\}}}tjjtjdtjdd«}t j ||«|j||dz«}||dfS)aÊInstalls embedded.mobileprovision into the bundle. Args: profile: string, optional, short name of the .mobileprovision file to use, if empty or the file is missing, the best file installed will be used bundle_identifier: string, value of CFBundleIdentifier from Info.plist Returns: A tuple containing two dictionary: variables substitutions and values to overrides when generating the entitlements file. ÚBUILT_PRODUCTS_DIRrúzembedded.mobileprovisionrÈÚ Entitlements)Ú_FindProvisioningProfiler"r#rLrMr(Úcopy2Ú_GetSubstitutions)rÚprofileÚbundle_identifierÚ source_pathÚprovisioning_dataÚteam_idÚ target_pathrs r rz#MacTool._InstallProvisioningProfile·s‰€ð/3×.KÑ.KØÐ"ó/$Ñ+€KÐ" Gä—'‘'—,‘,Ü � ‰ Ð'Ñ(Ü � ‰ Ð)Ñ*Ø"ó$€Kô ‡L�L�˜kÔ*Ø×*Ñ*Ð+<¸gȹmÓL€MØ Ð+¨NÑ;Ð ;Ð;rcóŠ—tjjtjdddd«}tjj |«s3t d|zt j¬«t jd«d}|rEtjj||d z«}tjj|«r|g}|s3tjtjj|d ««}i}|D]r}|j|«}|jd i«jd d «}|jdg«D](} | ›d|›�} tj| |«sŒ!||| f||<Œ*Œt|s3t d|zt j¬«t jd«t|d„¬«} || S)a/Finds the .mobileprovision file to use for signing the bundle. Checks all the installed provisioning profiles (or if the user specified the PROVISIONING_PROFILE variable, only consult it) and select the most specific that correspond to the bundle identifier. Args: profile: string, optional, short name of the .mobileprovision file to use, if empty or the file is missing, the best file installed will be used bundle_identifier: string, value of CFBundleIdentifier from Info.plist Returns: A tuple of the path to the selected provisioning profile, the data of the embedded plist in the provisioning profile and the team identifier to use for code signing. Raises: SystemExit: if no .mobileprovision can be used to sign the bundle. ÚHOMEÚLibraryÚ MobileDevicezProvisioning Profilesz&cannot find mobile provisioning for %srºrNz.mobileprovisionz*.mobileprovisionrzapplication-identifierrÚTeamIdentifierrÈcó—t|«Sr©r)r s r r‡z2MacTool._FindProvisioningProfile..s€Ä#ÀaÄ&r©rš)r"r#rLrMr&rTrr¸r r'ÚglobÚ_LoadProvisioningProfiler¦ÚfnmatchÚmax) rr#r$Ú profiles_dirÚprovisioning_profilesÚ profile_pathÚvalid_provisioning_profilesÚ profile_dataÚapp_id_patternÚteam_identifierÚapp_idÚ selected_keys r r z MacTool._FindProvisioningProfileÎs�€ô*—7‘7—<‘<Ü � ‰ �6јI ~Ð7NóP€Lä �7‰7�=‰=˜Ô &Ü Ø 2Ð5FÑ FÜ�z‰zõô ‡h�hˆq„kØ ÐÙÜ—W‘W—\‘\ ,°Ð:LÑ0LÓM€lÜ �‰�‰˜ Ô %Ø!- ÐÙ Ü"Ÿi™iÜ �'‰'�,‰,�|Ð%8Ó 9ó;Ðà"$ÐÛ-ˆ Ø×2Ñ2°<Ó@€lØ#×'Ñ'Ø ˜"óß!™cÐ":¸BÓ?ðà)×-Ñ-Ð.>ÀÖCˆ/Ú+Ñ->Ð?ˆÜ �?‰?˜6 >Õ 2à˜L¨/ð9;Ð % nÒ 5ñDð .ñ 'Ü Ø 2Ð5FÑ FÜ�z‰zõô ‡h�hˆq„kôÐ2Ñ8HÔI€LØ & |Ñ 4Ð4rc óØ—tj«5}tjdddd|d|jg«|j |j«cddd«S#1swYyxYw)zãExtracts the plist embedded in a provisioning profile. Args: profile_path: string, path to the .mobileprovision file Returns: Content of the plist embedded in the provisioning profile as a dictionary. ÚsecurityÚcmsz-Dz-ireN)ÚtempfileÚNamedTemporaryFilerQrfÚnamer )rr7Útemps r r2z MacTool._LoadProvisioningProfilesX€ô × $Ñ $Ô &¨$Ü×ÑØ �e˜T 4¨°t¸T¿Y¹YðHôIà × 'Ñ '¨¯ © Ó 2÷ '× &Ò &ús •AA Á A)cóÞ—|j«D]Z\}}t|t«r@|j|i«}t|t«r|j ||«|||<ŒP|||<ŒV|||<Œ\y)z"Merge |plist| into |merged_plist|.N)rýrþÚdictr¦r )rrr˜ršrÚ merged_values r r zMacTool._MergePlistsj€à—k‘k–m‰ ˆˆUÜ �Eœ4Ô Ø#×'Ñ'¨¨RÓ0ˆ Ü �l¤DÔ )Ø × Ñ ˜<¨Ô /Ø*ˆ,�sÒ à#ˆ,�sÒ à!ˆ �SÒñ$rcóT— tj|«S#YnxYwtj«5}t j ||j «tjddd|j g«tj|j «cddd«S#1swYyxYw)a}Loads into a memory a plist possibly encoded in binary format. This is a wrapper around plistlib.readPlist that tries to convert the plist to the XML format if it can't be parsed (assuming that it is in the binary format). Args: plist_path: string, path to a plist file, in XML or binary format Returns: Content of the plist as a dictionary. rbrcÚxml1N) r‰r¥rArBr(r!rCrQrf)rÚ plist_pathrDs r r zMacTool._LoadPlistMaybeBinary"s}€ð ô× Ñ   Ó +Ð+øð Ù úÜ × $Ñ $Ô &¨$Ü ‡l�l�:˜tŸy™yÔ)Ü×јX z°6¸4¿9¹9ÐEÔFÜ × Ñ  § ¡ Ó *÷ '× &Ò &ús‚—²A"BÂB'có —||dœS)aFConstructs a dictionary of variable substitutions for Entitlements.plist. Args: bundle_identifier: string, value of CFBundleIdentifier from Info.plist app_identifier_prefix: string, value for AppIdentifierPrefix Returns: Dictionary of substitutions to apply when generating Entitlements.plist. )ÚCFBundleIdentifierÚAppIdentifierPrefixr„)rr$Úapp_identifier_prefixs r r"zMacTool._GetSubstitutions;s€ð.Ø2ñ ðrcó²—tjjtjdtjd«}|j |«}|dS)zžExtracts CFBundleIdentifier value from Info.plist in the bundle. Returns: Value of CFBundleIdentifier in the Info.plist located in the bundle. ÚTARGET_BUILD_DIRÚINFOPLIST_PATHrL)r"r#rLrMr )rÚinfo_plist_pathÚinfo_plist_datas r rzMacTool._GetCFBundleIdentifierJsN€ô —g‘g—l‘lÜ � ‰ Ð%Ñ&Ü � ‰ Ð#Ñ$ó&€Oð×0Ñ0°ÓA€OØ Ð/Ñ 0Ð0rcóÄ—|}tjjtjdtjddz«}|s1tjjtjdd«}t j ||«|j |«}|j||«}|r|D]}||vsŒ||||<Œtj||«|S)a[Generates and install the ${BundleName}.xcent entitlements file. Expands variables "$(variable)" pattern in the source entitlements file, add extra entitlements defined in the .mobileprovision file and the copy the generated plist to "${BundlePath}.xcent". Args: entitlements: string, optional, path to the Entitlements.plist template to use, defaults to "${SDKROOT}/Entitlements.plist" substitutions: dictionary, variable substitutions overrides: dictionary, values to add to the entitlements Returns: Path to the generated entitlements file. rÚ PRODUCT_NAMEz.xcentÚSDKROOTzEntitlements.plist) r"r#rLrMr(r!r Ú_ExpandVariablesr‰r)rrrrr%r(Údataršs r rzMacTool._InstallEntitlementsVsÊ€ð €KÜ—'‘'—,‘,Ü � ‰ Ð'Ñ(Ü � ‰ �>Ñ" XÑ-ó/€Kñ Ü—G‘G—L‘LÜ �*‰*�YÑ Ø ó €kô ‡L�L�˜kÔ*Ø × %Ñ % kÓ 2€DØ × Ñ   }Ó 5€DÙÛˆ#Ø �dŠ?Ø ‘nˆ$ˆsŠ)ðô ×ј˜kÔ*Ø Ðrcó`—t|t«r/|j«D]\}}|jd|z|«}Œ|St|t«r |D�cgc]}|j ||«‘Œc}St|t «r$|D�cic]}||j |||«“Œc}S|Scc}wcc}w)azExpands variables "$(variable)" in data. Args: data: object, can be either string, list or dictionary substitutions: dictionary, variable substitutions to perform Returns: Copy of data where each references to "$(variable)" has been replaced by the corresponding value found in substitutions, or left intact if the key was not found. z$(%s))rþrrýrrrWrF)rrXrršrr Úks r rWzMacTool._ExpandVariablesxs­€ô�$œÔØ%×+Ñ+Ö-‰*ˆ#ˆuØ�|‰|˜G c™M¨5Ó1‰ð.à €kÜ�$œÔÙ?CÓ D¹t¸!ˆd×#Ñ# A }Õ5¸tÑ DÐDÜ�$œÔÙHLÓ MÉÀ1ˆa�×&Ñ& t¨A¡w° Ó>Ñ>ÈÑ MÐMØ €KùòEùâ Ms ÁB&ÂB+N) Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr4r+r/r,rlržr”r´rÆrÑrÞrØrírór rrrr r2r r r"rrrWr„rr rr"sš„ñ=ò,ò0ò"ò6/ òbEòò(ò&7"òrò.%ò!ò<ò"ò:òòOò2(òh.ò ò.<ò.75òr 3ò "ò+ò2 ò 1ò óDrrcó(—d|j«zS)Né)Ú bit_lengthr…s r ÚNextGreaterPowerOf2rbŽs€Ø ˆQ�N‰NÓ Ñ Ðrc ó²—d}d}d}t|«}t|«}dd|zz}tt|j«d„¬«d«}t |d«} | j t jd |||||||««d g|z} |j«D]V\} } d} | D]!}| t|j««d zz } Œ#| | |dz z�| dz} | | |dz z�Œ| | f| | |dz z<ŒXd}| D]Ø}|€(| j t jd ddd««Œ-|\} } |}|t| «zdz}|ttjj| «tjz«zdz}|ttjj| ««zdz}| j t jd |||««ŒÚ| j t jd ««| D�]\}|€Œ|\} } | j t jdt| «z| ««| j t jdd««tjj| «tjz}| j t jdt|«z|««| j t jdd««tjj| «} | j t jdt| «z| ««| j t jdd««�Œ_y )aGenerates a header map based on |filelist|. Per Mark Mentovai: A header map is structured essentially as a hash table, keyed by names used in #includes, and providing pathnames to the actual files. The implementation below and the comment above comes from inspecting: http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt while also looking at the implementation in clang in: https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp ipamhrréé có—t|d«S)Nrr/)Úts r r‡zWriteHmap..£s €¼SÀÀ1Á¼Yrr0rjzÓ$?Ñ?À!ÑC€kØ ‡i�i”— ‘ ˜F J° ¸}ÓMÕNðð‡)�)ŒF�K‰K˜Ó Ôä€fØ ÑØ�l€tˆTØ ‡i�i”— ‘ ˜F¤S¨£YÑ.°Ó5Ô6Ø ‡i�i”— ‘ ˜D $Ó'Ô(Ü �W‰W�_‰_˜TÓ "¤R§V¡VÑ +€dØ ‡i�i”— ‘ ˜F¤S¨£YÑ.°Ó5Ô6Ø ‡i�i”— ‘ ˜D $Ó'Ô(Ü �W‰W× Ñ ˜dÓ #€dØ ‡i�i”— ‘ ˜F¤S¨£YÑ.°Ó5Ô6Ø ‡i�i”— ‘ ˜D $Ó'Ö(ñrÚ__main__r)r^Ú __future__rr®r3r1rŒr"r‰rOr(rjrQrrArÚobjectrrbrçr[r Úargvr„rr Úr€s~ðñ õ &ã ÛÛ Û Û ÛÛ Û Û ÛÛ Ûòôj ˆfôj òXò=)ð~ ˆzÒØ €#‡(�(‰4�—‘˜˜� Ó Õðr