Пример #1
0
        internal static async Task <int> Main(string[] args)
        {
            MiniDump.DumpMessage += MiniDump_DumpMessage;
            _ = Assembly.GetEntryAssembly().EntryPoint.GetCustomAttributes <MiniDumpAttribute>(false);
            GitInformation.ApplyAssemblyAttributes(typeof(Program).Assembly);
            var cmd = new RootCommand
            {
                new Option("--version", "Shows the version of this command-line program."),
                new Command("build", "builds a changelog or news file from any *.master file in the current or sub directory.")
                {
                }.WithHandler(nameof(BuildCommandHandler)),
                new Command("new", string.Empty)
                {
                    new Command("release", "Creates a new pending release folder and imports it in the *.master file in the current or sub directory.")
                    {
                        new Argument <string>("release", "The new release version."),
                    }.WithHandler(nameof(NewReleaseCommandHandler)),
                    new Command("entry", "Creates a new entry file for the current pending release.")
                    {
                        new Argument <string>("content", "The content to add to the new entry."),
                    }.WithHandler(nameof(NewEntryCommandHandler)),
                },
                new Command("finalize", string.Empty)
                {
                    new Command("release", "Finalizes a pending release to a section file.")
                    {
                    }.WithHandler(nameof(FinalizeReleaseCommandHandler)),
                },
            }.WithHandler(nameof(GlobalCommandHandler));

            return(await cmd.InvokeAsync(args));
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GitInformationAttribute"/> class.
        /// </summary>
        /// <param name="headdesc">
        /// The head description of the git repository to the assembly.
        /// </param>
        /// <param name="commit">
        /// The commit to the git repository to the assembly.
        /// </param>
        /// <param name="branchname">
        /// The branch name to the git repository to the assembly.
        /// </param>
        /// <param name="assemblyType">
        /// The <see langword="type"/> of the <see langword="assembly"/> <see langword="this"/> attribute <see langword="is"/> applied to.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// Thrown when <paramref name="assemblyType"/> is <see langword="null"/>.
        /// </exception>
        public GitInformationAttribute(string headdesc, string commit, string branchname, Type assemblyType /*object assembly*/)
        {
            if (assemblyType == null)
            {
                throw new ArgumentNullException(nameof(assemblyType));
            }

            GitInformation.ApplyAssemblyAttributes(typeof(GitInformation).Assembly);
            _ = new GitInformation(headdesc, commit, branchname, assemblyType.Assembly);
        }
Пример #3
0
        internal static int Main(string[] args)
        {
            MiniDump.DumpMessage += MiniDump_DumpMessage;

            // MiniDump.DumpFailed += MiniDump_DumpFailed;
            GitInformation.ApplyAssemblyAttributes(typeof(Els_kom_Main).Assembly);

            // _ = Assembly.GetEntryAssembly().GetCustomAttributes(false);
            KOMManager.MessageEvent        += KOMManager_MessageEvent;
            PluginUpdateCheck.MessageEvent += PluginUpdateCheck_MessageEvent;

            // have to pass in string to this as otherwise it will not compile.
            GenericPluginLoader <string> .PluginLoaderMessage += GenericPluginLoader_PluginLoaderMessage;

            // execute our attribute.
            // uncomment if the attribute is on the assembly:
            // Assembly.GetEntryAssembly().GetCustomAttributes(false);
            // or:
            // typeof(TheClassWithTheAttribute).Assembly.GetCustomAttributes(false);
            // uncomment if the attribute is on the class:
            // Assembly.GetEntryAssembly().EntryPoint.ReflectedType.GetCustomAttributes(false);
            // or:
            // typeof(TheClassWithTheAttribute).GetCustomAttributes(false);
            // uncomment if you want the attribute on the class:
            // Assembly.GetEntryAssembly().EntryPoint.GetCustomAttributes(false);
            // or:
            // typeof(TheClassWithTheAttribute).GetMethod(nameof(Main), System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static)?.GetCustomAttributes(false);
            if ((args.Length - 1) > -1)
            {
                ReleasePackaging.PackageRelease(args);
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                using (var mainForm = new MainForm())
                {
                    Application.Run(mainForm);
                }
            }

            return(0);
        }
Пример #4
0
        internal static int Main(string[] args)
        {
            MiniDump.DumpMessage += MiniDump_DumpMessage;
            GitInformation.ApplyAssemblyAttributes(typeof(Els_kom_Main).Assembly);
            KOMManager.MessageEvent        += KOMManager_MessageEvent;
            PluginUpdateCheck.MessageEvent += PluginUpdateCheck_MessageEvent;

            // have to pass in string to this as otherwise it will not compile.
            GenericPluginLoader <string> .PluginLoaderMessage += GenericPluginLoader_PluginLoaderMessage;
            if ((args.Length - 1) > -1)
            {
                ReleasePackaging.PackageRelease(args);
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                using var mainForm = new MainForm();
                Application.Run(mainForm);
            }

            return(0);
        }