diff --git a/modules/KoreBuild.Tasks/module.targets b/modules/KoreBuild.Tasks/module.targets
index 6ef4699..f2c9c61 100644
--- a/modules/KoreBuild.Tasks/module.targets
+++ b/modules/KoreBuild.Tasks/module.targets
@@ -9,6 +9,7 @@
false
+ $(RepositoryRoot)build\dependencies.props
@@ -77,23 +78,24 @@
-
+
+
@@ -102,7 +104,7 @@
diff --git a/tools/KoreBuild.Console/Commands/CommandBase.cs b/tools/KoreBuild.Console/Commands/CommandBase.cs
index 35f702d..bb8fcc8 100644
--- a/tools/KoreBuild.Console/Commands/CommandBase.cs
+++ b/tools/KoreBuild.Console/Commands/CommandBase.cs
@@ -18,7 +18,7 @@ namespace KoreBuild.Console.Commands
application.OnExecute(
() =>
{
- if(IsValid())
+ if (IsValid())
{
return Execute();
}
diff --git a/tools/KoreBuild.Console/Commands/DependenciesGenerateCommand.cs b/tools/KoreBuild.Console/Commands/DependenciesGenerateCommand.cs
new file mode 100644
index 0000000..4122078
--- /dev/null
+++ b/tools/KoreBuild.Console/Commands/DependenciesGenerateCommand.cs
@@ -0,0 +1,72 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.IO;
+using Microsoft.Extensions.CommandLineUtils;
+
+namespace KoreBuild.Console.Commands
+{
+ internal class DependenciesGenerateCommand : SubCommandBase
+ {
+ private CommandOption _configOpt;
+ private CommandOption _fileOpt;
+
+ public override void Configure(CommandLineApplication application)
+ {
+ application.Description = "Generates a build/dependencies.props file and updates csproj files to use variables";
+ application.ExtendedHelpText = @"
+MORE INFO:
+
+ This command will generate a dependencies.props file and adjust all PackageReference's in csproj files
+ to use the MSBuild variables it generates.
+
+ Example output:
+
+
+
+ 1.0.0
+
+
+";
+
+ _configOpt = application.Option("-c|--configuration ", "The MSBuild configuration. Defaults to 'Debug'.", CommandOptionType.SingleValue);
+ _fileOpt = application.Option("--deps-file ", "The dependencies.props file to upgrade.", CommandOptionType.SingleValue);
+
+ base.Configure(application);
+ }
+
+ protected override int Execute()
+ {
+ var args = new List
+ {
+ "msbuild",
+ Path.Combine(KoreBuildDir, "KoreBuild.proj"),
+ "-t:GenerateDependenciesPropsFile",
+ };
+
+ if (_configOpt.HasValue())
+ {
+ args.Add("-p:Configuration=" + _configOpt.Value());
+ }
+
+ if (_fileOpt.HasValue())
+ {
+ var filePath = _fileOpt.Value();
+ if (!Path.IsPathRooted(filePath))
+ {
+ filePath = Path.GetFullPath(filePath);
+ }
+
+ args.Add("-p:DependencyVersionsFile=" + filePath);
+ }
+
+ if (Reporter.IsVerbose)
+ {
+ args.Add("-v:n");
+ }
+
+ return RunDotnet(args, RepoPath);
+ }
+ }
+}
diff --git a/tools/KoreBuild.Console/Commands/DependenciesUpgradeCommand.cs b/tools/KoreBuild.Console/Commands/DependenciesUpgradeCommand.cs
new file mode 100644
index 0000000..0c87df7
--- /dev/null
+++ b/tools/KoreBuild.Console/Commands/DependenciesUpgradeCommand.cs
@@ -0,0 +1,88 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.IO;
+using Microsoft.Extensions.CommandLineUtils;
+
+namespace KoreBuild.Console.Commands
+{
+ internal class DependenciesUpgradeCommand : SubCommandBase
+ {
+ private CommandOption _sourceOpt;
+ private CommandOption _packageIdOpt;
+ private CommandOption _packageVersionOpt;
+ private CommandOption _fileOpt;
+
+ public override void Configure(CommandLineApplication application)
+ {
+ application.Description = "Upgrades the build/dependencies.props file to the latest package versions";
+ application.ExtendedHelpText = @"
+MORE INFO:
+
+ The upgrade uses a 'lineup' package as the source of information about which versions to use.
+
+ A lineup package is simply a nuget package that contains a file in build/dependencies.props.
+ Just like the version of the file in this local repo, this file is an MSBuild project file
+ with a list of MSBuild variables. Example:
+
+
+
+ 1.0.0
+
+
+";
+
+ _sourceOpt = application.Option("-s|--source