MCPcopy Create free account
hub / github.com/nodejs/node / __init__

Method __init__

tools/gyp/pylib/gyp/MSVSNew.py:193–228  ·  view source on GitHub ↗

Initializes the solution. Args: path: Path to solution file. version: Format version to emit. entries: List of entries in solution. May contain Folder or Project objects. May be None, if the folder is empty. variants: List of build var

(
        self, path, version, entries=None, variants=None, websiteProperties=True
    )

Source from the content-addressed store, hash-verified

191 """Visual Studio solution."""
192
193 def __init__(
194 self, path, version, entries=None, variants=None, websiteProperties=True
195 ):
196 """Initializes the solution.
197
198 Args:
199 path: Path to solution file.
200 version: Format version to emit.
201 entries: List of entries in solution. May contain Folder or Project
202 objects. May be None, if the folder is empty.
203 variants: List of build variant strings. If none, a default list will
204 be used.
205 websiteProperties: Flag to decide if the website properties section
206 is generated.
207 """
208 self.path = path
209 self.websiteProperties = websiteProperties
210 self.version = version
211
212 # Copy passed lists (or set to empty lists)
213 self.entries = list(entries or [])
214
215 if variants:
216 # Copy passed list
217 self.variants = variants[:]
218 else:
219 # Use default
220 self.variants = ["Debug|Win32", "Release|Win32"]
221 # TODO(rspangler): Need to be able to handle a mapping of solution config
222 # to project config. Should we be able to handle variants being a dict,
223 # or add a separate variant_map variable? If it's a dict, we can't
224 # guarantee the order of variants since dict keys aren't ordered.
225
226 # TODO(rspangler): Automatically write to disk for now; should delay until
227 # node-evaluation time.
228 self.Write()
229
230 def Write(self, writer=gyp.common.WriteOnDiff):
231 """Writes the solution file to disk.

Callers

nothing calls this directly

Calls 2

WriteMethod · 0.95
listFunction · 0.50

Tested by

no test coverage detected