Esempio n. 1
0
        /// <summary>
        /// Makes production build and optionally runs its output
        /// </summary>
        private void ProductionBuild(Boolean run)
        {
            // make sure the COLT project is open
            String path = FindAndOpen(false);

            if (path != null)
            {
                try
                {
                    JsonRpcClient client = new JsonRpcClient(path);
                    client.PingOrRunCOLT(settingObject.Executable);

                    // leverage FD launch mechanism
                    if (run)
                    {
                        client.InvokeAsync("runProductionCompilation", RunAfterProductionBuild, new Object[] { settingObject.SecurityToken, /*run*/ false });
                    }
                    else
                    {
                        client.InvokeAsync("runProductionCompilation", HandleAuthenticationExceptions, new Object[] { settingObject.SecurityToken, /*run*/ false });
                    }
                }
                catch (Exception details)
                {
                    HandleAuthenticationExceptions(details);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Exports the project to COLT and optionally runs live session
        /// </summary>
        private void ExportAndOpen(Boolean run)
        {
            // Create COLT subfolder if does not exist yet
            // While at that, start listening for colt/compile_errors.log changes
            WatchErrorsLog(true);

            // Create COLT project in it
            COLTRemoteProject project = ExportCOLTProject();

            if (project != null)
            {
                try
                {
                    // Export the project as xml file
                    project.Save();

                    // Optionally run base compilation
                    if (run)
                    {
                        JsonRpcClient client = new JsonRpcClient(project.path);
                        client.PingOrRunCOLT(settingObject.Executable);
                        client.InvokeAsync("runBaseCompilation", HandleAuthenticationExceptions, new Object[] { settingObject.SecurityToken });
                    }

                    // Enable "open" button
                    toolbarButton2.Enabled = true;

                    // Remove older *.colt files
                    foreach (String oldFile in Directory.GetFiles(Path.GetDirectoryName(project.path), "*.colt"))
                    {
                        if (!project.path.Contains(Path.GetFileName(oldFile)))
                        {
                            File.Delete(oldFile);
                        }
                    }
                }
                catch (Exception details)
                {
                    HandleAuthenticationExceptions(details);
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Opens the project in COLT and optionally runs live session
        /// </summary>
        private String FindAndOpen(Boolean run)
        {
            // Create COLT subfolder if does not exist yet
            // While at that, start listening for colt/compile_errors.log changes
            WatchErrorsLog(true);

            // Find COLT project to open
            String coltFileName = GetCOLTFile();

            // Open it
            if (coltFileName != null)
            {
                try
                {
                    if (run)
                    {
                        JsonRpcClient client = new JsonRpcClient(coltFileName);
                        client.PingOrRunCOLT(settingObject.Executable);
                        client.InvokeAsync("runBaseCompilation", HandleAuthenticationExceptions, new Object[] { settingObject.SecurityToken });
                    }

                    return(coltFileName);
                }
                catch (Exception details)
                {
                    HandleAuthenticationExceptions(details);
                    return(null);
                }
            }

            else
            {
                toolbarButton2.Enabled = false;
                return(null);
            }
        }