ó
ÓnäZc           @   s;   d  Z  d d l Z d d l j Z d e f d     YZ d S(   s$   Visual Studio project reader/writer.i˙˙˙˙Nt   Writerc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   s#   Visual Studio XML tool file writer.c         C   s"   | |  _  | |  _ d g |  _ d S(   sz   Initializes the tool file.

    Args:
      tool_file_path: Path to the tool file.
      name: Name of the tool file.
    t   RulesN(   t   tool_file_patht   namet   rules_section(   t   selfR   R   (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSToolFile.pyt   __init__   s    		c         C   se   d i | d 6| d 6| d 6d j  |  d 6d j  |  d 6d j  |  d 6g } |  j j |  d	 S(
   s9  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.
    t   CustomBuildRulet   Namet   ExecutionDescriptiont   CommandLinet   ;t   Outputst   FileExtensionst   AdditionalDependenciesN(   t   joinR   t   append(   R   R   t   cmdt   descriptiont   additional_dependenciest   outputst
   extensionst   rule(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSToolFile.pyt   AddCustomBuildRule   s    
c         C   s@   d i d d 6|  j  d 6|  j g } t j | |  j d d d S(   s   Writes the tool file.t   VisualStudioToolFiles   8.00t   VersionR   t   encodings   Windows-1252N(   R   R   t   easy_xmlt   WriteXmlIfChangedR   (   R   t   content(    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSToolFile.pyt   WriteIfChanged1   s    

(   t   __name__t
   __module__t   __doc__R   R   R   (    (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSToolFile.pyR       s   		(   R!   t
   gyp.commont   gypt   gyp.easy_xmlR   t   objectR    (    (    (    s4   /usr/lib/python2.7/dist-packages/gyp/MSVSToolFile.pyt   <module>   s   