@halospv3/hce.shared-config
Version:
Automate commit message quality, changelogs, and CI/CD releases. Its `main` entry point is a Semantic Release config. Functions and classes are exposed for customization. An ESLint config, a Commitlint config, and addl. resources for .NET projects are als
1 lines • 43.5 kB
Source Map (JSON)
{"version":3,"file":"MSBuildProject.mjs","names":["debug"],"sources":["../../src/dotnet/MSBuildProject.ts"],"sourcesContent":["import { type, type Scope, type Type } from 'arktype';\nimport { warn } from 'node:console';\nimport { hash } from 'node:crypto';\nimport { type Dirent } from 'node:fs';\nimport { readdir, realpath, stat } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport path from 'node:path';\nimport { setTimeout } from 'node:timers/promises';\nimport { CaseInsensitiveMap } from '../CaseInsensitiveMap.ts';\nimport debug from '../debug.ts';\nimport { execAsync } from '../utils/execAsync.ts';\nimport { isError } from '../utils/isError.ts';\nimport { MSBuildProjectProperties } from './MSBuildProjectProperties.ts';\nimport {\n NPPGetterNames,\n NugetProjectProperties,\n} from './NugetProjectProperties.ts';\n\nconst debug_MSBP = debug.extend('MSBuildProject');\ndebug_MSBP.enabled = debug.enabled;\nconst debug_MSBP_PPTMSBP = debug_MSBP.extend('PackableProjectsToMSBuildProjects');\ndebug_MSBP_PPTMSBP.enabled = debug.enabled;\nconst debug_MSBP_Evaluate = debug_MSBP.extend('Evaluate');\ndebug_MSBP_Evaluate.enabled = debug.enabled;\n\nexport type TemporaryDirectoryNamespace_Unix = `${ReturnType<typeof tmpdir>}/HCE.Shared/.NET/`;\nexport type TemporaryDirectoryNamespace_Win = `${ReturnType<typeof tmpdir>}\\\\HCE.Shared\\\\.NET\\\\`;\nconst temporaryDirectoryNamespace = path.join(tmpdir(), 'HCE.Shared', '.NET') as TemporaryDirectoryNamespace_Unix | TemporaryDirectoryNamespace_Win;\ntype typeof_ArtifactsPath\n = | (`${TemporaryDirectoryNamespace_Unix}${string}/${string}/`)\n | (`${TemporaryDirectoryNamespace_Win}${string}\\\\${string}/`);\n\n/**\n * See [MSBuild well-known item metadata](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-well-known-item-metadata).\n * Additional string-type properties may be present (e.g. `{ SubType: \"designer\" }`).\n */\nconst interface_ItemMetadataBuiltIn = type({\n '[string]': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\ConsoleApp1.dll\" */\n Identity: 'string',\n /** @example \"Designer\" */\n 'SubType?': 'string',\n /** @example \".NETCoreApp\" */\n 'TargetFrameworkIdentifier?': 'string',\n 'TargetPlatformMoniker?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\obj\\\\Debug\\\\net6.0\\\\ConsoleApp1.csproj.CopyComplete\" */\n 'CopyUpToDateMarker?': 'string',\n 'TargetPlatformIdentifier?': 'string',\n /** @example \"6.0\" */\n 'TargetFrameworkVersion?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\obj\\\\Debug\\\\net6.0\\\\ref\\\\ConsoleApp1.dll\" */\n 'ReferenceAssembly?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\ConsoleApp1.dll\" */\n FullPath: 'string',\n /** @example \"c:\\\\\" */\n RootDir: 'string',\n /** @example \"ConsoleApp1\" */\n Filename: 'string',\n /** @example \".dll\" */\n Extension: 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\\" */\n RelativeDir: 'string',\n /** @example \"source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\\" */\n Directory: 'string',\n RecursiveDir: 'string',\n /** @example \"2023-11-30 13:38:06.5084339\" */\n ModifiedTime: 'string',\n /** @example \"2023-11-30 13:38:06.9308716\" */\n CreatedTime: 'string',\n /** @example \"2023-11-30 13:38:06.9318732\" */\n AccessedTime: 'string',\n /** @example \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Preview\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\Microsoft.Common.CurrentVersion.targets\" */\n DefiningProjectFullPath: 'string',\n /** @example \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Preview\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\\" */\n DefiningProjectDirectory: 'string',\n /** @example \"Microsoft.Common.CurrentVersion\" */\n DefiningProjectName: 'string',\n /** @example \".targets\" */\n DefiningProjectExtension: 'string',\n});\n\nconst targetSuccess = type({\n Result: '\\'Success\\'',\n Items: interface_ItemMetadataBuiltIn.array(),\n});\n\nconst targetFailure = type({\n Result: '\\'Failure\\'',\n Items: 'never[]',\n});\n\nconst msbuildEvaluationOutput: Type<{\n Properties?: Record<string, string> | undefined;\n Items?: Record<string, {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[]> | undefined;\n TargetResults?: Record<string, {\n Result: 'Success';\n Items: {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[];\n } | {\n Result: 'Failure';\n Items: never[];\n }> | undefined;\n}> = type({\n 'Properties?': type({ '[string]': 'string' }),\n 'Items?': type({ '[string]': interface_ItemMetadataBuiltIn.array() }),\n 'TargetResults?': type({ '[string]': targetSuccess.or(targetFailure) }),\n});\n\nexport class MSBuildEvaluationOutput {\n /**\n * The specified properties and their values as evaluated by MSBuild Core.\n * `-getProperty:{propertyName,...}`\n */\n Properties?: typeof msbuildEvaluationOutput.infer.Properties;\n /**\n * The specified items and their values and associated metadata as evaluated\n * by MSBuild Core.\n * `-getItem:{itemName,...}`\n */\n Items?: typeof msbuildEvaluationOutput.infer.Items;\n /**\n * The specified Targets and their output values as evaluated by MSBuild\n * Core.\n * `-getTargetResult:{targetName,...}`\n */\n TargetResults?: typeof msbuildEvaluationOutput.infer.TargetResults;\n\n /**\n * @param rawMSBuildEvaluation The output of a CLI MSBuild project evaluation.\n * May be the UTF-8 string-encoded JSON or the object decoded from that JSON.\n */\n constructor(rawMSBuildEvaluation: Parameters<typeof JSON.parse>[0] | Parameters<typeof msbuildEvaluationOutput.from>[0]) {\n /** `.assert` instead of `.from` to allow `unknown` JSON.parse return type */\n const knownObject = msbuildEvaluationOutput.assert(typeof rawMSBuildEvaluation === 'string' ? JSON.parse(rawMSBuildEvaluation) : rawMSBuildEvaluation);\n\n this.Properties = knownObject.Properties;\n this.Items = knownObject.Items;\n this.TargetResults = knownObject.TargetResults;\n }\n}\n\nexport const EvaluationOptions: Type<{\n FullName: string;\n /**\n * @see {@link NugetProjectProperties}\n * @description\n * User-defined Properties and their values.\n * `{ Configuration: \"Release\" }` will cause the MSBuild to first set the\n * Configuration property to Release before evaluating the project\n * or the project's Target(s).\n * ```txt\n * -property:<n>=<v> Set or override these project-level properties. <n> is\n * the property name, and <v> is the property value. Use a\n * semicolon or a comma to separate multiple properties, or\n * specify each property separately. (Short form: -p)\n * Example:\n * -property:WarningLevel=2;OutDir=bin\\Debug\\\n * ```\n */\n Property: Partial<{ -readonly [P in keyof NugetProjectProperties]: NugetProjectProperties[P] }>;\n Targets: readonly string[] | string[];\n GetItem: readonly string[] | string[];\n GetProperty: readonly string[] | string[];\n GetTargetResult: readonly string[] | string[];\n}> = Object.freeze(\n type({\n /**\n * The project file's full path.\n */\n FullName: 'string',\n /**\n * User-defined Properties and their values.\n * { Configuration: \"Release\" } will cause the MSBuild to first set the\n * Configuration property to Release before evaluating the project\n * or the project's Target(s).\n * ```txt\n * -property:<n>=<v> Set or override these project-level properties. <n> is\n * the property name, and <v> is the property value. Use a\n * semicolon or a comma to separate multiple properties, or\n * specify each property separately. (Short form: -p)\n * Example:\n * -property:WarningLevel=2;OutDir=bin\\Debug\\\n * ```\n */\n Property: type({ '[string]': 'string' })\n .as<{ -readonly [P in keyof NugetProjectProperties]: NugetProjectProperties[P] }>()\n .partial(),\n /**\n * The MSBuild Targets to run for evaluation. [\"Pack\"] is recommended.\n * Property values may be changed by Targets such as those provided by\n * dependencies.\n *\n * ```txt\n * -target:<targets> Build these targets in this project. Use a semicolon or a\n * comma to separate multiple targets, or specify each\n * target separately. (Short form: -t)\n * Example:\n * -target:Resources;Compile\n * ```\n * @default []\n */\n Targets: type.string.array().readonly().or('string[]'),\n /**\n * MSBuild Items to evaluate. `[\"Compile\"]` will result in the MSBuild output\n * including {@link MSBuild}\n */\n GetItem: type.string.array().readonly().or('string[]'),\n GetProperty: type.string.array().readonly().or('string[]'),\n GetTargetResult: type.string.array().readonly().or('string[]'),\n }),\n);\n\nexport class MSBuildProject {\n /**\n * Properties for multi-targeting `dotnet publish` outputs.\n * These are included in {@link NPPGetterNames.InstanceGettersRecursive}.\n */\n public static readonly MatrixProperties: readonly string[] = Object.freeze([\n 'TargetFramework',\n 'TargetFrameworks',\n 'RuntimeIdentifier',\n 'RuntimeIdentifiers',\n ]);\n\n /**\n * @param projectPath The full path of the project file or its directory. A\n * relative path may be passed, but will resolve relative to the current\n * working directory.\n * @param includeNonPublic Include conventionally internal/private MSBuild\n * targets in the result.\n * @returns A string array of the project's MSBuild targets.\n * @todo consider 'file' of -targets[:file]\n * Prints a list of available targets without executing the\n * actual build process. By default the output is written to\n * the console window. If the path to an output file\n * is provided that will be used instead.\n * (Short form: -ts)\n * Example:\n * -ts:out.txt\n */\n static async GetTargets(\n projectPath: string,\n // eslint-disable-next-line unicorn/consistent-boolean-name\n includeNonPublic = false,\n ): Promise<string[]> {\n const stdPair = await execAsync(`dotnet msbuild ${projectPath} -targets`, true);\n\n const targets = stdPair.stdout\n .split('\\n')\n .filter((v, index) => v !== '' && index !== 0)\n .map(v => v.replaceAll('\\r', ''))\n .sort((a, b) => a.localeCompare(b));\n return includeNonPublic\n ? targets\n : targets.filter(v => !v.startsWith('_'));\n }\n\n /**\n * Evaluate {@link Items}, {@link Properties}, and {@link TargetResults},\n * returning them as an instance of {@link MSBuildProject}.\\\n * Note: MSBuild will probably fail if Restore is skipped and another\n * target is specified. If you choose Pack, you must do ['Restore', 'Pack'].\n * @param options The result of {@link EvaluationOptions.from}.\n * @returns A promised {@link MSBuildProject} instance.\n * @throws {Error} if the exec command fails -OR- the JSON parse fails -OR-\n * MSBuildProject's constructor fails.\n * @see {@link PackableProjectsToMSBuildProjects} for most use-cases.\n */\n public static async Evaluate(\n options: typeof EvaluationOptions.inferOut,\n ): Promise<MSBuildProject> {\n if (\n options.GetProperty.length === 0\n && options.GetItem.length === 0\n && options.GetTargetResult.length === 0\n ) {\n throw new Error(\n 'No MSBuild Property, Item, or TargetResult queries were provided.',\n );\n }\n // We append this to ArtifactsPath for parallel evaluations\n const shortHashName = `options_SHA3-256_${\n hash(\n 'SHA3-256',\n JSON.stringify(options),\n ).slice(0, 7)\n }`;\n const debug_MSBP_Evaluate_hashed = debug_MSBP_Evaluate.extend(shortHashName);\n debug_MSBP_Evaluate_hashed.enabled = debug.enabled;\n // override `ArtifactsPath` instead of `IntermediateOutputPath` and `OutputPath` to resolve NETSDK1047, MC3074\n /** Update {@link typeof_ArtifactsPath} if this changes */\n options.Property.ArtifactsPath = path.join(\n temporaryDirectoryNamespace,\n path.basename(options.FullName, path.extname(options.FullName)),\n shortHashName,\n ) + '/';\n\n // reminder: args containing spaces and semi-colons MUST be quote-enclosed!\n options.FullName = MSBuildProjectProperties.GetFullPath(options.FullName);\n // disable GeneratePackageOnBuild so Pack can succeed when Build hasn't been run\n options.Property.GeneratePackageOnBuild = 'false';\n const _pairs = Object.entries<string>(options.Property).filter(p => typeof p[1] === 'string') as [\n ['ArtifactsPath', typeof_ArtifactsPath],\n ['GeneratePackageOnBuild', 'false'],\n ...[string, string][],\n ];\n const string_target\n = options.Targets.length === 0\n ? ''\n : `\"-t:${options.Targets.join(';')}\"`;\n const string_getItem\n = options.GetItem.length === 0\n ? ''\n : `\"-getItem:${options.GetItem.join(',')}\"`;\n const string_getProperty\n = options.GetProperty.length === 0\n ? ''\n : `\"-getProperty:${options.GetProperty.join(',')}\"`;\n const string_getTargetResult\n = options.GetTargetResult.length === 0\n ? ''\n : `\"-getTargetResult:${options.GetTargetResult.join(',')}\"`;\n const string_property_array: string[]\n = _pairs.map(([key, value]) => `\"-p:${key}=${value}\"`);\n\n const isTargetPack = string_target.toLocaleLowerCase().replaceAll('\"', '') == `-t:pack`;\n const commandLine = [\n 'dotnet',\n isTargetPack ? 'pack' : 'msbuild',\n `\"${options.FullName}\"`,\n '-restore',\n isTargetPack ? '' : string_target,\n string_getItem,\n string_getProperty,\n string_getTargetResult,\n ...string_property_array,\n ]\n .filter(v => v !== '')\n .join(' ');\n const output = await loopTryDotnetCommand({\n commandLine,\n customDebugger: debug_MSBP_Evaluate_hashed,\n projectName: path.basename(options.FullName, path.extname(options.FullName)),\n taskVerb: 'evaluate',\n timeoutMilliseconds: 360_000,\n });\n\n // todo: consider -getResultOutputFile:file\n // Redirect output from get* into a file.\n //\n // Example:\n // -getProperty:Bar -getResultOutputFile:Biz.txt\n // This writes the value of property Bar into Biz.txt.\n\n /**\n * The following issues have triggered this code path:\n * - BaseIntermediateOutputPath must use Unix path separators ('/') on all\n * platforms. Even Windows. Otherwise, MSBuild/dotnet will error-exit with\n * \"The BaseIntermediateOutputPath must end with a trailing slash\".\n */\n if (output.stdout.startsWith('MSBuild version')) {\n warn(output.stdout);\n throw new Error(\n 'dotnet msbuild was expected to output JSON, but output its version header instead.',\n );\n }\n\n let rawOutput: ConstructorParameters<typeof MSBuildEvaluationOutput>[0];\n if (output.stdout.startsWith('{')) {\n /** stdout is JSON string */\n rawOutput = output.stdout;\n }\n else if (options.GetProperty.length > 0 && options.GetProperty[0] !== undefined) {\n rawOutput = {\n Properties: {\n [options.GetProperty[0]]: String(JSON.parse(output.stdout)),\n },\n };\n }\n else {\n throw new Error('Dotnet/MSBuild evaluation output is not a string nor JSON object or array.');\n }\n\n const evaluation = new MSBuildEvaluationOutput(rawOutput);\n\n debug_MSBP_Evaluate_hashed(`Getting MSBuild Targets of \"${options.FullName}\"...`);\n const projTargets = await this.GetTargets(options.FullName);\n\n debug_MSBP_Evaluate_hashed(`Returning new MSBuildProject instance for \"${options.FullName}\"...`);\n return new MSBuildProject({\n fullPath: options.FullName,\n projTargets,\n evaluation,\n });\n }\n\n /**\n * Evaluate multiple project paths with some default Evaluate options.\n * @async\n * @param projectsToPackAndPush An array of MSBuild projects' full file\n * paths. If a path is a directory, files in that directory are filtered for\n * `.csproj`, `.fsproj`, and `.vbproj` project files.\n * See https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\\\n * @returns A promised array of {@link MSBuildProject} instances.\n * All known MSBuild and NuGet properties are evaluated.\n * If applicable, a project's \"Pack\" target is evaluated.\n */\n public static async PackableProjectsToMSBuildProjects(\n projectsToPackAndPush: string[],\n ): Promise<Promise<MSBuildProject>[]> {\n debug_MSBP_PPTMSBP('Mapping projects to Dirent instances...');\n const directoryEntriesPromise = await toDirectoryEntries(typeof projectsToPackAndPush === 'string' ? [projectsToPackAndPush] : projectsToPackAndPush);\n debug_MSBP_PPTMSBP('Converting Dirent instances to MSBuildProject instances...');\n const projectPromises: Promise<MSBuildProject>[] = directoryEntriesPromise.map(element => convertDirentToMSBuildProject(element));\n return projectPromises;\n\n /**\n * Map an array of filesystem paths to {@link Dirent} instances representing project files.\n * @param projectsToPackAndPush An array of MSBuild projects' full file\n * paths. If a path is a directory, files in that directory are filtered for\n * `.csproj`, `.fsproj`, and `.vbproj` project files. See\n * https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\\\n * @returns An promised array of Dirent instances for discovered project files.\n */\n async function toDirectoryEntries(\n projectsToPackAndPush: string[],\n ): Promise<Dirent[]> {\n const directoryEntries: (Dirent | Dirent[])[] = await Promise.all(\n projectsToPackAndPush.map(async (proj) => {\n debug_MSBP_PPTMSBP(`Getting absolute path of \"${proj}\"...`);\n proj = await realpath(makeAbsolute(proj));\n\n debug_MSBP_PPTMSBP(`Getting filesystem stats of \"${proj}\"...`);\n const stats = await stat(proj);\n let entries: Dirent[];\n\n if (stats.isFile()) {\n debug_MSBP_PPTMSBP(`\"${proj}\" is a file. Returning Dirent instance...`);\n entries = await readdir(path.dirname(proj), { withFileTypes: true });\n const dirent: Dirent | undefined = entries.find(v =>\n path.join(\n // condition required for compatibility. `.path` was deprecated, but `.parentPath` is not available in our node minversion\n ('path' in v ? v.path as string | undefined : undefined) ?? (v as unknown as Omit<typeof v, 'path'> & { parentPath: string }).parentPath,\n v.name,\n ) === proj,\n );\n if (dirent)\n return dirent;\n throw new Error(\n `file \"${proj}\" not found. It may have been moved or deleted.`,\n );\n }\n if (!stats.isDirectory())\n throw new Error(`\"${proj}\" is not a file or directory`);\n\n debug_MSBP_PPTMSBP(`\"${proj}\" is a directory. Searching for files ending with \".csproj\", \".fsproj\", or \".vbproj\"...`);\n entries = await readdir(proj, { withFileTypes: true });\n return entries.filter(v =>\n v.isFile()\n && (v.name.endsWith('.csproj') || v.name.endsWith('.fsproj') || v.name.endsWith('.vbproj')),\n );\n }),\n );\n\n return directoryEntries.flat();\n }\n\n /**\n * Map a {@link Dirent} instance to an {@link MSBuildProject} instance.\n * @param dirent A {@link Dirent} instance. This instance should be an MSBuild project file.\n * @returns An instance of {@link MSBuildProject} evaluated with the `Pack` target result, if applicable. Evaluated properties will be those whose names are returned by {@link NPPGetterNames.InstanceGettersRecursive}.\n */\n async function convertDirentToMSBuildProject(dirent: Dirent): Promise<MSBuildProject> {\n const fullPath = path.join(\n // condition required for compatibility. `.path` was deprecated, but `.parentPath` is not available in our node minversion\n ('path' in dirent ? dirent.path as string | undefined : undefined) ?? (dirent as unknown as Omit<typeof dirent, 'path'> & { parentPath: string }).parentPath,\n dirent.name,\n );\n\n debug_MSBP_PPTMSBP(`Getting MSBuild targets of \"${fullPath}\"...`);\n const projTargets: string[] = await MSBuildProject.GetTargets(fullPath);\n const evalTargets: string[] = projTargets.includes('Pack') ? ['Pack'] : [];\n // this might be too long for a command line. What was it on Windows?\n // 2^15 (32,768) character limit for command lines?\n const propertiesToEvaluate = NPPGetterNames.InstanceGettersRecursive;\n const withTargets: string = evalTargets.length === 0\n ? ''\n : ` with target(s) ${evalTargets.join(', ').replace(/, ([^,]+)$/, ', and ${0}')}`;\n\n debug_MSBP_PPTMSBP(`Evaluating \"${fullPath}\" for properties${withTargets}...`);\n return await MSBuildProject.Evaluate(\n EvaluationOptions.from({\n FullName: fullPath,\n GetItem: [],\n GetProperty: propertiesToEvaluate,\n GetTargetResult: [],\n Property: {},\n Targets: evalTargets,\n }),\n );\n }\n }\n\n public static fromJSON(json: string): MSBuildProject {\n const parsed = T_PseudoMSBPInstance.assert(JSON.parse(json));\n\n type.true.assert(\n Reflect.setPrototypeOf(parsed, this.prototype),\n );\n type.true.assert(\n Reflect.setPrototypeOf(parsed.Properties, NugetProjectProperties.prototype),\n );\n parsed.Properties = T_NPP.assert(parsed.Properties);\n return T_MSBuildProject.assert(parsed);\n }\n\n readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;\n readonly Properties: Readonly<NugetProjectProperties>;\n readonly Targets: readonly string[];\n /**\n * Allows appending subsequent target results.\n */\n readonly TargetResults: Required<MSBuildEvaluationOutput>['TargetResults'][];\n\n /**\n * Creates an instance of MSBuildProject.\n * @param opts The order-independent arguments for this constructor.\n * Properties may be added or moved around in this definition without\n * breaking compatibility.\n * @param opts.fullPath The full path of the MSBuild project's file. This\n * should have a '.csproj', '.fsproj', or '.vbproj' file extension.\n * @param opts.projTargets A list of MSBuild Targets supported by the project.\n * @param opts.evaluation The output of an MSBuild project evaluation. This\n * comprises MSBuild Properties, Items, and Target results.\n */\n // eslint-disable-next-line unicorn/name-replacements\n public constructor(opts: {\n fullPath: string;\n projTargets: string[];\n evaluation: MSBuildEvaluationOutput;\n }) {\n this.Items = opts.evaluation.Items ?? {};\n this.Properties = new NugetProjectProperties(\n opts.fullPath,\n new CaseInsensitiveMap<string, string>(\n Object.entries(opts.evaluation.Properties ?? {}),\n ),\n );\n this.Targets = opts.projTargets;\n this.TargetResults\n = opts.evaluation.TargetResults === undefined\n ? []\n : [opts.evaluation.TargetResults];\n }\n}\n\nconst T_MSBuildProject = type.instanceOf(MSBuildProject);\nconst T_NPP = type.instanceOf(NugetProjectProperties);\nconst T_PseudoMSBPInstance = type({\n Items: type({\n '[string]': type({\n '[string]': 'string',\n Identity: 'string',\n FullPath: 'string',\n RootDir: 'string',\n Filename: 'string',\n Extension: 'string',\n RelativeDir: 'string',\n Directory: 'string',\n RecursiveDir: 'string',\n ModifiedTime: 'string',\n CreatedTime: 'string',\n AccessedTime: 'string',\n DefiningProjectFullPath: 'string',\n DefiningProjectDirectory: 'string',\n DefiningProjectName: 'string',\n DefiningProjectExtension: 'string',\n 'SubType?': ' string | undefined',\n 'TargetFrameworkIdentifier?': 'string | undefined',\n 'TargetPlatformMoniker?': 'string | undefined',\n 'CopyUpToDateMarker?': 'string | undefined',\n 'TargetPlatformIdentifier?': 'string | undefined',\n 'TargetFrameworkVersion?': 'string | undefined',\n 'ReferenceAssembly?': 'string | undefined',\n }).array(),\n }),\n Properties: type.Record('string', 'string').or(T_NPP),\n Targets: type.string.array(),\n TargetResults: msbuildEvaluationOutput.get('TargetResults').exclude('undefined').array(),\n\n});\n\n/**\n * ArkType type definitions for internal usage, but may be re-used elsewhere\n * @internal\n */\nexport const _InternalMSBuildEvaluationTypes: Scope<{\n msbuildEvaluationOutput: {\n Properties?: Record<string, string> | undefined;\n Items?: Record<string, {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[]> | undefined;\n TargetResults?: Record<string, {\n Result: 'Success';\n Items: {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[];\n } | {\n Result: 'Failure';\n Items: never[];\n }> | undefined;\n };\n}> = type.scope({\n msbuildEvaluationOutput,\n});\n\n/**\n * Resolve a path if it is not already absolute.\n * @param _path A filesystem path.\n * @returns A full path to a filesystem entry. The path is unchecked for whether or not the path (or its parts) exist.\n */\nfunction makeAbsolute(_path: string) {\n return path.isAbsolute(_path) ? _path : path.resolve(_path);\n}\n\n/**\n * Use this in your catch statement or .catch call to return `undefined` when\n * a \"file in use by another process\" (i.e. EBUSY/ERROR_SHARING_VIOLATION) error is reported.\n * @param error Probably an Error object\n * @returns `undefined` if file in use by another process\n */\n// TODO: BREAKING CHANGE: change return type to `true` to lint implicit `undefined`/`void` returns.\nexport function catchEBUSY(error: unknown): undefined {\n if (isError(error)) {\n if ('stderr' in error && typeof error.stderr === 'string') {\n // Normalize colon-like chars: '\\uFF1A'.normalize('NFKC') === ':' === true;\n const normalizedStderr = error.stderr.normalize('NFKC');\n const patternEN = /The process cannot access the file '[^']+' because it is being used by another process\\./gm;\n const hasErrorMessagePattern = patternEN.test(normalizedStderr);\n const isCS2012 = /^CSC ?:.+CS2012:/gm.test(normalizedStderr);\n // generic error code; error message must be checked.\n const isAVLN9999 = /AVLN9999:/gm.test(normalizedStderr)\n && hasErrorMessagePattern;\n if (isCS2012 || isAVLN9999 || hasErrorMessagePattern)\n // eslint-disable-next-line unicorn/no-useless-undefined\n return undefined; /* retry */\n throw error;\n }\n /**\n * some known warnings/errors:\n * - warning MSB3073:\n * The command \"dotnet tool list kuinox.nupkgdeterministicator\"\n * exited with code 145.\n * > $ dotnet tool list kuinox.nupkgdeterministicator\n * > The command could not be loaded, possibly because:\n * > * You intended to execute a .NET application:\n * > The application 'tool' does not exist.\n * > * You intended to execute a .NET SDK command:\n * > No .NET SDKs were found.\n * >\n * > Download a .NET SDK:\n * > https://aka.ms/dotnet/download\n * >\n * > Learn about SDK resolution:\n * > https://aka.ms/dotnet/sdk-not-found\n */\n throw error;\n }\n throw new Error('unknown error', { cause: error });\n}\n\n/**\n *\n * Use this in your catch statement or .catch call to return `undefined` when\n * MSBuild error CSC2012 (e.g. \"file in use by another process\") is reported.\n * @param error Probably an Error object\n * @returns `undefined` if CSC2012 (file in use by another process) occurs\n * @deprecated Use {@link catchEBUSY}.\n */\nexport function catchCsc2012(error: unknown): undefined {\n if (isError(error)) {\n // check for error reported when \"file in use by another process\" i.e. EBUSY\n // (UNIX), NTSTATUS.ERROR_SHARING_VIOLATION == 0x20 == 32 (Windows)\n if ('stderr' in error && typeof error.stderr === 'string'\n && /^CSC ?:.+CS2012:/gm.test(\n // '\\uFF1A'.normalize('NFKC') === ':' === true;\n error.stderr.normalize('NFKC'),\n )\n ) {\n // eslint-disable-next-line unicorn/no-useless-undefined\n return undefined; /* retry */\n }\n /**\n * some known warnings/errors:\n * - warning MSB3073:\n * The command \"dotnet tool list kuinox.nupkgdeterministicator\"\n * exited with code 145.\n * > $ dotnet tool list kuinox.nupkgdeterministicator\n * > The command could not be loaded, possibly because:\n * > * You intended to execute a .NET application:\n * > The application 'tool' does not exist.\n * > * You intended to execute a .NET SDK command:\n * > No .NET SDKs were found.\n * >\n * > Download a .NET SDK:\n * > https://aka.ms/dotnet/download\n * >\n * > Learn about SDK resolution:\n * > https://aka.ms/dotnet/sdk-not-found\n */\n throw error;\n }\n throw new Error('unknown error', { cause: error });\n}\n\n/**\n *\n * @returns A Promise of execAsync's output object.\n * @param root0 structured parameters object\n * @param root0.commandLine The command line to try and retry\n * @param root0.taskVerb Used in debug messages e.g. ```\n * const debug_MSBP = debug.extend('MSBuildProject');\n * debug_MSBP.enabled = debug.enabled;\n * const output = await loopTryDotnetCommand({ customDebugger: debug_MSBP, ... });\n * ```\n * @param root0.customDebugger e.g. `debug.extend('Evaluate)`\n * @param root0.projectName The filename (sans extension) or AssemblyName of the project e.g. `path.basename(fullPath, path.extname(fullPath))`\n * @param root0.timeoutMilliseconds The maximum time spent (re)trying the command.\n * Warning! {@link totalMilliseconds} may be significantly greater than {@link timeoutMilliseconds}!\n * e.g.\n * `325_000 <=300_000` (5m25s vs 5m)\n * `378_000 <=360_000` (6m18s vs 6m),\n * `630_000 <=600_000` (10m30s vs 10m)\n * `1225_000 <=1200_000` (20m25s vs 20m)\n * `2415_000 <=2400_000` (40m15s vs 40m)\n * `2556_000 <=2485_000` (42m36s vs 41m25s; 71 seconds over)\n * @throws {Error} when retry limit is reached or an unhandled exception occurs.\n * File-in-use errors are _supposed_ to be ignored and retried.\n */\nexport async function loopTryDotnetCommand({ commandLine, customDebugger, projectName, taskVerb, timeoutMilliseconds: maximumTime }: {\n commandLine: string;\n customDebugger: typeof debug;\n projectName: string;\n taskVerb?: string | undefined;\n timeoutMilliseconds: number;\n}): Promise<Awaited<ReturnType<typeof execAsync>>> {\n let output: Awaited<ReturnType<typeof execAsync>> | undefined;\n let totalMilliseconds = 0;\n let delay = 0;\n\n taskVerb ??= '<undefined>';\n customDebugger(`Beginning try/retry loop to ${taskVerb} \"${projectName}\"...`);\n\n while (output === undefined) {\n try {\n await setTimeout(delay, undefined);\n output = await execAsync(commandLine, true);\n }\n catch (error: unknown) {\n if (totalMilliseconds > maximumTime /* milliseconds */) {\n throw new Error(\n `Unable to ${taskVerb} \"${projectName}\": Retry limit hit. ~${(totalMilliseconds / 1000).toString()} seconds spent retrying.`,\n { cause: error },\n );\n };\n catchEBUSY(error);\n // incremental back-off; add new delay to total\n totalMilliseconds += delay += 1000;\n customDebugger(`A file needed by \"${projectName}\" is locked by another process. Retrying after ${(delay / 1000).toString()} seconds...`);\n }\n };\n return output;\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAM,aAAaA,OAAM,OAAO,gBAAgB;AAChD,WAAW,UAAUA,OAAM;AAC3B,MAAM,qBAAqB,WAAW,OAAO,mCAAmC;AAChF,mBAAmB,UAAUA,OAAM;AACnC,MAAM,sBAAsB,WAAW,OAAO,UA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