コード例 #1
0
        public void GetMatchingFiles_ReturnsEmpty_IfNoMatches()
        {
            var patternA = "a.*";
            var patternB = "b.*";

            var files = context.GetFiles(patternA, patternB);

            files.Should().NotBeEmpty();
        }
コード例 #2
0
ファイル: VersionService.cs プロジェクト: devlead/Aero
        /// <summary>
        /// Goes thru CsProj files and if they have a AssemblyVersion attribute, updates it
        /// </summary>
        /// <remarks>Keeping version as a parameter instead of looking for the version argument as this is
        /// something that could be pulled out into a NuGet package at some point</remarks>
        public void UpdateFiles(string version, string projectPath, params string[] excludeProjectsNamed)
        {
            //We'll keep this around for dealing with Azure Functions as I think that has to be Full Framework
            //var assemblyInfoFiles = context.GetFiles($"{context.ProjectsPath}/**/properties/AssemblyInfo.cs");

            var csprojFiles = CakeContext.GetFiles($"{projectPath}/**/*.csproj");
            var excludeProjectsNamedLower = excludeProjectsNamed.Select(x => x.ToLowerInvariant()).ToArray();

            foreach (var f in csprojFiles)
            {
                if (!excludeProjectsNamedLower.Contains(f.GetFilenameWithoutExtension().FullPath.ToLowerInvariant()))
                {
                    UpdateCsProjFile(f, version);
                }
            }
        }