File: //usr/lib/python3.6/site-packages/gyp/__pycache__/xcode_ninja.cpython-36.opt-1.pyc
3
��S](, � @ sP d Z ddlZddlZddlZddlZddlZdd� 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 $ C sH t jj| �\}}|d }|d }|jr6t jj|j|�}yt j|� W n0 tk
rt } z|jtjkrd� W Y dd}~X nX d}xJ| |gD ]>} t jjt jj | ��d d }
t
jjj
d|
�}
|d |
7 }q�W |d
7 }t jj|d�}y0t|d��}|j� }
|
|k�r dS W dQ R X W n tk
�r" Y nX t|d
��}|j|� W dQ R X dS )z8 Create a workspace to wrap main and sources gyp paths. z.xcworkspace�optionsNz'<?xml version="1.0" encoding="UTF-8"?>
z<Workspace version = "1.0">
r z
.xcodeprojzgroup:z$ <FileRef location = %s></FileRef>
z
</Workspace>
zcontents.xcworkspacedata�r�wzC<?xml version="1.0" encoding="UTF-8"?>
<Workspace version = "1.0">
)�os�path�splitextZgenerator_output�join�makedirs�OSError�errnoZEEXIST�basename�xmlZsaxZsaxutilsZ quoteattr�open�read�IOError�write)�main_gyp�sources_gyp�params�build_file_root�build_file_extZworkspace_pathr �eZ
output_string�gyp_name�nameZworkspace_fileZ
input_fileZinput_stringZoutput_file� r �!/usr/lib/python3.6/xcode_ninja.py�_WriteWorkspace s6
r c
C s d}d}|rB|d }t jj|jtjjj|��}|jdi �jdd�}| jd�}| jd|�}| jd�}i }||d<