moved tools to separate folders
This commit is contained in:
16
dist/azure/gitreleasemanager/create/bundle.js
vendored
16
dist/azure/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
16
dist/azure/gitreleasemanager/setup/bundle.js
vendored
16
dist/azure/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
59
dist/azure/gitversion/execute/bundle.js
vendored
59
dist/azure/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
59
dist/azure/gitversion/setup/bundle.js
vendored
59
dist/azure/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
16
dist/github/gitreleasemanager/create/bundle.js
vendored
16
dist/github/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
16
dist/github/gitreleasemanager/setup/bundle.js
vendored
16
dist/github/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
59
dist/github/gitversion/execute/bundle.js
vendored
59
dist/github/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
59
dist/github/gitversion/setup/bundle.js
vendored
59
dist/github/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
16
dist/mock/gitreleasemanager/create/bundle.js
vendored
16
dist/mock/gitreleasemanager/create/bundle.js
vendored
File diff suppressed because one or more lines are too long
16
dist/mock/gitreleasemanager/setup/bundle.js
vendored
16
dist/mock/gitreleasemanager/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
59
dist/mock/gitversion/execute/bundle.js
vendored
59
dist/mock/gitversion/execute/bundle.js
vendored
File diff suppressed because one or more lines are too long
59
dist/mock/gitversion/setup/bundle.js
vendored
59
dist/mock/gitversion/setup/bundle.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
import { IBuildAgent, TYPES, SetupOptions } from "../../core/common";
|
||||
import { IGitReleaseManagerTool, GitReleaseManagerTool } from "../../tools/gitreleasemanager";
|
||||
import { IGitReleaseManagerTool, GitReleaseManagerTool } from "../../tools/gitreleasemanager/gitreleasemanager-tool";
|
||||
|
||||
import container from "../../core/ioc";
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { IBuildAgent, TYPES, SetupOptions } from "../../core/common";
|
||||
import { IGitVersionTool, IGitVersionArguments, IGitVersion, GitVersionTool } from "../../tools/gitversion";
|
||||
import { IGitVersionTool, GitVersionTool } from "../../tools/gitversion/gitversion-tool";
|
||||
import { IGitVersionInput, IGitVersionOutput } from "../../tools/gitversion/models";
|
||||
|
||||
import container from "../../core/ioc";
|
||||
|
||||
@@ -26,11 +27,11 @@ export async function setup() {
|
||||
|
||||
export async function run() {
|
||||
try {
|
||||
const inputOptions: IGitVersionArguments = gitVersionTool.getGitVersionOptions();
|
||||
const inputOptions: IGitVersionInput = gitVersionTool.getGitVersionOptions();
|
||||
|
||||
const result = await gitVersionTool.run(inputOptions);
|
||||
|
||||
const gitversion = JSON.parse(result.stdout) as IGitVersion;
|
||||
const gitversion = JSON.parse(result.stdout) as IGitVersionOutput;
|
||||
gitVersionTool.writeGitVersionToAgent(gitversion);
|
||||
|
||||
if (result.code === 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { TYPES, IBuildAgent } from "../core/common";
|
||||
import { TYPES, IBuildAgent } from "../../core/common";
|
||||
import { injectable, inject } from "inversify";
|
||||
import { IDotnetTool } from "../core/dotnet-tool";
|
||||
import { IDotnetTool } from "../../core/dotnet-tool";
|
||||
|
||||
export interface IGitReleaseManagerTool {
|
||||
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
|
||||
@@ -1,68 +1,14 @@
|
||||
import path = require("path");
|
||||
import { injectable, inject } from "inversify";
|
||||
import { IExecResult, IBuildAgent, TYPES } from "../core/common";
|
||||
import { IDotnetTool } from "../core/dotnet-tool";
|
||||
|
||||
export interface IGitVersionArguments {
|
||||
targetPath: string;
|
||||
useConfigFile: boolean;
|
||||
configFilePath: string;
|
||||
updateAssemblyInfo: boolean;
|
||||
updateAssemblyInfoFilename: string;
|
||||
additionalArguments: string;
|
||||
srcDir: string;
|
||||
}
|
||||
|
||||
export const GitVersionRunOptions = {
|
||||
targetPath: "targetPath",
|
||||
|
||||
useConfigFile: "useConfigFile",
|
||||
configFilePath: "configFilePath",
|
||||
|
||||
updateAssemblyInfo: "configFilePath",
|
||||
updateAssemblyInfoFilename: "configFilePath",
|
||||
|
||||
additionalArguments: "additionalArguments",
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
import { IExecResult, IBuildAgent, TYPES } from "../../core/common";
|
||||
import { IDotnetTool } from "../../core/dotnet-tool";
|
||||
import { IGitVersionInput, IGitVersionOutput, GitVersionRunOptions } from "./models";
|
||||
|
||||
export interface IGitVersionTool {
|
||||
install(versionSpec: string, includePrerelease: boolean): Promise<void>;
|
||||
run(options: IGitVersionArguments): Promise<IExecResult>;
|
||||
writeGitVersionToAgent(gitversion: IGitVersion): void;
|
||||
getGitVersionOptions(): IGitVersionArguments;
|
||||
run(options: IGitVersionInput): Promise<IExecResult>;
|
||||
writeGitVersionToAgent(gitversion: IGitVersionOutput): void;
|
||||
getGitVersionOptions(): IGitVersionInput;
|
||||
}
|
||||
|
||||
@injectable()
|
||||
@@ -83,7 +29,7 @@ export class GitVersionTool implements IGitVersionTool {
|
||||
await this.dotnetTool.toolInstall("GitVersion.Tool", versionSpec, false, includePrerelease);
|
||||
}
|
||||
|
||||
public run(options: IGitVersionArguments): Promise<IExecResult> {
|
||||
public run(options: IGitVersionInput): Promise<IExecResult> {
|
||||
const workDir = this.getRepoDir(options.targetPath);
|
||||
|
||||
const args = this.getArguments(workDir, options);
|
||||
@@ -106,7 +52,7 @@ export class GitVersionTool implements IGitVersionTool {
|
||||
return workDir.replace(/\\/g, "/");
|
||||
}
|
||||
|
||||
private getArguments(workDir: string, options: IGitVersionArguments): string[] {
|
||||
private getArguments(workDir: string, options: IGitVersionInput): string[] {
|
||||
const args = [
|
||||
workDir,
|
||||
"/output",
|
||||
@@ -141,7 +87,7 @@ export class GitVersionTool implements IGitVersionTool {
|
||||
return args;
|
||||
}
|
||||
|
||||
public getGitVersionOptions(): IGitVersionArguments {
|
||||
public getGitVersionOptions(): IGitVersionInput {
|
||||
|
||||
const targetPath = this.buildAgent.getInput(GitVersionRunOptions.targetPath);
|
||||
|
||||
@@ -166,7 +112,7 @@ export class GitVersionTool implements IGitVersionTool {
|
||||
};
|
||||
}
|
||||
|
||||
public writeGitVersionToAgent(gitversion: IGitVersion): void {
|
||||
public writeGitVersionToAgent(gitversion: IGitVersionOutput): void {
|
||||
|
||||
this.buildAgent.setOutput("major", gitversion.Major.toString());
|
||||
this.buildAgent.setOutput("minor", gitversion.Minor.toString());
|
||||
51
src/tools/gitversion/models.ts
Normal file
51
src/tools/gitversion/models.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
export const GitVersionRunOptions = {
|
||||
targetPath: "targetPath",
|
||||
useConfigFile: "useConfigFile",
|
||||
configFilePath: "configFilePath",
|
||||
updateAssemblyInfo: "configFilePath",
|
||||
updateAssemblyInfoFilename: "configFilePath",
|
||||
additionalArguments: "additionalArguments",
|
||||
};
|
||||
|
||||
export interface IGitVersionInput {
|
||||
targetPath: string;
|
||||
useConfigFile: boolean;
|
||||
configFilePath: string;
|
||||
updateAssemblyInfo: boolean;
|
||||
updateAssemblyInfoFilename: string;
|
||||
additionalArguments: string;
|
||||
srcDir: string;
|
||||
}
|
||||
|
||||
export interface IGitVersionOutput {
|
||||
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