o
    p.a                     @   s,   d Z ddlZddlmZ G dd deZdS )z$Visual Studio project reader/writer.    Nc                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )	Writerz#Visual Studio XML tool file writer.c                 C   s   || _ || _dg| _dS )zzInitializes the tool file.

    Args:
      tool_file_path: Path to the tool file.
      name: Name of the tool file.
    ZRulesN)tool_file_pathnamerules_section)selfr   r    r   2/usr/lib/python3/dist-packages/gyp/MSVSToolFile.py__init__   s   zWriter.__init__c              	   C   s8   d|||d |d |d |dg}| j| dS )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.
    ZCustomBuildRule;)NameZExecutionDescriptionZCommandLineZOutputsZFileExtensionsZAdditionalDependenciesN)joinr   append)r   r   cmddescriptionZadditional_dependenciesZoutputs
extensionsZruler   r   r   AddCustomBuildRule   s   	zWriter.AddCustomBuildRulec                 C   s*   dd| j d| jg}tj|| jdd dS )zWrites the tool file.ZVisualStudioToolFilez8.00)ZVersionr   zWindows-1252)encodingN)r   r   easy_xmlZWriteXmlIfChangedr   )r   Zcontentr   r   r   WriteIfChanged1   s   

zWriter.WriteIfChangedN)__name__
__module____qualname____doc__r	   r   r   r   r   r   r   r      s
    r   )r   Z
gyp.commonZgypZgyp.easy_xmlr   objectr   r   r   r   r   <module>   s   