관리-도구
편집 파일: MSVSToolFile.cpython-36.pyc
3 w�pe� � @ s d Z ddljZG dd� d�ZdS )z$Visual Studio project reader/writer.� Nc @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �Writerz#Visual Studio XML tool file writer.c C s || _ || _dg| _dS )zzInitializes the tool file. Args: tool_file_path: Path to the tool file. name: Name of the tool file. ZRulesN)�tool_file_path�name� rules_section)�selfr r � r �/MSVSToolFile.py�__init__ s zWriter.__init__c C s8 d|||dj |�dj |�dj |�d�g}| jj|� 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. ZCustomBuildRule�;)�NameZExecutionDescriptionZCommandLineZOutputsZFileExtensionsZAdditionalDependenciesN)�joinr �append)r r �cmd�descriptionZadditional_dependenciesZoutputs� extensionsZruler r r �AddCustomBuildRule s zWriter.AddCustomBuildRulec C s* dd| j d�| jg}tj|| jdd� dS )zWrites the tool file.ZVisualStudioToolFilez8.00)ZVersionr zWindows-1252)�encodingN)r r �easy_xmlZWriteXmlIfChangedr )r Zcontentr r r �WriteIfChanged2 s zWriter.WriteIfChangedN)�__name__� __module__�__qualname__�__doc__r r r r r r r r s r )r Zgyp.easy_xmlr r r r r r �<module> s