Exemplo n.º 1
0
        public Task OnExecute(CommandLineApplication app)
        {
            app.ShowVersion();
            Console.WriteLine(Environment.NewLine);
            PrintChoicesMade();
            Out.Dump($"Performing DLL discovery...");
            DllDiscovery.LoadDllFiles(InputFolder);


            var eventType = DllDiscovery.FindEventTypeInDlls();

            if (!eventType.Found)
            {
                Out.Fail("No event types found. Is this a Dolittle project output folder?");
                return(Task.CompletedTask);
            }

            DllDiscovery.FindAllEvents();
            DllDiscovery.MapEventsToEventHandlers();

            if (!IgnoreEvents)
            {
                DllDiscovery.ReportIssues();
            }

            DllDiscovery.WriteOutputFiles(OutputFolder, PreferJson);
            Out.Dump("Event mapping completed", overline: true);

            return(Task.CompletedTask);
        }
Exemplo n.º 2
0
        private void PrintChoicesMade()
        {
            Out.Dump(PreferJson ? "Output type  : JSON" : "Output type  : CSV");
            if (string.IsNullOrEmpty(InputFolder))
            {
                Out.Dump("Input Folder : Current Directory");
            }
            else
            {
                Out.Dump($"Input Folder : {InputFolder}");
            }

            if (string.IsNullOrEmpty(OutputFolder))
            {
                Out.Dump("Output folder: Current Directory");
            }
            else
            {
                Out.Dump($"Output folder: {OutputFolder}", underline: true);
            }
        }
Exemplo n.º 3
0
 /// Dump object to the output stream, treating the object as the object of the specified type, preceded by name=
 public void Dump(object o, Type type, string name)
 {
     Out.Dump(o, type, name);
 }
Exemplo n.º 4
0
 /// Dump object to the output stream, treating the object as the object of the specified type
 public void Dump(object o, Type type)
 {
     Out.Dump(o, type, string.Empty);
 }
Exemplo n.º 5
0
 /// Dump object to the output stream, preceded by name=
 public void Dump(object o, string name)
 {
     Out.Dump(o, name);
 }
Exemplo n.º 6
0
 /// Dump object to the output stream
 public void Dump(object o)
 {
     Out.Dump(o);
 }