Exemple #1
0
        static int RunClean(CleanOptions options)
        {
            var solution = LoadSolution(options);

            var gccSettings = new ToolchainSettings();
            gccSettings.ToolChainLocation = @"c:\vestudio\appdata\repos\GCCToolchain\bin";
            gccSettings.IncludePaths.Add("arm-none-eabi\\include\\c++\\4.9.3");
            gccSettings.IncludePaths.Add("arm-none-eabi\\include\\c++\\4.9.3\\arm-none-eabi\\thumb");
            gccSettings.IncludePaths.Add("lib\\gcc\\arm-none-eabi\\4.9.3\\include");

            var toolchain = new GccToolChain(gccSettings);

            var console = new ProgramConsole();

            var project = FindProject(solution, options.Project);

            if (project != null)
            {
                toolchain.Clean(console, project).Wait();
            }
            else
            {
                console.WriteLine("Nothing to clean.");
            }

            return 1;
        }
Exemple #2
0
        static int RunBuild(BuildOptions options)
        {
            var solution = LoadSolution(options);
            var project = FindProject(solution, options.Project);

            var gccSettings = new ToolchainSettings();
            gccSettings.ToolChainLocation = @"c:\vestudio\appdata\repos\GCCToolchain\bin";
            gccSettings.IncludePaths.Add("arm-none-eabi\\include\\c++\\4.9.3");
            gccSettings.IncludePaths.Add("arm-none-eabi\\include\\c++\\4.9.3\\arm-none-eabi\\thumb");
            gccSettings.IncludePaths.Add("lib\\gcc\\arm-none-eabi\\4.9.3\\include");

            var toolchain = new GccToolChain(gccSettings);

            toolchain.Jobs = options.Jobs;
            var console = new ProgramConsole();

            if (project != null)
            {
                var stopWatch = new System.Diagnostics.Stopwatch();
                stopWatch.Start();

                try {
                    project.ResolveReferences(console);
                }
                catch (Exception e)
                {
                    console.WriteLine(e.Message);
                }

                var awaiter = toolchain.Build(console, project);
                awaiter.Wait();

                stopWatch.Stop();
                console.WriteLine(stopWatch.Elapsed.ToString());
            }
            else
            {
                console.WriteLine("Nothing to build.");
            }

            return 1;
        }