From 43dfa6b8baa7d7fca6792f0fbe8ae363197cd9dc Mon Sep 17 00:00:00 2001 From: Livar Date: Thu, 10 Nov 2016 18:24:35 -0800 Subject: [PATCH] Updating script migration to use the correct BeforeTargets. (#4680) --- .../Rules/MigrateScriptsRule.cs | 4 ++-- .../Rules/GivenThatIWantToMigrateScripts.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs index 1312c5d89..aa4092e28 100644 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs +++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs @@ -115,9 +115,9 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules // ProjectJson Script Set Name to private static Dictionary ScriptSetToMSBuildHookTargetMap => new Dictionary() { - { "precompile", new TargetHookInfo(true, "Build") }, + { "precompile", new TargetHookInfo(true, "BeforeBuild") }, { "postcompile", new TargetHookInfo(false, "Build") }, - { "prepublish", new TargetHookInfo(true, "Publish") }, + { "prepublish", new TargetHookInfo(true, "PrepareForPublish") }, { "postpublish", new TargetHookInfo(false, "Publish") } }; diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateScripts.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateScripts.cs index 9ce1af119..c19e187e1 100644 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateScripts.cs +++ b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateScripts.cs @@ -53,8 +53,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests } [Theory] - [InlineData("precompile", "Build")] - [InlineData("prepublish", "Publish")] + [InlineData("precompile", "BeforeBuild")] + [InlineData("prepublish", "PrepareForPublish")] public void Migrating_pre_scripts_populates_BeforeTargets_with_appropriate_target(string scriptName, string targetName) { var scriptMigrationRule = new MigrateScriptsRule();