public void Execute(IProcessingContext context) { var arguments = context.Get <ApplicationArguments>(); var information = (AssemblyInformation)context.GetService(typeof(AssemblyInformation)); var profile = context.GetService(typeof(BuildProfile)) as BuildProfile ?? new DefaultBuildProfile(); writer.WriteLine($"{GetType().Name} has been executed with the following information:"); writer.WriteLine($@"Processor File / Input File: ""{arguments.ProcessorFile}"" / ""{arguments.InputFile}"""); writer.WriteLine($"Application Name: {information.Name}"); writer.WriteLine($"Application Version: {information.Version}"); writer.WriteLine($"Application Author: {information.Author}"); writer.WriteLine(string.Empty); writer.WriteLine("Requested Files to Build:"); foreach (var file in profile.Files) { writer.WriteLine($"- {file.Path}"); } writer.WriteLine(string.Empty); writer.WriteLine(string.Empty); writer.WriteLine("Thank you for building and exploring this sample. Further steps could include:"); writer.WriteLine("1. Serialize build profile, application information, and other services as XML."); writer.WriteLine("2. Execute XSLT against XML from above to generate a traditional .csproj file, save result to a temp directory."); writer.WriteLine("3. Launch msbuild.exe and point it to .csproj from above."); writer.WriteLine(string.Empty); }
public void Execute(IProcessingContext context) { var arguments = context.Get <ApplicationArguments>(); // Set the current directory to the processor file (temporary adjustment to get files to only load in specified folder and ignore others): var fullName = new FileInfo(arguments.ProcessorFile).Directory.FullName; Directory.SetCurrentDirectory(fullName); writer.WriteLine($"Assigned Current Directory to: {fullName}"); }