-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from augustoproiete/run-as-global-tool-and-fall…
…back-logic Add ability to execute MinVer as global tool and fallback logic
- Loading branch information
Showing
16 changed files
with
939 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System.Collections.Generic; | ||
using Cake.Core; | ||
using Cake.Core.Diagnostics; | ||
using Cake.Core.IO; | ||
using Cake.Core.Tooling; | ||
|
||
namespace Cake.MinVer | ||
{ | ||
internal class MinVerGlobalTool : MinVerToolBase | ||
{ | ||
public MinVerGlobalTool( | ||
IFileSystem fileSystem, | ||
ICakeEnvironment environment, | ||
IProcessRunner processRunner, | ||
IToolLocator tools, | ||
ICakeLog log) : base(fileSystem, environment, processRunner, tools, log) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override ProcessArgumentBuilder GetArguments(MinVerSettings settings) | ||
{ | ||
var command = new ProcessArgumentBuilder(); | ||
var args = CreateArgumentBuilder(settings); | ||
|
||
if (!args.IsNullOrEmpty()) | ||
{ | ||
args.CopyTo(command); | ||
} | ||
|
||
CakeLog.Verbose("{0} arguments: {1}", GetToolName(), args.RenderSafe()); | ||
|
||
return command; | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override string GetToolName() | ||
{ | ||
return "MinVer Global Tool (minver)"; | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override IEnumerable<string> GetToolExecutableNames() | ||
{ | ||
return new [] { "minver", "minver.exe" }; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Cake.Core; | ||
using Cake.Core.Diagnostics; | ||
using Cake.Core.IO; | ||
using Cake.Core.Tooling; | ||
|
||
namespace Cake.MinVer | ||
{ | ||
internal class MinVerLocalTool : MinVerToolBase | ||
{ | ||
public MinVerLocalTool( | ||
IFileSystem fileSystem, | ||
ICakeEnvironment environment, | ||
IProcessRunner processRunner, | ||
IToolLocator tools, | ||
ICakeLog log) : base(fileSystem, environment, processRunner, tools, log) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override ProcessArgumentBuilder GetArguments(MinVerSettings settings) | ||
{ | ||
var command = new ProcessArgumentBuilder(); | ||
var args = CreateArgumentBuilder(settings); | ||
|
||
command.Append("minver"); | ||
|
||
if (!args.IsNullOrEmpty()) | ||
{ | ||
args.CopyTo(command); | ||
} | ||
|
||
CakeLog.Verbose("{0} arguments: {1}", GetToolName(), args.RenderSafe()); | ||
|
||
return command; | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override string GetToolName() | ||
{ | ||
return "MinVer Local Tool (dotnet minver)"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.