diff --git a/dist/tools/libs/gitversion.mjs b/dist/tools/libs/gitversion.mjs index ba09ad1a6..6f6b3b687 100644 --- a/dist/tools/libs/gitversion.mjs +++ b/dist/tools/libs/gitversion.mjs @@ -15,9 +15,14 @@ var ExecuteFields = /* @__PURE__ */ ((ExecuteFields2) => { ExecuteFields2["overrideConfig"] = "overrideConfig"; ExecuteFields2["updateAssemblyInfo"] = "updateAssemblyInfo"; ExecuteFields2["updateAssemblyInfoFilename"] = "updateAssemblyInfoFilename"; - ExecuteFields2["additionalArguments"] = "additionalArguments"; return ExecuteFields2; })(ExecuteFields || {}); +var CommandFields = /* @__PURE__ */ ((CommandFields2) => { + CommandFields2["targetPath"] = "targetPath"; + CommandFields2["disableShallowCloneCheck"] = "disableShallowCloneCheck"; + CommandFields2["arguments"] = "arguments"; + return CommandFields2; +})(CommandFields || {}); class GitVersionSettingsProvider extends SettingsProvider { getGitVersionExecuteSettings() { @@ -30,7 +35,6 @@ class GitVersionSettingsProvider extends SettingsProvider { const overrideConfig = this.buildAgent.getListInput(ExecuteFields.overrideConfig); const updateAssemblyInfo = this.buildAgent.getBooleanInput(ExecuteFields.updateAssemblyInfo); const updateAssemblyInfoFilename = this.buildAgent.getInput(ExecuteFields.updateAssemblyInfoFilename); - const additionalArguments = this.buildAgent.getInput(ExecuteFields.additionalArguments); return { targetPath, disableCache, @@ -40,8 +44,17 @@ class GitVersionSettingsProvider extends SettingsProvider { configFilePath, overrideConfig, updateAssemblyInfo, - updateAssemblyInfoFilename, - additionalArguments + updateAssemblyInfoFilename + }; + } + getGitVersionCommandSettings() { + const targetPath = this.buildAgent.getInput(CommandFields.targetPath); + const disableShallowCloneCheck = this.buildAgent.getBooleanInput(CommandFields.disableShallowCloneCheck); + const args = this.buildAgent.getInput(CommandFields.arguments); + return { + targetPath, + disableShallowCloneCheck, + arguments: args }; } } @@ -70,6 +83,14 @@ class GitVersionTool extends DotnetTool { await this.setDotnetRoot(); return await this.executeTool(args); } + async executeCommand() { + const settings = this.settingsProvider.getGitVersionCommandSettings(); + const workDir = await this.getRepoDir(settings); + await this.checkShallowClone(settings, workDir); + const args = await this.getCommandArguments(workDir, settings); + await this.setDotnetRoot(); + return await this.executeTool(args); + } writeGitVersionToAgent(output) { for (const property of keysOf(output)) { const name = this.toCamelCase(property); @@ -91,7 +112,7 @@ class GitVersionTool extends DotnetTool { return await super.getRepoPath(settings.targetPath); } async getExecuteArguments(workDir, options) { - let args = [workDir, "/output", "json", "/output", "buildserver"]; + const args = [workDir, "/output", "json", "/output", "buildserver"]; const { useConfigFile, disableCache, @@ -99,8 +120,7 @@ class GitVersionTool extends DotnetTool { configFilePath, overrideConfig, updateAssemblyInfo, - updateAssemblyInfoFilename, - additionalArguments + updateAssemblyInfoFilename // } = options; if (disableCache) { @@ -134,8 +154,12 @@ class GitVersionTool extends DotnetTool { } } } - if (additionalArguments) { - args = args.concat(this.argStringToArray(additionalArguments)); + return args; + } + async getCommandArguments(workDir, options) { + let args = [workDir]; + if (options.arguments) { + args = args.concat(this.argStringToArray(options.arguments)); } return args; } @@ -218,6 +242,8 @@ class Runner { return await this.setup(); case "execute": return await this.execute(); + case "command": + return await this.command(); } } async setup() { @@ -287,6 +313,38 @@ class Runner { }; } } + async command() { + try { + this.disableTelemetry(); + this.buildAgent.info("Executing GitVersion"); + const result = await this.gitVersionTool.executeCommand(); + if (result.code === 0) { + this.buildAgent.info("GitVersion executed successfully"); + const stdout = result.stdout; + this.buildAgent.info("GitVersion output:"); + this.buildAgent.info("-------------------"); + this.buildAgent.info(stdout); + this.buildAgent.info("-------------------"); + this.buildAgent.setSucceeded("GitVersion executed successfully", true); + return result; + } else { + this.buildAgent.debug("GitVersion failed"); + const error = result.error; + if (error instanceof Error) { + this.buildAgent.setFailed(error.message, true); + } + return result; + } + } catch (error) { + if (error instanceof Error) { + this.buildAgent.setFailed(error.message, true); + } + return { + code: -1, + error + }; + } + } disableTelemetry() { this.buildAgent.info(`Running on: '${this.buildAgent.agentName}'`); this.buildAgent.debug("Disabling telemetry"); diff --git a/dist/tools/libs/gitversion.mjs.map b/dist/tools/libs/gitversion.mjs.map index b1a63c950..7f425aeb7 100644 --- a/dist/tools/libs/gitversion.mjs.map +++ b/dist/tools/libs/gitversion.mjs.map @@ -1 +1 @@ -{"version":3,"file":"gitversion.mjs","sources":["../../../src/tools/gitversion/models.ts","../../../src/tools/gitversion/settings.ts","../../../src/tools/gitversion/tool.ts","../../../src/tools/gitversion/runner.ts"],"sourcesContent":["export type Commands = 'setup' | 'execute'\n\nexport enum ExecuteFields {\n targetPath = 'targetPath',\n disableCache = 'disableCache',\n disableNormalization = 'disableNormalization',\n disableShallowCloneCheck = 'disableShallowCloneCheck',\n useConfigFile = 'useConfigFile',\n configFilePath = 'configFilePath',\n overrideConfig = 'overrideConfig',\n updateAssemblyInfo = 'updateAssemblyInfo',\n updateAssemblyInfoFilename = 'updateAssemblyInfoFilename',\n additionalArguments = 'additionalArguments'\n}\n\nexport type GitVersionExecuteSettings = {\n [ExecuteFields.targetPath]: string\n [ExecuteFields.disableCache]: boolean\n [ExecuteFields.disableNormalization]: boolean\n [ExecuteFields.disableShallowCloneCheck]: boolean\n [ExecuteFields.useConfigFile]: boolean\n [ExecuteFields.configFilePath]: string\n [ExecuteFields.overrideConfig]: string[]\n [ExecuteFields.updateAssemblyInfo]: boolean\n [ExecuteFields.updateAssemblyInfoFilename]: string\n [ExecuteFields.additionalArguments]: string\n}\n\nexport type GitVersionOutput = {\n Major: number\n Minor: number\n Patch: number\n PreReleaseTag: string\n PreReleaseTagWithDash: string\n PreReleaseLabel: string\n PreReleaseNumber: number\n WeightedPreReleaseNumber: number\n BuildMetaData: number\n FullBuildMetaData: string\n MajorMinorPatch: string\n SemVer: string\n AssemblySemVer: string\n AssemblySemFileVer: string\n FullSemVer: string\n InformationalVersion: string\n BranchName: string\n EscapedBranchName: string\n Sha: string\n ShortSha: string\n VersionSourceSha: string\n CommitsSinceVersionSource: number\n UncommittedChanges: number\n CommitDate: string\n}\n","import { type ISettingsProvider, SettingsProvider } from '@tools/common'\nimport { ExecuteFields, type GitVersionExecuteSettings } from './models'\n\nexport interface IGitVersionSettingsProvider extends ISettingsProvider {\n getGitVersionExecuteSettings(): GitVersionExecuteSettings\n}\n\nexport class GitVersionSettingsProvider extends SettingsProvider implements IGitVersionSettingsProvider {\n getGitVersionExecuteSettings(): GitVersionExecuteSettings {\n const targetPath = this.buildAgent.getInput(ExecuteFields.targetPath)\n\n const disableCache = this.buildAgent.getBooleanInput(ExecuteFields.disableCache)\n const disableNormalization = this.buildAgent.getBooleanInput(ExecuteFields.disableNormalization)\n const disableShallowCloneCheck = this.buildAgent.getBooleanInput(ExecuteFields.disableShallowCloneCheck)\n\n const useConfigFile = this.buildAgent.getBooleanInput(ExecuteFields.useConfigFile)\n const configFilePath = this.buildAgent.getInput(ExecuteFields.configFilePath)\n const overrideConfig = this.buildAgent.getListInput(ExecuteFields.overrideConfig)\n\n const updateAssemblyInfo = this.buildAgent.getBooleanInput(ExecuteFields.updateAssemblyInfo)\n const updateAssemblyInfoFilename = this.buildAgent.getInput(ExecuteFields.updateAssemblyInfoFilename)\n\n const additionalArguments = this.buildAgent.getInput(ExecuteFields.additionalArguments)\n\n return {\n targetPath,\n disableCache,\n disableNormalization,\n disableShallowCloneCheck,\n useConfigFile,\n configFilePath,\n overrideConfig,\n updateAssemblyInfo,\n updateAssemblyInfoFilename,\n additionalArguments\n }\n }\n}\n","import { type ExecResult } from '@agents/common'\nimport { DotnetTool, keysOf } from '@tools/common'\nimport { type GitVersionExecuteSettings, type GitVersionOutput } from './models'\nimport { GitVersionSettingsProvider, type IGitVersionSettingsProvider } from './settings'\n\nexport class GitVersionTool extends DotnetTool {\n get packageName(): string {\n return 'GitVersion.Tool'\n }\n\n get toolName(): string {\n return 'dotnet-gitversion'\n }\n\n get toolPathVariable(): string {\n return 'GITVERSION_PATH'\n }\n\n get versionRange(): string | null {\n return '>=5.2.0 <6.1.0'\n }\n\n get settingsProvider(): IGitVersionSettingsProvider {\n return new GitVersionSettingsProvider(this.buildAgent)\n }\n\n async executeJson(): Promise {\n const settings = this.settingsProvider.getGitVersionExecuteSettings()\n const workDir = await this.getRepoDir(settings)\n\n await this.checkShallowClone(settings, workDir)\n\n const args = await this.getExecuteArguments(workDir, settings)\n\n await this.setDotnetRoot()\n return await this.executeTool(args)\n }\n\n writeGitVersionToAgent(output: GitVersionOutput): void {\n for (const property of keysOf(output)) {\n const name = this.toCamelCase(property)\n try {\n let value = output[property]?.toString()\n if (value === '0') {\n value = '0'\n }\n this.buildAgent.setOutput(name, value)\n this.buildAgent.setOutput(`GitVersion_${property}`, value)\n this.buildAgent.setVariable(name, value)\n this.buildAgent.setVariable(`GitVersion_${property}`, value)\n } catch (error) {\n this.buildAgent.error(`Unable to set output/variable for ${property}`)\n }\n }\n }\n\n protected async getRepoDir(settings: GitVersionExecuteSettings): Promise {\n return await super.getRepoPath(settings.targetPath)\n }\n\n protected async getExecuteArguments(workDir: string, options: GitVersionExecuteSettings): Promise {\n let args = [workDir, '/output', 'json', '/output', 'buildserver']\n\n const {\n useConfigFile,\n disableCache,\n disableNormalization,\n configFilePath,\n overrideConfig,\n updateAssemblyInfo,\n updateAssemblyInfoFilename,\n additionalArguments\n //\n } = options\n\n if (disableCache) {\n args.push('/nocache')\n }\n\n if (disableNormalization) {\n args.push('/nonormalize')\n }\n\n if (useConfigFile) {\n if (await this.isValidInputFile('configFilePath', configFilePath)) {\n args.push('/config', configFilePath)\n } else {\n throw new Error(`GitVersion configuration file not found at ${configFilePath}`)\n }\n }\n\n if (overrideConfig) {\n for (let config of overrideConfig) {\n config = config.trim()\n if (config.match(/([a-zA-Z0-9]+(-[a-zA-Z]+)*=[a-zA-Z0-9\\- :.']*)/)) {\n args.push('/overrideconfig', config)\n }\n }\n }\n\n if (updateAssemblyInfo) {\n args.push('/updateassemblyinfo')\n\n // You can specify 'updateAssemblyInfo' without 'updateAssemblyInfoFilename'.\n if (updateAssemblyInfoFilename?.length > 0) {\n if (await this.isValidInputFile('updateAssemblyInfoFilename', updateAssemblyInfoFilename)) {\n args.push(updateAssemblyInfoFilename)\n } else {\n throw new Error(`AssemblyInfoFilename file not found at ${updateAssemblyInfoFilename}`)\n }\n }\n }\n\n if (additionalArguments) {\n args = args.concat(this.argStringToArray(additionalArguments))\n }\n return args\n }\n\n private argStringToArray(argString: string): string[] {\n const args: string[] = []\n\n let inQuotes = false\n let escaped = false\n let lastCharWasSpace = true\n let arg = ''\n\n const append = (c: string): void => {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\'\n }\n\n arg += c\n escaped = false\n }\n\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i)\n\n if (c === ' ' && !inQuotes) {\n if (!lastCharWasSpace) {\n args.push(arg)\n arg = ''\n }\n lastCharWasSpace = true\n continue\n } else {\n lastCharWasSpace = false\n }\n\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes\n } else {\n append(c)\n }\n continue\n }\n\n if (c === '\\\\' && escaped) {\n append(c)\n continue\n }\n\n if (c === '\\\\' && inQuotes) {\n escaped = true\n continue\n }\n\n append(c)\n lastCharWasSpace = false\n }\n\n if (!lastCharWasSpace) {\n args.push(arg.trim())\n }\n\n return args\n }\n\n private async checkShallowClone(settings: GitVersionExecuteSettings, workDir: string): Promise {\n if (!settings.disableShallowCloneCheck) {\n const isShallowResult = await this.execute('git', ['-C', workDir, 'rev-parse', '--is-shallow-repository'])\n if (isShallowResult.code === 0 && isShallowResult.stdout.trim() === 'true') {\n throw new Error(\n 'The repository is shallow. Consider disabling shallow clones. See https://github.com/GitTools/actions/blob/main/docs/cloning.md for more information.'\n )\n }\n }\n }\n\n private toCamelCase(input: string): string {\n return input.replace(/^\\w|[A-Z]|\\b\\w|\\s+/g, function (match, index) {\n if (+match === 0) return '' // or if (/\\s+/.test(match)) for white spaces\n return index === 0 ? match.toLowerCase() : match.toUpperCase()\n })\n }\n}\n","import { type ExecResult, type IBuildAgent } from '@agents/common'\nimport { type IRunner } from '@tools/common'\nimport { type Commands, type GitVersionOutput } from './models'\nimport { GitVersionTool } from './tool'\n\nexport class Runner implements IRunner {\n private readonly gitVersionTool: GitVersionTool\n\n constructor(private readonly buildAgent: IBuildAgent) {\n this.gitVersionTool = new GitVersionTool(this.buildAgent)\n }\n\n async run(command: Commands): Promise {\n switch (command) {\n case 'setup':\n return await this.setup()\n case 'execute':\n return await this.execute()\n }\n }\n\n private async setup(): Promise {\n try {\n this.disableTelemetry()\n\n this.buildAgent.debug('Installing GitVersion')\n const toolPath = await this.gitVersionTool.install()\n\n const pathVariable = this.gitVersionTool.toolPathVariable\n this.buildAgent.info(`Set ${pathVariable} to ${toolPath}`)\n this.buildAgent.setVariable(pathVariable, toolPath)\n\n this.buildAgent.setSucceeded('GitVersion installed successfully', true)\n return {\n code: 0\n }\n } catch (error) {\n if (error instanceof Error) {\n this.buildAgent.setFailed(error.message, true)\n }\n return {\n code: -1,\n error\n }\n }\n }\n\n private async execute(): Promise {\n try {\n this.disableTelemetry()\n\n this.buildAgent.info('Executing GitVersion')\n\n const result = await this.gitVersionTool.executeJson()\n\n if (result.code === 0) {\n this.buildAgent.info('GitVersion executed successfully')\n const stdout: string = result.stdout as string\n\n this.buildAgent.info('GitVersion output:')\n this.buildAgent.info('-------------------')\n this.buildAgent.info(stdout)\n this.buildAgent.info('-------------------')\n this.buildAgent.debug('Parsing GitVersion output')\n\n if (stdout.lastIndexOf('{') === -1 || stdout.lastIndexOf('}') === -1) {\n this.buildAgent.debug('GitVersion output is not valid JSON')\n this.buildAgent.setFailed('GitVersion output is not valid JSON', true)\n return {\n code: -1,\n error: new Error('GitVersion output is not valid JSON')\n }\n } else {\n const jsonOutput = stdout.substring(stdout.lastIndexOf('{'), stdout.lastIndexOf('}') + 1)\n\n const gitVersionOutput = JSON.parse(jsonOutput) as GitVersionOutput\n this.gitVersionTool.writeGitVersionToAgent(gitVersionOutput)\n this.buildAgent.setSucceeded('GitVersion executed successfully', true)\n return result\n }\n } else {\n this.buildAgent.debug('GitVersion failed')\n const error = result.error\n if (error instanceof Error) {\n this.buildAgent.setFailed(error.message, true)\n }\n return result\n }\n } catch (error) {\n if (error instanceof Error) {\n this.buildAgent.setFailed(error.message, true)\n }\n return {\n code: -1,\n error\n }\n }\n }\n\n private disableTelemetry(): void {\n this.buildAgent.info(`Running on: '${this.buildAgent.agentName}'`)\n this.buildAgent.debug('Disabling telemetry')\n this.gitVersionTool.disableTelemetry()\n }\n}\n"],"names":["ExecuteFields"],"mappings":";;;;;;;AAEY,IAAA,aAAA,qBAAAA,cAAL,KAAA;AACH,EAAAA,eAAA,YAAa,CAAA,GAAA,YAAA,CAAA;AACb,EAAAA,eAAA,cAAe,CAAA,GAAA,cAAA,CAAA;AACf,EAAAA,eAAA,sBAAuB,CAAA,GAAA,sBAAA,CAAA;AACvB,EAAAA,eAAA,0BAA2B,CAAA,GAAA,0BAAA,CAAA;AAC3B,EAAAA,eAAA,eAAgB,CAAA,GAAA,eAAA,CAAA;AAChB,EAAAA,eAAA,gBAAiB,CAAA,GAAA,gBAAA,CAAA;AACjB,EAAAA,eAAA,gBAAiB,CAAA,GAAA,gBAAA,CAAA;AACjB,EAAAA,eAAA,oBAAqB,CAAA,GAAA,oBAAA,CAAA;AACrB,EAAAA,eAAA,4BAA6B,CAAA,GAAA,4BAAA,CAAA;AAC7B,EAAAA,eAAA,qBAAsB,CAAA,GAAA,qBAAA,CAAA;AAVd,EAAAA,OAAAA,cAAAA,CAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA,CAAA;;ACKL,MAAM,mCAAmC,gBAAwD,CAAA;AAAA,EACpG,4BAA0D,GAAA;AACtD,IAAA,MAAM,UAAa,GAAA,IAAA,CAAK,UAAW,CAAA,QAAA,CAAS,cAAc,UAAU,CAAA,CAAA;AAEpE,IAAA,MAAM,YAAe,GAAA,IAAA,CAAK,UAAW,CAAA,eAAA,CAAgB,cAAc,YAAY,CAAA,CAAA;AAC/E,IAAA,MAAM,oBAAuB,GAAA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AA,EAAoC,IAAI,CAAA,CAAA;AACrE,UAAO,OAAA,MAAA,CAAA;AAAA,SACX;AAAA,OACG,MAAA;AACH,QAAK,IAAA,CAAA,UAAA,CAAW,MAAM,mBAAmB,CAAA,CAAA;AACzC,QAAA,MAAM,QAAQ,MAAO,CAAA,KAAA,CAAA;AACrB,QAAA,IAAI,iBAAiB,KAAO,EAAA;AACxB,UAAA,IAAA,CAAK,UAAW,CAAA,SAAA,CAAU,KAAM,CAAA,OAAA,EAAS,IAAI,CAAA,CAAA;AAAA,SACjD;AACA,QAAO,OAAA,MAAA,CAAA;AAAA,OACX;AAAA,aACK,KAAO,EAAA;AACZ,MAAA,IAAI,iBAAiB,KAAO,EAAA;AACxB,QAAA,IAAA,CAAK,UAAW,CAAA,SAAA,CAAU,KAAM,CAAA,OAAA,EAAS,IAAI,CAAA,CAAA;AAAA,OACjD;AACA,MAAO,OAAA;AAAA,QACH,IAAM,EAAA,CAAA,CAAA;AAAA,QACN,KAAA;AAAA,OACJ,CAAA;AAAA,KACJ;AAAA,GACJ;AAAA,EAEQ,gBAAyB,GAAA;AAC7B,IAAA,IAAA,CAAK,WAAW,IAAK,CAAA,CAAA,aAAA,EAAgB,IAAK,CAAA,UAAA,CAAW,SAAS,CAAG,CAAA,CAAA,CAAA,CAAA;AACjE,IAAK,IAAA,CAAA,UAAA,CAAW,MAAM,qBAAqB,CAAA,CAAA;AAC3C,IAAA,IAAA,CAAK,eAAe,gBAAiB,EAAA,CAAA;AAAA,GACzC;AACJ;;;;"} \ No newline at end of file +{"version":3,"file":"gitversion.mjs","sources":["../../../src/tools/gitversion/models.ts","../../../src/tools/gitversion/settings.ts","../../../src/tools/gitversion/tool.ts","../../../src/tools/gitversion/runner.ts"],"sourcesContent":["export type Commands = 'setup' | 'execute' | 'command'\n\nexport enum ExecuteFields {\n targetPath = 'targetPath',\n disableCache = 'disableCache',\n disableNormalization = 'disableNormalization',\n disableShallowCloneCheck = 'disableShallowCloneCheck',\n useConfigFile = 'useConfigFile',\n configFilePath = 'configFilePath',\n overrideConfig = 'overrideConfig',\n updateAssemblyInfo = 'updateAssemblyInfo',\n updateAssemblyInfoFilename = 'updateAssemblyInfoFilename'\n}\n\nexport enum CommandFields {\n targetPath = 'targetPath',\n disableShallowCloneCheck = 'disableShallowCloneCheck',\n arguments = 'arguments'\n}\n\nexport type GitVersionExecuteSettings = {\n [ExecuteFields.targetPath]: string\n [ExecuteFields.disableCache]: boolean\n [ExecuteFields.disableNormalization]: boolean\n [ExecuteFields.disableShallowCloneCheck]: boolean\n [ExecuteFields.useConfigFile]: boolean\n [ExecuteFields.configFilePath]: string\n [ExecuteFields.overrideConfig]: string[]\n [ExecuteFields.updateAssemblyInfo]: boolean\n [ExecuteFields.updateAssemblyInfoFilename]: string\n}\n\nexport type GitVersionCommandSettings = {\n [CommandFields.targetPath]: string\n [ExecuteFields.disableShallowCloneCheck]: boolean\n [CommandFields.arguments]: string\n}\n\nexport type GitVersionOutput = {\n Major: number\n Minor: number\n Patch: number\n PreReleaseTag: string\n PreReleaseTagWithDash: string\n PreReleaseLabel: string\n PreReleaseNumber: number\n WeightedPreReleaseNumber: number\n BuildMetaData: number\n FullBuildMetaData: string\n MajorMinorPatch: string\n SemVer: string\n AssemblySemVer: string\n AssemblySemFileVer: string\n FullSemVer: string\n InformationalVersion: string\n BranchName: string\n EscapedBranchName: string\n Sha: string\n ShortSha: string\n VersionSourceSha: string\n CommitsSinceVersionSource: number\n UncommittedChanges: number\n CommitDate: string\n}\n","import { type ISettingsProvider, SettingsProvider } from '@tools/common'\nimport { CommandFields, ExecuteFields, type GitVersionCommandSettings, type GitVersionExecuteSettings } from './models'\n\nexport interface IGitVersionSettingsProvider extends ISettingsProvider {\n getGitVersionExecuteSettings(): GitVersionExecuteSettings\n\n getGitVersionCommandSettings(): GitVersionCommandSettings\n}\n\nexport class GitVersionSettingsProvider extends SettingsProvider implements IGitVersionSettingsProvider {\n getGitVersionExecuteSettings(): GitVersionExecuteSettings {\n const targetPath = this.buildAgent.getInput(ExecuteFields.targetPath)\n\n const disableCache = this.buildAgent.getBooleanInput(ExecuteFields.disableCache)\n const disableNormalization = this.buildAgent.getBooleanInput(ExecuteFields.disableNormalization)\n const disableShallowCloneCheck = this.buildAgent.getBooleanInput(ExecuteFields.disableShallowCloneCheck)\n\n const useConfigFile = this.buildAgent.getBooleanInput(ExecuteFields.useConfigFile)\n const configFilePath = this.buildAgent.getInput(ExecuteFields.configFilePath)\n const overrideConfig = this.buildAgent.getListInput(ExecuteFields.overrideConfig)\n\n const updateAssemblyInfo = this.buildAgent.getBooleanInput(ExecuteFields.updateAssemblyInfo)\n const updateAssemblyInfoFilename = this.buildAgent.getInput(ExecuteFields.updateAssemblyInfoFilename)\n\n return {\n targetPath,\n disableCache,\n disableNormalization,\n disableShallowCloneCheck,\n useConfigFile,\n configFilePath,\n overrideConfig,\n updateAssemblyInfo,\n updateAssemblyInfoFilename\n }\n }\n\n getGitVersionCommandSettings(): GitVersionCommandSettings {\n const targetPath = this.buildAgent.getInput(CommandFields.targetPath)\n const disableShallowCloneCheck = this.buildAgent.getBooleanInput(CommandFields.disableShallowCloneCheck)\n const args = this.buildAgent.getInput(CommandFields.arguments)\n\n return {\n targetPath,\n disableShallowCloneCheck,\n arguments: args\n }\n }\n}\n","import { type ExecResult } from '@agents/common'\nimport { DotnetTool, keysOf } from '@tools/common'\nimport { type GitVersionCommandSettings, type GitVersionExecuteSettings, type GitVersionOutput } from './models'\nimport { GitVersionSettingsProvider, type IGitVersionSettingsProvider } from './settings'\n\nexport class GitVersionTool extends DotnetTool {\n get packageName(): string {\n return 'GitVersion.Tool'\n }\n\n get toolName(): string {\n return 'dotnet-gitversion'\n }\n\n get toolPathVariable(): string {\n return 'GITVERSION_PATH'\n }\n\n get versionRange(): string | null {\n return '>=5.2.0 <6.1.0'\n }\n\n get settingsProvider(): IGitVersionSettingsProvider {\n return new GitVersionSettingsProvider(this.buildAgent)\n }\n\n async executeJson(): Promise {\n const settings = this.settingsProvider.getGitVersionExecuteSettings()\n const workDir = await this.getRepoDir(settings)\n\n await this.checkShallowClone(settings, workDir)\n\n const args = await this.getExecuteArguments(workDir, settings)\n\n await this.setDotnetRoot()\n return await this.executeTool(args)\n }\n\n async executeCommand(): Promise {\n const settings = this.settingsProvider.getGitVersionCommandSettings()\n const workDir = await this.getRepoDir(settings)\n\n await this.checkShallowClone(settings, workDir)\n\n const args = await this.getCommandArguments(workDir, settings)\n\n await this.setDotnetRoot()\n return await this.executeTool(args)\n }\n\n writeGitVersionToAgent(output: GitVersionOutput): void {\n for (const property of keysOf(output)) {\n const name = this.toCamelCase(property)\n try {\n let value = output[property]?.toString()\n if (value === '0') {\n value = '0'\n }\n this.buildAgent.setOutput(name, value)\n this.buildAgent.setOutput(`GitVersion_${property}`, value)\n this.buildAgent.setVariable(name, value)\n this.buildAgent.setVariable(`GitVersion_${property}`, value)\n } catch (error) {\n this.buildAgent.error(`Unable to set output/variable for ${property}`)\n }\n }\n }\n\n protected async getRepoDir(settings: GitVersionExecuteSettings | GitVersionCommandSettings): Promise {\n return await super.getRepoPath(settings.targetPath)\n }\n\n protected async getExecuteArguments(workDir: string, options: GitVersionExecuteSettings): Promise {\n const args = [workDir, '/output', 'json', '/output', 'buildserver']\n\n const {\n useConfigFile,\n disableCache,\n disableNormalization,\n configFilePath,\n overrideConfig,\n updateAssemblyInfo,\n updateAssemblyInfoFilename\n //\n } = options\n\n if (disableCache) {\n args.push('/nocache')\n }\n\n if (disableNormalization) {\n args.push('/nonormalize')\n }\n\n if (useConfigFile) {\n if (await this.isValidInputFile('configFilePath', configFilePath)) {\n args.push('/config', configFilePath)\n } else {\n throw new Error(`GitVersion configuration file not found at ${configFilePath}`)\n }\n }\n\n if (overrideConfig) {\n for (let config of overrideConfig) {\n config = config.trim()\n if (config.match(/([a-zA-Z0-9]+(-[a-zA-Z]+)*=[a-zA-Z0-9\\- :.']*)/)) {\n args.push('/overrideconfig', config)\n }\n }\n }\n\n if (updateAssemblyInfo) {\n args.push('/updateassemblyinfo')\n\n // You can specify 'updateAssemblyInfo' without 'updateAssemblyInfoFilename'.\n if (updateAssemblyInfoFilename?.length > 0) {\n if (await this.isValidInputFile('updateAssemblyInfoFilename', updateAssemblyInfoFilename)) {\n args.push(updateAssemblyInfoFilename)\n } else {\n throw new Error(`AssemblyInfoFilename file not found at ${updateAssemblyInfoFilename}`)\n }\n }\n }\n\n return args\n }\n\n protected async getCommandArguments(workDir: string, options: GitVersionCommandSettings): Promise {\n let args = [workDir]\n\n if (options.arguments) {\n args = args.concat(this.argStringToArray(options.arguments))\n }\n return args\n }\n\n private argStringToArray(argString: string): string[] {\n const args: string[] = []\n\n let inQuotes = false\n let escaped = false\n let lastCharWasSpace = true\n let arg = ''\n\n const append = (c: string): void => {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\'\n }\n\n arg += c\n escaped = false\n }\n\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i)\n\n if (c === ' ' && !inQuotes) {\n if (!lastCharWasSpace) {\n args.push(arg)\n arg = ''\n }\n lastCharWasSpace = true\n continue\n } else {\n lastCharWasSpace = false\n }\n\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes\n } else {\n append(c)\n }\n continue\n }\n\n if (c === '\\\\' && escaped) {\n append(c)\n continue\n }\n\n if (c === '\\\\' && inQuotes) {\n escaped = true\n continue\n }\n\n append(c)\n lastCharWasSpace = false\n }\n\n if (!lastCharWasSpace) {\n args.push(arg.trim())\n }\n\n return args\n }\n\n private async checkShallowClone(settings: GitVersionExecuteSettings | GitVersionCommandSettings, workDir: string): Promise {\n if (!settings.disableShallowCloneCheck) {\n const isShallowResult = await this.execute('git', ['-C', workDir, 'rev-parse', '--is-shallow-repository'])\n if (isShallowResult.code === 0 && isShallowResult.stdout.trim() === 'true') {\n throw new Error(\n 'The repository is shallow. Consider disabling shallow clones. See https://github.com/GitTools/actions/blob/main/docs/cloning.md for more information.'\n )\n }\n }\n }\n\n private toCamelCase(input: string): string {\n return input.replace(/^\\w|[A-Z]|\\b\\w|\\s+/g, function (match, index) {\n if (+match === 0) return '' // or if (/\\s+/.test(match)) for white spaces\n return index === 0 ? match.toLowerCase() : match.toUpperCase()\n })\n }\n}\n","import { type ExecResult, type IBuildAgent } from '@agents/common'\nimport { type IRunner } from '@tools/common'\nimport { type Commands, type GitVersionOutput } from './models'\nimport { GitVersionTool } from './tool'\n\nexport class Runner implements IRunner {\n private readonly gitVersionTool: GitVersionTool\n\n constructor(private readonly buildAgent: IBuildAgent) {\n this.gitVersionTool = new GitVersionTool(this.buildAgent)\n }\n\n async run(command: Commands): Promise {\n switch (command) {\n case 'setup':\n return await this.setup()\n case 'execute':\n return await this.execute()\n case 'command':\n return await this.command()\n }\n }\n\n private async setup(): Promise {\n try {\n this.disableTelemetry()\n\n this.buildAgent.debug('Installing GitVersion')\n const toolPath = await this.gitVersionTool.install()\n\n const pathVariable = this.gitVersionTool.toolPathVariable\n this.buildAgent.info(`Set ${pathVariable} to ${toolPath}`)\n this.buildAgent.setVariable(pathVariable, toolPath)\n\n this.buildAgent.setSucceeded('GitVersion installed successfully', true)\n return {\n code: 0\n }\n } catch (error) {\n if (error instanceof Error) {\n this.buildAgent.setFailed(error.message, true)\n }\n return {\n code: -1,\n error\n }\n }\n }\n\n private async execute(): Promise {\n try {\n this.disableTelemetry()\n\n this.buildAgent.info('Executing GitVersion')\n\n const result = await this.gitVersionTool.executeJson()\n\n if (result.code === 0) {\n this.buildAgent.info('GitVersion executed successfully')\n const stdout: string = result.stdout as string\n\n this.buildAgent.info('GitVersion output:')\n this.buildAgent.info('-------------------')\n this.buildAgent.info(stdout)\n this.buildAgent.info('-------------------')\n this.buildAgent.debug('Parsing GitVersion output')\n\n if (stdout.lastIndexOf('{') === -1 || stdout.lastIndexOf('}') === -1) {\n this.buildAgent.debug('GitVersion output is not valid JSON')\n this.buildAgent.setFailed('GitVersion output is not valid JSON', true)\n return {\n code: -1,\n error: new Error('GitVersion output is not valid JSON')\n }\n } else {\n const jsonOutput = stdout.substring(stdout.lastIndexOf('{'), stdout.lastIndexOf('}') + 1)\n\n const gitVersionOutput = JSON.parse(jsonOutput) as GitVersionOutput\n this.gitVersionTool.writeGitVersionToAgent(gitVersionOutput)\n this.buildAgent.setSucceeded('GitVersion executed successfully', true)\n return result\n }\n } else {\n this.buildAgent.debug('GitVersion failed')\n const error = result.error\n if (error instanceof Error) {\n this.buildAgent.setFailed(error.message, true)\n }\n return result\n }\n } catch (error) {\n if (error instanceof Error) {\n this.buildAgent.setFailed(error.message, true)\n }\n return {\n code: -1,\n error\n }\n }\n }\n\n private async command(): Promise {\n try {\n this.disableTelemetry()\n\n this.buildAgent.info('Executing GitVersion')\n\n const result = await this.gitVersionTool.executeCommand()\n\n if (result.code === 0) {\n this.buildAgent.info('GitVersion executed successfully')\n const stdout = result.stdout as string\n\n this.buildAgent.info('GitVersion output:')\n this.buildAgent.info('-------------------')\n this.buildAgent.info(stdout)\n this.buildAgent.info('-------------------')\n\n this.buildAgent.setSucceeded('GitVersion executed successfully', true)\n return result\n } else {\n this.buildAgent.debug('GitVersion failed')\n const error = result.error\n if (error instanceof Error) {\n this.buildAgent.setFailed(error.message, true)\n }\n return result\n }\n } catch (error) {\n if (error instanceof Error) {\n this.buildAgent.setFailed(error.message, true)\n }\n return {\n code: -1,\n error\n }\n }\n }\n\n private disableTelemetry(): void {\n this.buildAgent.info(`Running on: '${this.buildAgent.agentName}'`)\n this.buildAgent.debug('Disabling telemetry')\n this.gitVersionTool.disableTelemetry()\n }\n}\n"],"names":["ExecuteFields","CommandFields"],"mappings":";;;;;;;AAEY,IAAA,aAAA,qBAAAA,cAAL,KAAA;AACH,EAAAA,eAAA,YAAa,CAAA,GAAA,YAAA,CAAA;AACb,EAAAA,eAAA,cAAe,CAAA,GAAA,cAAA,CAAA;AACf,EAAAA,eAAA,sBAAuB,CAAA,GAAA,sBAAA,CAAA;AACvB,EAAAA,eAAA,0BAA2B,CAAA,GAAA,0BAAA,CAAA;A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