Esempio n. 1
0
        public static object GetTargets(IParameters parameters)
        {
            var git = new GitCheckout {
                Repository = @"C:\Users\Public\Documents\Development\BigSolution.git",
                Directory = "one"
            };
            var solution = new VisualStudioSolution {
                SolutionPath = git.Files["BigSolution.sln"]
            };
            var webProject = solution.Projects[parameters.Default("proj", "BigSolution")];
            var serviceName = parameters.Default("svc", "BigWindowsService");
            var service = solution.Projects[serviceName];

            return new {
                WebSite = new Iis7WebSite {
                    Directory = webProject.ProjectDirectory,
                    Name = "BigWebSite",
                    Port = 5001
                },
                Tests = new NUnitTests {
                    DllPaths = solution.Projects.Select(p => p.OutputFile)
                },
                Service = new WindowsService {
                    BinaryPath = service.OutputFile,
                    Name = serviceName,
                    DisplayName = "Big Windows Service",
                    Description = "a big windows service demonstrating the bounce build framework"
                },
                Zip = new ZipFile {
                    Directory = webProject.WhenBuilt(() => Path.GetDirectoryName(webProject.OutputFile.Value)),
                    ZipFileName = "web.zip"
                },
            };
        }
Esempio n. 2
0
        public static object RealTargets(IParameters buildParameters)
        {
            var version = buildParameters.Required<string>("version");

            var git = new GitCheckout {
                Repository = "git://github.com/refractalize/bounce.git",
                Directory = "tmp2",
            };
            var solution = new VisualStudioSolution {
                SolutionPath = "Bounce.sln",
            };
            var frameworkProject = solution.Projects["Bounce.Framework"];

            var downloadsDir = new CleanDirectory {
                Path = "Downloads",
            };

            var frameworkZip = new ZipFile {
                Directory = frameworkProject.WhenBuilt(() => Path.GetDirectoryName(frameworkProject.OutputFile.Value)),
                ZipFileName = downloadsDir.Files[version.WhenBuilt(() => string.Format("Bounce.Framework.{0}.zip", version.Value))],
            };

            var downloads = new All(frameworkZip, new GitTag {Directory = ".", Tag = version.WhenBuilt(() => "v" + version.Value)});

            return new {
                Tests = new NUnitTests {
                    DllPaths = solution.Projects.Select(p => p.OutputFile),
                },
                Downloads = downloads,
            };
        }
Esempio n. 3
0
 public RunTestsTask(bool isRunTests, string buildDirectory, string nUnitConsole, string framework, VisualStudioSolution solution)
 {
     _isRunTests = isRunTests;
     _buildDirectory = buildDirectory;
     _nUnitConsole = nUnitConsole;
     _framework = framework;
     _solution = solution;
 }
Esempio n. 4
0
        public static object Targets(IParameters parameters)
        {
            var v4 = new VisualStudioSolution {SolutionPath = @"Bounce.sln", Configuration = "Debug"};
            var v35 = new VisualStudioSolution {SolutionPath = @"Bounce.sln", Configuration = "Debug_3_5" };

            var v4Tests = new NUnitTests
            {
                DllPaths = v4.Projects.Where(p => p.Name.EndsWith("Tests")).Select(p => p.OutputFile),
                NUnitConsolePath = @"References\NUnit\nunit-console.exe"
            };

            var v35Tests = new NUnitTests
            {
                DllPaths = v35.Projects.Where(p => p.Name.EndsWith("Tests")).Select(p => p.OutputFile),
                NUnitConsolePath = @"References\NUnit\nunit-console.exe"
            };

            Task<IEnumerable<string>> dests = new [] {"sdf"};
            dests.SelectTasks(dest => new Copy {ToPath = dest});

            const string nugetExe = @"References\NuGet\NuGet.exe";
            var nugetPackage = new NuGetPackage
            {
                NuGetExePath = nugetExe,
                Spec = v4.Projects["Bounce.Framework"].ProjectFile.WithDependencyOn(v4Tests, v35Tests, v35),
            };

            var nugetPush = new NuGetPush
            {
                ApiKey = EnvironmentVariables.Required<string>("NUGET_API_KEY"),
                NuGetExePath = nugetExe,
                Package = nugetPackage.Package,
            };

            return new
            {
                Net4Binaries = v4,
                Net35Binaries = v35,
                Net4Tests = v4Tests,
                Net35Tests = v35Tests,
                Binaries = new All(v4, v35),
                Tests = new All(v4Tests, v35Tests),
                NuGet = nugetPush,
                NuGetPackage = nugetPackage,
            };
        }
Esempio n. 5
0
        public static object Targets(IParameters parameters)
        {
            var solution = new VisualStudioSolution {
                SolutionPath = "WebSolution.sln",
            };
            var webProject = solution.Projects["WebSite"];

            return new {
                WebSite = new Iis7WebSite {
                    Directory = webProject.ProjectDirectory,
                    Name = "My Website",
                    Port = parameters.Default("port", 5001),
                },
                Tests = new NUnitTests {
                    DllPaths = solution.Projects.Select(p => p.OutputFile),
                },
            };
        }
Esempio n. 6
0
        public static object GetTargets(IParameters parameters)
        {
            var stage = parameters.Default("stage", "packageDeploy");

            var solution = new VisualStudioSolution {SolutionPath = "Solution.sln"};

            var machines = new[] {
            new DeployMachine {
                LocalPath = @"c:\Deployments",
                Machine = "liveserver1",
                RemotePath = @"\\liveserver1\Deployments"
            },
            new DeployMachine {
                LocalPath = @"c:\Deployments",
                Machine = "liveserver2",
                RemotePath = @"\\liveserver2\Deployments"
            }
            };

            var targets = new StagedDeployTargetBuilder(stage);
            var website = targets.CreateTarget("WebSite");

            website.Package = new Copy {
            FromPath = solution.Projects["WebSite"].ProjectDirectory,
            ToPath = new CleanDirectory {Path = "package"}.Path.SubPath("WebSite")
            }.ToPath;

            website.InvokeRemoteDeploy = website.CopyToAndInvokeOnMachines(machines, new SubBounceFactory());

            website.Deploy = package => new Iis7WebSite {
            Directory = new Copy {
                FromPath = package.SubPath("WebSite"),
                ToPath = @"C:\Sites\WebSite"
            }.ToPath,
            Name = "WebSite"
            };

            return targets.Targets;
        }
Esempio n. 7
0
 public VisualStudioProject(VisualStudioSolution solution, Val<string> name)
 {
     Solution = solution;
     Name = name;
 }