Skip to content

Commit

Permalink
Remove deprecated GitVersion output and variable formats
Browse files Browse the repository at this point in the history
Dropped support for `GitVersion.<property>` format in outputs and variables to simplify the codebase and improve clarity. Tests were updated to reflect these changes, ensuring compatibility with the remaining formats.
  • Loading branch information
arturcic committed Dec 10, 2024
1 parent bc8cf5c commit 0dbd9f6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
3 changes: 0 additions & 3 deletions src/__tests__/tools/gitversion/runner.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ describe('GitVersion Runner', () => {
expect(getEnv('GitVersion_Major')).toBeDefined()
expect(getEnv('GitVersion_Minor')).toBeDefined()
expect(getEnv('GitVersion_Patch')).toBeDefined()
expect(getEnv('GitVersion.Major')).toBeDefined()
expect(getEnv('GitVersion.Minor')).toBeDefined()
expect(getEnv('GitVersion.Patch')).toBeDefined()

expect(getEnv('major')).toBeDefined()
expect(getEnv('minor')).toBeDefined()
Expand Down
12 changes: 0 additions & 12 deletions src/__tests__/tools/gitversion/tool.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ describe('GitVersionTool', () => {
expect(outputs.get('GitVersion_SemVer')).toBe('1.2.3-alpha.1')
expect(outputs.get('GitVersion_FullSemVer')).toBe('1.2.3-alpha.1')

expect(outputs.get('GitVersion.Major')).toBe('1')
expect(outputs.get('GitVersion.Minor')).toBe('2')
expect(outputs.get('GitVersion.Patch')).toBe('3')
expect(outputs.get('GitVersion.SemVer')).toBe('1.2.3-alpha.1')
expect(outputs.get('GitVersion.FullSemVer')).toBe('1.2.3-alpha.1')

expect(variables.get('major')).toBe('1')
expect(variables.get('minor')).toBe('2')
expect(variables.get('patch')).toBe('3')
Expand All @@ -103,12 +97,6 @@ describe('GitVersionTool', () => {
expect(variables.get('GitVersion_Patch')).toBe('3')
expect(variables.get('GitVersion_SemVer')).toBe('1.2.3-alpha.1')
expect(variables.get('GitVersion_FullSemVer')).toBe('1.2.3-alpha.1')

expect(variables.get('GitVersion.Major')).toBe('1')
expect(variables.get('GitVersion.Minor')).toBe('2')
expect(variables.get('GitVersion.Patch')).toBe('3')
expect(variables.get('GitVersion.SemVer')).toBe('1.2.3-alpha.1')
expect(variables.get('GitVersion.FullSemVer')).toBe('1.2.3-alpha.1')
})
})

Expand Down
2 changes: 0 additions & 2 deletions src/tools/gitversion/tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ export class GitVersionTool extends DotnetTool {
}
this.buildAgent.setOutput(name, value)
this.buildAgent.setOutput(`GitVersion_${property}`, value)
this.buildAgent.setOutput(`GitVersion.${property}`, value)
this.buildAgent.setVariable(name, value)
this.buildAgent.setVariable(`GitVersion_${property}`, value)
this.buildAgent.setVariable(`GitVersion.${property}`, value)
} catch (_error) {
this.buildAgent.error(`Unable to set output/variable for ${property}`)
}
Expand Down

0 comments on commit 0dbd9f6

Please sign in to comment.