Esempio n. 1
0
        public override void RunBuild(FilePath solution)
        {
            if (!BuildsOnCurrentPlatform)
            {
                CakeContext.Information("Solution is not configured to build on this platform: {0}", SolutionPath);
                return;
            }

            CakeContext.MSBuild(solution, c => {
                c.Configuration   = Configuration;
                c.MSBuildPlatform = MSBuildPlatform;

                if (!string.IsNullOrEmpty(Platform))
                {
                    c.Properties["Platform"] = new[] { Platform }
                }
                ;

                if (Targets != null && Targets.Any())
                {
                    foreach (var t in Targets)
                    {
                        c.Targets.Add(t);
                    }
                }

                if (Properties != null && Properties.Any())
                {
                    foreach (var kvp in Properties)
                    {
                        c.Properties.Add(kvp.Key, kvp.Value);
                    }
                }
            });
        }
Esempio n. 2
0
        public virtual void RunBuild(FilePath solution)
        {
            if (CakeContext.IsRunningOnWindows() || AlwaysUseMSBuild)
            {
                CakeContext.MSBuild(solution, c =>
                {
                    if (CakeContext.GetOperatingSystem() == PlatformFamily.OSX)
                    {
                        c.ToolPath = "/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild";
                    }

                    // Override tool path completely if it's specified explicitly
                    if (MSBuildToolPath != null)
                    {
                        c.ToolPath = MSBuildToolPath;
                    }

                    if (Verbosity.HasValue)
                    {
                        c.Verbosity = Verbosity.Value;
                    }

                    if (MaxCpuCount.HasValue)
                    {
                        c.MaxCpuCount = MaxCpuCount.Value;
                    }
                    c.Configuration = Configuration;
                    if (!string.IsNullOrEmpty(Platform))
                    {
                        c.Properties["Platform"] = new[] { Platform }
                    }
                    ;
                    if (Targets != null && Targets.Any())
                    {
                        foreach (var t in Targets)
                        {
                            c.Targets.Add(t);
                        }
                    }
                    if (Properties != null && Properties.Any())
                    {
                        foreach (var kvp in Properties)
                        {
                            c.Properties.Add(kvp.Key, kvp.Value);
                        }
                    }
                });
            }
            else
            {
                CakeContext.DotNetBuild(solution, c =>
                {
                    if (Verbosity.HasValue)
                    {
                        c.Verbosity = Verbosity.Value;
                    }

                    c.Configuration = Configuration;
                    if (!string.IsNullOrEmpty(Platform))
                    {
                        c.Properties["Platform"] = new[] { Platform }
                    }
                    ;
                    if (Targets != null && Targets.Any())
                    {
                        foreach (var t in Targets)
                        {
                            c.Targets.Add(t);
                        }
                    }
                    if (Properties != null && Properties.Any())
                    {
                        foreach (var kvp in Properties)
                        {
                            c.Properties.Add(kvp.Key, kvp.Value);
                        }
                    }
                });
            }
        }