working on output

This commit is contained in:
Artur Stolear
2019-11-22 18:41:07 +02:00
parent 31561bfe18
commit b7b390a2ca
4 changed files with 41 additions and 5 deletions

View File

@@ -188,7 +188,7 @@ class GitVersionTool implements IGitVersionTool {
const args = [
workDir,
"/output",
"json",
"json", // need to use buildserver later
];
const {

View File

@@ -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);

View File

@@ -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;
}