working on output
This commit is contained in:
@@ -188,7 +188,7 @@ class GitVersionTool implements IGitVersionTool {
|
||||
const args = [
|
||||
workDir,
|
||||
"/output",
|
||||
"json",
|
||||
"json", // need to use buildserver later
|
||||
];
|
||||
|
||||
const {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import "reflect-metadata";
|
||||
|
||||
import { IBuildAgent, IGitVersionOptions, IGitVersionTool } from "../interfaces";
|
||||
import { IBuildAgent, IGitVersion, IGitVersionOptions, IGitVersionTool } from "../interfaces";
|
||||
import { RunOptions, TYPES } from "../types";
|
||||
import { ioc } from "./ioc";
|
||||
|
||||
@@ -12,7 +12,9 @@ export async function run() {
|
||||
const inputOptions: IGitVersionOptions = getGitVersionOptions();
|
||||
|
||||
const result = await gitVersionTool.run(inputOptions);
|
||||
console.log(result.stdout);
|
||||
|
||||
const gitversion = JSON.parse(result.stdout) as IGitVersion;
|
||||
console.log(gitversion.FullSemVer);
|
||||
|
||||
if (result.code === 0) {
|
||||
buildAgent.setSucceeded("GitVersion executed successfully", true);
|
||||
|
||||
@@ -56,3 +56,36 @@ export interface IGitVersionOptions {
|
||||
additionalArguments: string;
|
||||
srcDir: string;
|
||||
}
|
||||
|
||||
export interface IGitVersion {
|
||||
Major: number;
|
||||
Minor: number;
|
||||
Patch: number;
|
||||
PreReleaseTag: string;
|
||||
PreReleaseTagWithDash: string;
|
||||
PreReleaseLabel: string;
|
||||
PreReleaseNumber: number;
|
||||
WeightedPreReleaseNumber: number;
|
||||
BuildMetaData: number;
|
||||
BuildMetaDataPadded: string;
|
||||
FullBuildMetaData: string;
|
||||
MajorMinorPatch: string;
|
||||
SemVer: string;
|
||||
LegacySemVer: string;
|
||||
LegacySemVerPadded: string;
|
||||
AssemblySemVer: string;
|
||||
AssemblySemFileVer: string;
|
||||
FullSemVer: string;
|
||||
InformationalVersion: string;
|
||||
BranchName: string;
|
||||
Sha: string;
|
||||
ShortSha: string;
|
||||
NuGetVersionV2: string;
|
||||
NuGetVersion: string;
|
||||
NuGetPreReleaseTagV2: string;
|
||||
NuGetPreReleaseTag: string;
|
||||
VersionSourceSha: string;
|
||||
CommitsSinceVersionSource: number;
|
||||
CommitsSinceVersionSourcePadded: string;
|
||||
CommitDate: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user