private ProjectTargetElement CreateTarget(ProjectRootElement csproj, string scriptSetName)
        {
            var targetName = $"{scriptSetName[0].ToString().ToUpper()}{string.Concat(scriptSetName.Skip(1))}Script";

            TargetHookInfo targetHookInfo;

            if (!ScriptSetToMSBuildHookTargetMap.TryGetValue(scriptSetName, out targetHookInfo))
            {
                MigrationErrorCodes.MIGRATE1019(
                    $"{scriptSetName} is an unsupported script event hook for project migration")
                .Throw();
            }

            var target = csproj.CreateTargetElement(targetName);

            csproj.InsertBeforeChild(target, csproj.LastChild);
            if (targetHookInfo.IsRunBefore)
            {
                target.BeforeTargets = targetHookInfo.TargetName;
            }
            else
            {
                target.AfterTargets = targetHookInfo.TargetName;
            }

            // Run Scripts After each inner build
            target.Condition = " '$(IsCrossTargetingBuild)' != 'true' ";

            return(target);
        }
        private ProjectTargetElement CreateTarget(ProjectRootElement csproj, string scriptSetName, bool isMultiTFM)
        {
            var targetName = $"{scriptSetName[0].ToString().ToUpper()}{string.Concat(scriptSetName.Skip(1))}Script";

            TargetHookInfo targetHookInfo;

            if (!ScriptSetToMSBuildHookTargetMap.TryGetValue(scriptSetName, out targetHookInfo))
            {
                MigrationErrorCodes.MIGRATE1019(
                    String.Format(LocalizableStrings.MIGRATE1019Arg, scriptSetName))
                .Throw();
            }

            var target = csproj.CreateTargetElement(targetName);

            csproj.InsertBeforeChild(target, csproj.LastChild);
            if (targetHookInfo.IsRunBefore)
            {
                target.BeforeTargets = targetHookInfo.TargetName;
            }
            else
            {
                target.AfterTargets = targetHookInfo.TargetName;
            }

            if (isMultiTFM)
            {
                ConditionTargetToRunScriptsAfterEachInnerBuild(target);
            }

            return(target);
        }