Ejemplo n.º 1
0
 /// <summary>
 /// Sets the configuration.
 /// </summary>
 /// <param name="settings">The settings.</param>
 /// <param name="configuration">The configuration.</param>
 /// <returns>The same <see cref="XBuildSettings"/> instance so that multiple calls can be chained.</returns>
 public static XBuildSettings SetConfiguration(this XBuildSettings settings, string configuration)
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     settings.Configuration = configuration;
     return(settings);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets the build log verbosity.
 /// </summary>
 /// <param name="settings">The settings.</param>
 /// <param name="verbosity">The build log verbosity.</param>
 /// <returns>The same <see cref="XBuildSettings"/> instance so that multiple calls can be chained.</returns>
 public static XBuildSettings SetVerbosity(this XBuildSettings settings, Verbosity verbosity)
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     settings.Verbosity = verbosity;
     return(settings);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Sets the tool version.
 /// </summary>
 /// <param name="settings">The settings.</param>
 /// <param name="version">The version.</param>
 /// <returns>The same <see cref="XBuildSettings"/> instance so that multiple calls can be chained.</returns>
 public static XBuildSettings UseToolVersion(this XBuildSettings settings, XBuildToolVersion version)
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     settings.ToolVersion = version;
     return(settings);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Adds a XBuild target to the configuration.
 /// </summary>
 /// <param name="settings">The settings.</param>
 /// <param name="target">The XBuild target.</param>
 /// <returns>The same <see cref="XBuildSettings"/> instance so that multiple calls can be chained.</returns>
 public static XBuildSettings WithTarget(this XBuildSettings settings, string target)
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     settings.Targets.Add(target);
     return(settings);
 }
Ejemplo n.º 5
0
        public static void XBuild(this ICakeContext context, FilePath solution, XBuildSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            var runner = new XBuildRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Globber);

            runner.Run(solution, settings);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Adds a property to the configuration.
        /// </summary>
        /// <param name="settings">The settings.</param>
        /// <param name="name">The property name.</param>
        /// <param name="values">The property values.</param>
        /// <returns>The same <see cref="XBuildSettings"/> instance so that multiple calls can be chained.</returns>
        public static XBuildSettings WithProperty(this XBuildSettings settings, string name, params string[] values)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            IList <string> currentValue;

            currentValue = new List <string>(
                settings.Properties.TryGetValue(name, out currentValue) && currentValue != null
                    ? currentValue.Concat(values)
                    : values);

            settings.Properties[name] = currentValue;

            return(settings);
        }
Ejemplo n.º 7
0
        public static void XBuild(this ICakeContext context, FilePath solution, Action <XBuildSettings> configurator)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (configurator == null)
            {
                throw new ArgumentNullException("configurator");
            }

            var settings = new XBuildSettings();

            configurator(settings);

            // Perform the build.
            XBuild(context, solution, settings);
        }