PHP 8.2.30
Preview: MSVSToolFile.py Size: 1.75 KB
/opt/alt/alt-nodejs19/root/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py

# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""Visual Studio project reader/writer."""

import gyp.easy_xml as easy_xml


class Writer:
    """Visual Studio XML tool file writer."""

    def __init__(self, tool_file_path, name):
        """Initializes the tool file.

    Args:
      tool_file_path: Path to the tool file.
      name: Name of the tool file.
    """
        self.tool_file_path = tool_file_path
        self.name = name
        self.rules_section = ["Rules"]

    def AddCustomBuildRule(
        self, name, cmd, description, additional_dependencies, outputs, extensions
    ):
        """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.
    """
        rule = [
            "CustomBuildRule",
            {
                "Name": name,
                "ExecutionDescription": description,
                "CommandLine": cmd,
                "Outputs": ";".join(outputs),
                "FileExtensions": ";".join(extensions),
                "AdditionalDependencies": ";".join(additional_dependencies),
            },
        ]
        self.rules_section.append(rule)

    def WriteIfChanged(self):
        """Writes the tool file."""
        content = [
            "VisualStudioToolFile",
            {"Version": "8.00", "Name": self.name},
            self.rules_section,
        ]
        easy_xml.WriteXmlIfChanged(
            content, self.tool_file_path, encoding="Windows-1252"
        )

Directory Contents

Dirs: 2 × Files: 25

Name Size Perms Modified Actions
generator DIR
- drwxr-xr-x 2024-03-03 22:54:11
Edit Download
- drwxr-xr-x 2024-03-03 22:54:11
Edit Download
22.22 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
2.12 KB lrwxr-xr-x 2023-12-06 18:07:51
Edit Download
5.16 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
3.63 KB lrwxr-xr-x 2023-12-06 18:07:51
Edit Download
1.85 KB lrwxr-xr-x 2023-12-06 18:07:51
Edit Download
123.75 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
3.35 KB lrwxr-xr-x 2023-12-06 18:07:51
Edit Download
29.56 KB lrwxr-xr-x 2023-12-06 18:07:51
Edit Download
12.79 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
6.58 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
44.29 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
72.56 KB lrwxr-xr-x 2023-12-06 18:07:51
Edit Download
1.75 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
5.21 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
9.99 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
19.28 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
53.08 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
5.51 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
1.26 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
14.82 KB lrwxr-xr-x 2023-12-06 18:07:51
Edit Download
132.54 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
79.92 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
11.84 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
2.19 KB lrw-r--r-- 2023-12-06 18:07:51
Edit Download
23.54 KB lrwxr-xr-x 2023-12-06 18:07:51
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).