Example #1
0
        public static string BuildExampleCommandLine(BuildEventType type)
        {
            var builder = new StringBuilder();

            //We will use forward slashes for the path here in order support build on Linix (They still work on Windows in this case)
            builder.Append($@"dotnet run -c Run --project ""$(ProjectDir.Replace('\', '/').TrimEnd('/'))/../{ProjectPathRelativeToSolution.Replace('\\', '/').TrimStart('/')}""");

            builder.Append($" ---BuildEventType {type}");

            foreach ((string parameter, _) in BuildEventParameters.ParameterDefinitions)
            {
                if (parameter == "BuildEventType")
                {
                    continue;
                }

                string passedParameter;
                if (parameter.ToLower().Contains("dir") || parameter.ToLower().Contains("path"))
                {
                    passedParameter = $"$({parameter}.TrimEnd('\\'))";
                }
                else
                {
                    passedParameter = $"$({parameter})";
                }

                builder.Append($@" ---{parameter} ""{passedParameter}""");
            }

            string commandLine = builder.ToString().Trim();

            return(commandLine);
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of <see cref="BuildEvent"/>.
 /// </summary>
 /// <param name="type">The <see cref="BuildEventType"/> of the event.</param>
 /// <param name="importance">The <see cref="BuildEventImportance"/> of the event.</param>
 /// <param name="message">The text message that describes the event.</param>
 public BuildEvent(BuildEventType type, BuildEventImportance importance, string message)
 {
     Type = type;
     Importance = importance;
     Message = message;
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of <see cref="BuildEvent"/>.
 /// </summary>
 /// <param name="type">The <see cref="BuildEventType"/> of the event.</param>
 /// <param name="importance">The <see cref="BuildEventImportance"/> of the event.</param>
 /// <param name="message">The text message that describes the event.</param>
 public BuildEvent(BuildEventType type, BuildEventImportance importance, string message)
 {
     Type       = type;
     Importance = importance;
     Message    = message;
 }
Example #4
0
 public BuildEventArgs(BuildEventType eventType, string message)
 {
     this.EventType = eventType;
     this.Message   = message;
 }