CasperSecurity

Current Path : /lib/python3/dist-packages/gyp/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/gyp/__pycache__/xcode_ninja.cpython-310.pyc

o

p.a(,�@sPdZddlZddlZddlZddlZddlZdd�Zdd�Z	dd�Z
d	d
�ZdS)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
Csztj�|�\}}|d}|d}|jrtj�|j|�}zt�|�Wnty;}z
|jtjkr1�WYd}~nd}~wwd}||fD]}	tj�tj�	|	��dd}
t
jj�
d|
�}
|d|
7}qB|d	7}tj�|d
�}z)t|d��}|��}
|
|kr�	Wd�WdSWd�n1s�wYWn	ty�Ynwt|d��}|�|�Wd�dS1s�wYdS)
z8 Create a workspace to wrap main and sources gyp paths. z.xcworkspace�optionsNzC<?xml version="1.0" encoding="UTF-8"?>
<Workspace version = "1.0">
rz
.xcodeprojzgroup:z$  <FileRef location = %s></FileRef>
z
</Workspace>
zcontents.xcworkspacedata�r�w)�os�path�splitext�generator_output�join�makedirs�OSError�errno�EEXIST�basename�xml�sax�saxutils�	quoteattr�open�read�IOError�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_file�r%�1/usr/lib/python3/dist-packages/gyp/xcode_ninja.py�_WriteWorkspacesF�������"�r'c
	Cs�d}d}|r!|d}tj�|jtjj�|��}|�di��dd�}|�d�}|�d|�}|�d�}i}||d<||d<|rA||d<|�d	�|d	<|�d
�|d
<i|d<i}	|r]d||	d
<d|vr�|d�	�D]7}
|d|
�di�}d|vr�d|	d<|d|	d<dD]}||vr�|||	|<q�i|d|
<|	|d|
d<qg|�dd�|d<|�dd�|d<|�dd�|d<|�dd�|d<|�dd�|d<|d|d<|r�d|ggddtj
ddd|	d
|gd|d�g|d <|dkr�|d dd!�d"|f�|S)#z- Create fake target for xcode-ninja wrapper. Nrr�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�typezCompile and copy %s via ninja�envzPATH=%s�PATH�ninjaz-C)�action_name�inputs�outputs�action�message�actionsrCz-j)rrr	�toplevel_dir�gyp�	generatorr?�ComputeOutputDir�get�keys�environ�extend)
�old_specr�ninja_toplevel�jobsrr*r+r,�ninja_target�new_xcode_settings�config�old_xcode_settings�keyr%r%r&�_TargetFromSpec8s~
��

�����
����rVcCsv|�d�}|durt�||�rdSt|�dd��dks+|�dd�dkr9|�d	d�d
kr9|dur7t�||�s7dSdSdS)apLimit 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*NTr8rr<��
executabler,�bundleF)rJ�re�search�int)�
target_extras�executable_target_pattern�specr*r%r%r&�IsValidTargetForWrapper�s

r`c!s6|dd}|��D]\}}||kr|d}q
|�di�}|�dd�}	|	dur5tj�|�\}
}|
d|}	g}i}
i}i||	<g||	d<g||	d	<||�d
i�||	d
<|�dd�}|�dd�}|D]N}||}t|||�r�|�d
�}d|	|f}|�|�t||�|
|<||�d�dd	D]}|d
|kr�i}|d
|d
<|d|d<||	d	�|�q�qed}t|ddddd�d�}dd|gii|d<|�dd�}g}|��D]_\}}tj�	|��|�dg�|�dg�}|s�|�
|�dg�|�dg��|�dg�D]}|�
|�d g��|�s|�
|�d!g���qd"d#�|D�}tj�	|	��|��fd$d#�|D�7}q�tt|��|d<tj�
tj�	|	�|d%�}d||f} |�| �||
| <i}|d
|d
<||d<d|d<i||<g||d	<g||d<||�d
i�||d
<||d	�|�t|	||�||
|fS)&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%s:%s#target�:r-�sources_for_indexing�target�Default�0rX)r*r-r.r7r<�include_dirsr/�xcode_ninja_list_excluded_filesT�sources�mac_bundle_resources�sources_excluded�mac_bundle_resources_excludedrErA�inputs_excludedcSsg|]	}|�d�s|�qS)�$)�
startswith��.0�filer%r%r&�
<listcomp>sz!CreateWrapper.<locals>.<listcomp>cs$g|]}tj�tj��|����qSr%)rr�relpathr	rv��base�
relative_pathr%r&rys�z.gyp)�itemsrJrrrr`�appendrV�split�dirnamerM�sorted�setr	r')!�target_list�target_dicts�datar�orig_gypr�gyp_dict�depthr(rrr�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_filesrorj�target_dict�filesrCr�fully_qualified_target_namer%r{r&�
CreateWrapper�s��
�
�

���	�

�
��
��
�

�
r�)�__doc__r�gyp.generator.ninjarGrrZ�xml.sax.saxutilsrr'rVr`r�r%r%r%r&�<module>s
"K
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY