Exemplo n.º 1
0
        public async Task RunAsync(CancellationToken token)
        {
            Context.Output.WriteLine("Building Solution...", ConsoleColor.White);

            var msbuild = new MSBuildCommand(Context)
            {
                Exe = ".\\bin\\msbuild.cmd",
                WorkingDirectory = Context.ContentDirectory,
            };

            var buildArgs = new MSBuildArguments {
                ProjectFile = "Photon.Sample.sln",
                Targets     = { "Rebuild" },
                Properties  =
                {
                    ["Configuration"]       = "Debug",
                    ["Platform"]            = "Any CPU",
                    ["DeployOnBuild"]       = "True",
                    ["PublishUrl"]          = "Publish",
                    ["DeployDefaultTarget"] = "WebPublish",
                    ["DeleteExistingFiles"] = "True",
                    ["WebPublishMethod"]    = "FileSystem",
                },
                Logger =
                {
                    ConsoleLoggerParameters = MSBuildConsoleLoggerParameters.ErrorsOnly
                                              | MSBuildConsoleLoggerParameters.Summary,
                },
                Verbosity   = MSBuildVerbosityLevels.Minimal,
                MaxCpuCount = 0,
            };

            await msbuild.RunAsync(buildArgs, token);

            packageVersion = Context.BuildNumber.ToString();
            var packagePath = Path.Combine(Context.BinDirectory, "Packages");

            appPackages = new ApplicationPackageUtility(Context)
            {
                PackageDirectory = packagePath,
            };

            projectPackages = new ProjectPackageUtility(Context)
            {
                PackageDirectory = packagePath,
            };

            await Task.WhenAll(
                CreateProjectPackage(token),
                CreateWebApplicationPackage(token),
                CreateServiceApplicationPackage(token));

            using (var block = Context.Output.WriteBlock()) {
                block.Write("Build Number: ", ConsoleColor.DarkBlue);
                block.WriteLine(Context.BuildNumber, ConsoleColor.Blue);
            }
        }
Exemplo n.º 2
0
        public async Task RunAsync(CancellationToken token)
        {
            await BuildSolution();

            var d = DateTime.Now;

            packageVersion   = $"{d.Year}.{d.Month}.{d.Day}.{Context.BuildNumber}";
            packageDirectory = Path.Combine(Context.ContentDirectory, "packages");

            appPackages = new ApplicationPackageUtility(Context)
            {
                PackageDirectory = packageDirectory,
            };

            await Task.WhenAll(
                PackageProject(token),
                PackageServer(token),
                PackageAgent(token));
        }