Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4a9fa96
Add Microsoft.Extensions.DependencyInjection
arturcic Oct 17, 2019
ff811ea
Add Microsoft.Extensions.Hosting
arturcic Oct 17, 2019
83d002a
Register types in each module
arturcic Oct 20, 2019
8895c6c
refactored ExecCommand and ExecuteCore
arturcic Oct 21, 2019
f3ac0e9
replaced BuildServerList with BuildServerResolver
arturcic Oct 21, 2019
26480d7
moved initialization to CoreModule
arturcic Oct 21, 2019
923f91d
applied code review changes
arturcic Oct 22, 2019
dd892d5
using c#8 using declarations
arturcic Oct 22, 2019
dbac722
code cleanup for GitVersionComputer & GitPrepare
arturcic Oct 22, 2019
df2f486
code cleanup for GitPrepare
arturcic Oct 22, 2019
d7d0dc5
moved the semanticversion classes to folder, made IGitVersionCache DI
arturcic Oct 22, 2019
ec1639e
applied code review changes
arturcic Oct 23, 2019
fb2566f
moving to DI GitVersionFinder, VariableProvider and MetaDataCalculator
arturcic Oct 23, 2019
8e0c12d
moving to DI ConfigurationProvider, GitPreparer
arturcic Oct 23, 2019
d040f41
made GitversionTask DI aware
arturcic Oct 23, 2019
ce1e815
migrate to DI IBaseVersionCalculator
arturcic Oct 23, 2019
9dcce02
migrate to DI NextVersionCalculator
arturcic Oct 23, 2019
901cccc
code cleanup
arturcic Oct 23, 2019
5958435
applied code review changes
arturcic Oct 24, 2019
82a8e33
made GitversionTask DI aware, added GitVersionTaskExecutor
arturcic Oct 24, 2019
433a597
ConfigurationProvider cleanup
arturcic Oct 24, 2019
d572cc7
moving to DI MainlineVersionCalculator
arturcic Oct 24, 2019
dff4e62
using c#8 switch expressions
arturcic Oct 24, 2019
b394a93
moving to DI ConfigInit
arturcic Oct 24, 2019
b243b4d
ConfigInitSteps, made constructor with the same parameters
arturcic Oct 24, 2019
cd1afb1
moving to DI ConfigInit (2), added IConfigInitStepFactory
arturcic Oct 24, 2019
a22fb34
added "?? throw new ArgumentNullException(nameof({field}))" to the i…
arturcic Oct 24, 2019
405cdb3
fix GitPrepare injection
arturcic Oct 24, 2019
ba517dd
moved ConfigInit registration from CoreModule
arturcic Oct 24, 2019
70cb999
introduced ConfigFileLocatorFactory
arturcic Oct 24, 2019
98eebe6
adjusted field names, removed underscore
arturcic Oct 25, 2019
2684c41
code review adjustments
arturcic Oct 25, 2019
7ef3499
code review adjustments
arturcic Oct 25, 2019
02074ed
Moved the `GitVersionTask` and `GitVersionTask.MsBuild` under `GitVer…
arturcic Oct 25, 2019
83ed431
+semver: minor code review adjustments
arturcic Oct 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ConfigInitSteps, made constructor with the same parameters
  • Loading branch information
arturcic committed Oct 24, 2019
commit b243b4d950cade4f91f2d569695995af1831657f
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ internal enum ProjectVisibility

internal class AppVeyorSetup : ConfigInitWizardStep
{
private readonly ProjectVisibility _projectVisibility;
private ProjectVisibility _projectVisibility;

public AppVeyorSetup(IConsole console, IFileSystem fileSystem, ILog log, ProjectVisibility visibility) : base(console, fileSystem, log)
public AppVeyorSetup(IConsole console, IFileSystem fileSystem, ILog log) : base(console, fileSystem, log)
{
}

public AppVeyorSetup WithData(ProjectVisibility visibility)
{
_projectVisibility = visibility;
return this;
}

protected override StepResult HandleResult(string result, Queue<ConfigInitWizardStep> steps, Config config, string workingDirectory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ protected override StepResult HandleResult(string result, Queue<ConfigInitWizard
steps.Enqueue(new EditConfigStep(Console, FileSystem, Log));
return StepResult.Ok();
case "1":
steps.Enqueue(new AppVeyorSetup(Console, FileSystem, Log, ProjectVisibility.Public));
steps.Enqueue(new AppVeyorSetup(Console, FileSystem, Log).WithData(ProjectVisibility.Public));
return StepResult.Ok();
case "2":
steps.Enqueue(new AppVeyorSetup(Console, FileSystem, Log, ProjectVisibility.Private));
steps.Enqueue(new AppVeyorSetup(Console, FileSystem, Log).WithData(ProjectVisibility.Private));
return StepResult.Ok();
}
return StepResult.Ok();
Expand Down
3 changes: 2 additions & 1 deletion src/GitVersionCore/Configuration/Init/EditConfigStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ protected override StepResult HandleResult(string result, Queue<ConfigInitWizard
steps.Enqueue(new ConfigureBranches(Console, FileSystem, Log));
return StepResult.Ok();
case "5":
steps.Enqueue(new GlobalModeSetting(new EditConfigStep(Console, FileSystem, Log), false, Console, FileSystem, Log));
var editConfigStep = new EditConfigStep(Console, FileSystem, Log);
steps.Enqueue(new GlobalModeSetting(Console, FileSystem, Log).WithData(editConfigStep, false));
return StepResult.Ok();
case "6":
steps.Enqueue(new AssemblyVersioningSchemeSetting(Console, FileSystem, Log));
Expand Down
20 changes: 12 additions & 8 deletions src/GitVersionCore/Configuration/Init/SetConfig/ConfigureBranch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ namespace GitVersion.Configuration.Init.SetConfig
{
public class ConfigureBranch : ConfigInitWizardStep
{
private readonly string name;
private readonly BranchConfig branchConfig;
private string name;
private BranchConfig branchConfig;

public ConfigureBranch(string name, BranchConfig branchConfig, IConsole console, IFileSystem fileSystem, ILog log)
: base(console, fileSystem, log)
public ConfigureBranch(IConsole console, IFileSystem fileSystem, ILog log) : base(console, fileSystem, log)
{
this.branchConfig = branchConfig;
this.name = name;
}

public ConfigureBranch WithData(string _name, BranchConfig _branchConfig)
{
branchConfig = _branchConfig;
name = _name;
return this;
}

protected override StepResult HandleResult(string result, Queue<ConfigInitWizardStep> steps, Config config, string workingDirectory)
Expand All @@ -24,10 +28,10 @@ protected override StepResult HandleResult(string result, Queue<ConfigInitWizard
steps.Enqueue(new ConfigureBranches(Console, FileSystem, Log));
return StepResult.Ok();
case "1":
steps.Enqueue(new SetBranchTag(name, branchConfig, Console, FileSystem, Log));
steps.Enqueue(new SetBranchTag(Console, FileSystem, Log).WithData(name, branchConfig));
return StepResult.Ok();
case "2":
steps.Enqueue(new SetBranchIncrementMode(name, branchConfig, Console, FileSystem, Log));
steps.Enqueue(new SetBranchIncrementMode(Console, FileSystem, Log).WithData(name, branchConfig));
return StepResult.Ok();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected override StepResult HandleResult(string result, Queue<ConfigInitWizard
branchConfig = new BranchConfig {Name = foundBranch.Key};
config.Branches.Add(foundBranch.Key, branchConfig);
}
steps.Enqueue(new ConfigureBranch(foundBranch.Key, branchConfig, Console, FileSystem, Log));
steps.Enqueue(new ConfigureBranch(Console, FileSystem, Log).WithData(foundBranch.Key, branchConfig));
return StepResult.Ok();
}
catch (ArgumentOutOfRangeException)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ namespace GitVersion.Configuration.Init.SetConfig
{
public class GlobalModeSetting : ConfigInitWizardStep
{
private readonly ConfigInitWizardStep returnToStep;
private readonly bool isPartOfWizard;
private ConfigInitWizardStep returnToStep;
private bool isPartOfWizard;

public GlobalModeSetting(ConfigInitWizardStep returnToStep, bool isPartOfWizard, IConsole console, IFileSystem fileSystem, ILog log)
: base(console, fileSystem, log)
public GlobalModeSetting(IConsole console, IFileSystem fileSystem, ILog log) : base(console, fileSystem, log)
{
this.returnToStep = returnToStep;
this.isPartOfWizard = isPartOfWizard;
}

public GlobalModeSetting WithData(ConfigInitWizardStep _returnToStep, bool _isPartOfWizard)
{
returnToStep = _returnToStep;
isPartOfWizard = _isPartOfWizard;
return this;
}

protected override StepResult HandleResult(string result, Queue<ConfigInitWizardStep> steps, Config config, string workingDirectory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,34 @@ namespace GitVersion.Configuration.Init.SetConfig
{
public class SetBranchIncrementMode : ConfigInitWizardStep
{
private readonly string name;
private readonly BranchConfig branchConfig;
private string name;
private BranchConfig branchConfig;

public SetBranchIncrementMode(string name, BranchConfig branchConfig, IConsole console, IFileSystem fileSystem, ILog log)
: base(console, fileSystem, log)
public SetBranchIncrementMode(IConsole console, IFileSystem fileSystem, ILog log) : base(console, fileSystem, log)
{
this.name = name;
this.branchConfig = branchConfig;
}

public SetBranchIncrementMode WithData(string _name, BranchConfig _branchConfig)
{
branchConfig = _branchConfig;
name = _name;
return this;
}

protected override StepResult HandleResult(string result, Queue<ConfigInitWizardStep> steps, Config config, string workingDirectory)
{
switch (result)
{
case "0":
steps.Enqueue(new ConfigureBranch(name, branchConfig, Console, FileSystem, Log));
steps.Enqueue(new ConfigureBranch(Console, FileSystem, Log).WithData(name, branchConfig));
return StepResult.Ok();
case "1":
branchConfig.VersioningMode = VersioningMode.ContinuousDelivery;
steps.Enqueue(new ConfigureBranch(name, branchConfig, Console, FileSystem, Log));
steps.Enqueue(new ConfigureBranch(Console, FileSystem, Log).WithData(name, branchConfig));
return StepResult.Ok();
case "2":
branchConfig.VersioningMode = VersioningMode.ContinuousDeployment;
steps.Enqueue(new ConfigureBranch(name, branchConfig, Console, FileSystem, Log));
steps.Enqueue(new ConfigureBranch(Console, FileSystem, Log).WithData(name, branchConfig));
return StepResult.Ok();
}

Expand Down
22 changes: 13 additions & 9 deletions src/GitVersionCore/Configuration/Init/SetConfig/SetBranchTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ namespace GitVersion.Configuration.Init.SetConfig
{
public class SetBranchTag : ConfigInitWizardStep
{
private readonly string name;
private readonly BranchConfig branchConfig;
private string name;
private BranchConfig branchConfig;

public SetBranchTag(string name, BranchConfig branchConfig, IConsole console, IFileSystem fileSystem, ILog log)
: base(console, fileSystem, log)
public SetBranchTag(IConsole console, IFileSystem fileSystem, ILog log) : base(console, fileSystem, log)
{
this.name = name;
this.branchConfig = branchConfig;
}

public SetBranchTag WithData(string _name, BranchConfig _branchConfig)
{
branchConfig = _branchConfig;
name = _name;
return this;
}

protected override StepResult HandleResult(string result, Queue<ConfigInitWizardStep> steps, Config config, string workingDirectory)
Expand All @@ -26,15 +30,15 @@ protected override StepResult HandleResult(string result, Queue<ConfigInitWizard
switch (result)
{
case "0":
steps.Enqueue(new ConfigureBranch(name, branchConfig, Console, FileSystem, Log));
steps.Enqueue(new ConfigureBranch(Console, FileSystem, Log).WithData( name, branchConfig));
return StepResult.Ok();
case "1":
branchConfig.Tag = string.Empty;
steps.Enqueue(new ConfigureBranch(name, branchConfig, Console, FileSystem, Log));
steps.Enqueue(new ConfigureBranch(Console, FileSystem, Log).WithData(name, branchConfig));
return StepResult.Ok();
default:
branchConfig.Tag = result;
steps.Enqueue(new ConfigureBranch(name, branchConfig, Console, FileSystem, Log));
steps.Enqueue(new ConfigureBranch(Console, FileSystem, Log).WithData(name, branchConfig));
return StepResult.Ok();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace GitVersion.Configuration.Init.Wizard
{
public class GitFlowSetupStep : GlobalModeSetting
{
public GitFlowSetupStep(IConsole console, IFileSystem fileSystem, ILog log) : base(new FinishedSetupStep(console, fileSystem, log), true, console, fileSystem, log)
public GitFlowSetupStep(IConsole console, IFileSystem fileSystem, ILog log) : base(console, fileSystem, log)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace GitVersion.Configuration.Init.Wizard
{
public class GitHubFlowStep : GlobalModeSetting
{
public GitHubFlowStep(IConsole console, IFileSystem fileSystem, ILog log) : base(new FinishedSetupStep(console, fileSystem, log), true, console, fileSystem, log)
public GitHubFlowStep(IConsole console, IFileSystem fileSystem, ILog log) : base(console, fileSystem, log)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ public PickBranchingStrategyStep(IConsole console, IFileSystem fileSystem, ILog

protected override StepResult HandleResult(string result, Queue<ConfigInitWizardStep> steps, Config config, string workingDirectory)
{
var returnToStep = new FinishedSetupStep(Console, FileSystem, Log);
switch (result)
{
case "1":
steps.Enqueue(new GitFlowSetupStep(Console, FileSystem, Log));
steps.Enqueue(new GitFlowSetupStep(Console, FileSystem, Log).WithData(returnToStep, true));
break;
case "2":
steps.Enqueue(new GitHubFlowStep(Console, FileSystem, Log));
steps.Enqueue(new GitHubFlowStep(Console, FileSystem, Log).WithData(returnToStep, true));
break;
case "3":
steps.Enqueue(new PickBranchingStrategy1Step(Console, FileSystem, Log));
Expand Down