File tree Expand file tree Collapse file tree 8 files changed +49
-9
lines changed Expand file tree Collapse file tree 8 files changed +49
-9
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,6 @@ public void Configure(IServiceCollection services)
13
13
14
14
services . UseWorkingDirectory ( Extensions . GetRootDirectory ( ) ) ;
15
15
16
- services . UseTool ( new Uri ( "dotnet:?package= GitVersion.Tool&version=5.8.2" ) ) ;
16
+ services . UseDotnetTool ( Tools . GitVersion , Tools . Versions [ Tools . GitVersion ] ) ;
17
17
}
18
18
}
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ public void Configure(IServiceCollection services)
13
13
14
14
services . UseWorkingDirectory ( Extensions . GetRootDirectory ( ) ) ;
15
15
16
- services . UseTool ( new Uri ( "nuget:?package=NuGet.CommandLine&version=6.0.0" ) ) ;
17
- services . UseTool ( new Uri ( "dotnet:?package= Codecov.Tool&version=1.13.0" ) ) ;
18
- services . UseTool ( new Uri ( "dotnet:?package= GitVersion.Tool&version=5.8.2" ) ) ;
16
+ services . UseNugetTool ( Tools . NugetCmd , Tools . Versions [ Tools . NugetCmd ] ) ;
17
+ services . UseDotnetTool ( Tools . Codecov , Tools . Versions [ Tools . Codecov ] ) ;
18
+ services . UseDotnetTool ( Tools . GitVersion , Tools . Versions [ Tools . GitVersion ] ) ;
19
19
}
20
20
}
Original file line number Diff line number Diff line change
1
+ using Microsoft . Extensions . DependencyInjection ;
2
+
3
+ namespace Common . Utilities ;
4
+
5
+ public static class ServicesExtensions
6
+ {
7
+ public static IServiceCollection UseDotnetTool ( this IServiceCollection services , string toolName , string toolVersion )
8
+ {
9
+ services . UseTool ( new Uri ( $ "dotnet:?package={ toolName } &version={ toolVersion } ") ) ;
10
+ return services ;
11
+ }
12
+
13
+ public static IServiceCollection UseNugetTool ( this IServiceCollection services , string toolName , string toolVersion )
14
+ {
15
+ services . UseTool ( new Uri ( $ "nuget:?package={ toolName } &version={ toolVersion } ") ) ;
16
+ return services ;
17
+ }
18
+ }
Original file line number Diff line number Diff line change
1
+ namespace Common . Utilities ;
2
+
3
+ public class Tools
4
+ {
5
+ public const string NugetCmd = "NuGet.CommandLine" ;
6
+
7
+ public const string GitVersion = "GitVersion.Tool" ;
8
+ public const string GitReleaseManager = "GitReleaseManager.Tool" ;
9
+ public const string Codecov = "Codecov.Tool" ;
10
+ public const string Wyam2 = "Wyam2.Tool" ;
11
+
12
+ public static readonly Dictionary < string , string > Versions = new ( )
13
+ {
14
+ { NugetCmd , "6.0.0" } ,
15
+
16
+ { GitVersion , "5.8.3" } ,
17
+ { GitReleaseManager , "0.13.0" } ,
18
+ { Codecov , "1.13.0" } ,
19
+ { Wyam2 , "3.0.0-rc3&prerelease" } ,
20
+ } ;
21
+ }
Original file line number Diff line number Diff line change @@ -13,6 +13,6 @@ public void Configure(IServiceCollection services)
13
13
14
14
services . UseWorkingDirectory ( Extensions . GetRootDirectory ( ) ) ;
15
15
16
- services . UseTool ( new Uri ( "dotnet:?package= GitVersion.Tool&version=5.8.2" ) ) ;
16
+ services . UseDotnetTool ( Tools . GitVersion , Tools . Versions [ Tools . GitVersion ] ) ;
17
17
}
18
18
}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ public void Configure(IServiceCollection services)
13
13
14
14
services . UseWorkingDirectory ( Extensions . GetRootDirectory ( ) ) ;
15
15
16
- services . UseTool ( new Uri ( "dotnet:?package=Wyam2.Tool&version=3.0.0-rc2&prerelease" ) ) ;
16
+ services . UseDotnetTool ( Tools . GitVersion , Tools . Versions [ Tools . GitVersion ] ) ;
17
+ services . UseDotnetTool ( Tools . Wyam2 , Tools . Versions [ Tools . Wyam2 ] ) ;
17
18
}
18
19
}
Original file line number Diff line number Diff line change @@ -13,6 +13,6 @@ public void Configure(IServiceCollection services)
13
13
14
14
services . UseWorkingDirectory ( Extensions . GetRootDirectory ( ) ) ;
15
15
16
- services . UseTool ( new Uri ( "dotnet:?package= GitVersion.Tool&version=5.8.2" ) ) ;
16
+ services . UseDotnetTool ( Tools . GitVersion , Tools . Versions [ Tools . GitVersion ] ) ;
17
17
}
18
18
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public void Configure(IServiceCollection services)
13
13
14
14
services . UseWorkingDirectory ( Extensions . GetRootDirectory ( ) ) ;
15
15
16
- services . UseTool ( new Uri ( "dotnet:?package= GitVersion.Tool&version=5.8.2" ) ) ;
17
- services . UseTool ( new Uri ( "dotnet:?package= GitReleaseManager.Tool&version=0.13.0" ) ) ;
16
+ services . UseDotnetTool ( Tools . GitVersion , Tools . Versions [ Tools . GitVersion ] ) ;
17
+ services . UseDotnetTool ( Tools . GitReleaseManager , Tools . Versions [ Tools . GitReleaseManager ] ) ;
18
18
}
19
19
}
You can’t perform that action at this time.
0 commit comments