Beispiel #1
0
        public void IgnoreOutdatedBuildCakePendingChangesAndDoNotPush(Assembly assembly, ITestTargetFolder targetFolder, IErrorsAndInfos errorsAndInfos)
        {
            var cakeScript = vEmbeddedCakeScriptReader.ReadCakeScriptFromAssembly(assembly, BuildCake.Standard, errorsAndInfos);

            if (errorsAndInfos.AnyErrors())
            {
                return;
            }

            var cakeScriptFileFullName = targetFolder.Folder().FullName + @"\" + BuildCake.Standard;

            File.WriteAllText(cakeScriptFileFullName, cakeScript);

            RunBuildCakeScript(BuildCake.Standard, targetFolder, "IgnoreOutdatedBuildCakePendingChangesAndDoNotPush", errorsAndInfos);
        }
        public void CopyCakeScriptEmbeddedInAssembly(Assembly assembly, string buildCakeName, ITestTargetFolder testTargetFolder, IErrorsAndInfos errorsAndInfos)
        {
            var embeddedCakeScript = vEmbeddedCakeScriptReader.ReadCakeScriptFromAssembly(assembly, buildCakeName, errorsAndInfos);

            if (errorsAndInfos.AnyErrors())
            {
                return;
            }
            if (embeddedCakeScript.Length < 120 || !embeddedCakeScript.Contains("#load \"solution.cake\""))
            {
                errorsAndInfos.Errors.Add(string.Format(Properties.Resources.CouldNotLoadEmbeddedBuildCake, buildCakeName, assembly.FullName));
                return;
            }

            var currentScriptFileName = testTargetFolder.FullName() + @"\" + buildCakeName;

            if (File.Exists(currentScriptFileName))
            {
                var currentScript = File.ReadAllText(currentScriptFileName);
                if (Regex.Replace(embeddedCakeScript, @"\s", "") == Regex.Replace(currentScript, @"\s", ""))
                {
                    return;
                }
            }

            File.WriteAllText(currentScriptFileName, embeddedCakeScript);
        }
Beispiel #3
0
        public void RunBuildCakeScript(string buildCakeName, ITestTargetFolder testTargetFolder, string target, IErrorsAndInfos errorsAndInfos)
        {
            var scriptFileFullName = testTargetFolder.FullName() + @"\" + buildCakeName;

            vCakeRunner.CallCake(scriptFileFullName, target, errorsAndInfos);
        }