�
�"Kb � �: � d Z ddlZddlmZ G d� de� � ZdS )z$Visual Studio project reader/writer.� Nc �$ � e Zd ZdZd� Zd� Zd� ZdS )�Writerz#Visual Studio XML tool file writer.c �2 � || _ || _ dg| _ dS )zzInitializes the tool file.
Args:
tool_file_path: Path to the tool file.
name: Name of the tool file.
�RulesN)�tool_file_path�name�
rules_section)�selfr r s �2/usr/lib/python3/dist-packages/gyp/MSVSToolFile.py�__init__zWriter.__init__ s# � � )�D���D�I�!��D���� c �� � d|||d� |� � d� |� � d� |� � d�g}| j � |� � dS )a9 Adds a rule to the tool file.
Args:
name: Name of the rule.
description: Description of the rule.
cmd: Command line of the rule.
additional_dependencies: other files which may trigger the rule.
outputs: outputs of the rule.
extensions: extensions handled by the rule.
�CustomBuildRule�;)�Name�ExecutionDescription�CommandLine�Outputs�FileExtensions�AdditionalDependenciesN)�joinr �append)r
r �cmd�description�additional_dependencies�outputs�
extensions�rules r �AddCustomBuildRulezWriter.AddCustomBuildRule sn � �
��%0������)�)�"�x�x�
�3�3����1�2�2�
�
��D� ����d�#�#�#�#�#r
c �b � dd| j d�| j g}t j || j d�� � dS )zWrites the tool file.�VisualStudioToolFilez8.00)�Versionr zWindows-1252)�encodingN)r r �easy_xml�WriteXmlIfChangedr )r
�contents r �WriteIfChangedzWriter.WriteIfChanged1 sV � �%�!�� �� � �!� �G�
��w��(;�(6�8� 8� 8� 8� 8� 8r
N)�__name__�
__module__�__qualname__�__doc__r r r' |