test the output and variables
This commit is contained in:
@@ -44,8 +44,8 @@ class BuildAgent implements IBuildAgent {
|
||||
taskLib.setResult(taskLib.TaskResult.Succeeded, message, done)
|
||||
}
|
||||
|
||||
public exportVariable(name: string, val: string): void {
|
||||
taskLib.setVariable(name, val)
|
||||
public setVariable(name: string, value: string): void {
|
||||
taskLib.setVariable(name, value)
|
||||
}
|
||||
|
||||
public getVariable(name: string): string {
|
||||
@@ -78,7 +78,7 @@ class BuildAgent implements IBuildAgent {
|
||||
}
|
||||
|
||||
public setOutput(name: string, value: string): void {
|
||||
taskLib.setVariable(name, value)
|
||||
taskLib.setVariable(name, value, false, true)
|
||||
}
|
||||
|
||||
public getInput(input: string, required?: boolean): string {
|
||||
|
||||
@@ -110,7 +110,7 @@ class BuildAgent implements IBuildAgent {
|
||||
//
|
||||
}
|
||||
|
||||
public exportVariable(name: string, val: string): void {
|
||||
public setVariable(name: string, val: string): void {
|
||||
core.exportVariable(name, val)
|
||||
}
|
||||
|
||||
@@ -155,7 +155,6 @@ class BuildAgent implements IBuildAgent {
|
||||
|
||||
public setOutput(name: string, value: string): void {
|
||||
core.setOutput(name, value)
|
||||
core.exportVariable(`GITVERSION_${name.toUpperCase()}`, value)
|
||||
}
|
||||
|
||||
public getInput(input: string, required?: boolean): string {
|
||||
|
||||
@@ -41,8 +41,8 @@ class BuildAgent implements IBuildAgent {
|
||||
console.log('setSucceeded')
|
||||
}
|
||||
|
||||
public exportVariable(name: string, val: string): void {
|
||||
console.log('exportVariable')
|
||||
public setVariable(name: string, val: string): void {
|
||||
console.log('setVariable')
|
||||
}
|
||||
|
||||
public getVariable(name: string): string {
|
||||
|
||||
@@ -28,8 +28,8 @@ export class DotnetTool implements IDotnetTool {
|
||||
}
|
||||
|
||||
public disableTelemetry(): void {
|
||||
this.buildAgent.exportVariable('DOTNET_CLI_TELEMETRY_OPTOUT', 'true')
|
||||
this.buildAgent.exportVariable('DOTNET_NOLOGO', 'true')
|
||||
this.buildAgent.setVariable('DOTNET_CLI_TELEMETRY_OPTOUT', 'true')
|
||||
this.buildAgent.setVariable('DOTNET_NOLOGO', 'true')
|
||||
}
|
||||
|
||||
public execute(cmd: string, args: string[]): Promise<IExecResult> {
|
||||
@@ -102,7 +102,7 @@ export class DotnetTool implements IDotnetTool {
|
||||
let dotnetPath = await this.buildAgent.which('dotnet')
|
||||
dotnetPath = fs.readlinkSync(dotnetPath) || dotnetPath
|
||||
const dotnetRoot = path.dirname(dotnetPath)
|
||||
this.buildAgent.exportVariable('DOTNET_ROOT', dotnetRoot)
|
||||
this.buildAgent.setVariable('DOTNET_ROOT', dotnetRoot)
|
||||
}
|
||||
this.buildAgent.addPath(toolPath)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export interface IBuildAgent {
|
||||
debug(message: string): void
|
||||
setFailed(message: string, done?: boolean): void
|
||||
setSucceeded(message: string, done?: boolean): void
|
||||
exportVariable(name: string, val: string): void
|
||||
setVariable(name: string, val: string): void
|
||||
getVariable(name: string): string
|
||||
addPath(inputPath: string): void
|
||||
which(tool: string, check?: boolean): Promise<string>
|
||||
|
||||
@@ -83,6 +83,9 @@ export class GitVersionTool extends DotnetTool implements IGitVersionTool {
|
||||
const name = this.toCamelCase(property)
|
||||
const value = gitversionOutput[property]
|
||||
this.buildAgent.setOutput(name, value)
|
||||
this.buildAgent.setOutput(`GitVersion_${name}`, value)
|
||||
this.buildAgent.setVariable(name, value)
|
||||
this.buildAgent.setVariable(`GitVersion_${name}`, value)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user