void launchServer()
    {
        DBG ("Client: Launching Server...");

        auto pipeName = "ipc_" + String::toHexString (Random().nextInt64());
        auto command = createCommandLineForLaunchingServer (pipeName, owner.project.getProjectUIDString(),
                                                            getCacheLocationForProject (owner.project));

       #if RUN_CLANG_IN_CHILD_PROCESS
        if (! childProcess.start (command))
            jassertfalse;
       #else
        server = createClangServer (command);
       #endif

        if (connectToPipe (pipeName, 10000))
            MessageTypes::sendPing (*this);
        else
            jassertfalse;

        startTimer (serverKeepAliveTimeout);
    }
Beispiel #2
0
void ProjucerApplication::initialise (const String& commandLine)
{
    if (commandLine.trimStart().startsWith ("--server"))
    {
        initialiseLogger ("Compiler_Log_");
        LookAndFeel::setDefaultLookAndFeel (&lookAndFeel);

       #if JUCE_MAC
        Process::setDockIconVisible (false);
       #endif

        server = createClangServer (commandLine);
    }
    else
    {
        initialiseLogger ("IDE_Log_");
        Logger::writeToLog (SystemStats::getOperatingSystemName());
        Logger::writeToLog ("CPU: " + String (SystemStats::getCpuSpeedInMegaherz())
                              + "MHz  Cores: " + String (SystemStats::getNumCpus())
                              + "  " + String (SystemStats::getMemorySizeInMegabytes()) + "MB");

        initialiseBasics();

        if (commandLine.isNotEmpty())
        {
            isRunningCommandLine = true;
            const int appReturnCode = performCommandLine (commandLine);

            if (appReturnCode != commandLineNotPerformed)
            {
                setApplicationReturnValue (appReturnCode);
                quit();
                return;
            }

            isRunningCommandLine = false;
        }

        if (sendCommandLineToPreexistingInstance())
        {
            DBG ("Another instance is running - quitting...");
            quit();
            return;
        }

        openDocumentManager.registerType (new ProjucerAppClasses::LiveBuildCodeEditorDocument::Type(), 2);

        if (! checkEULA())
        {
            quit();
            return;
        }

        childProcessCache = new ChildProcessCache();

        initCommandManager();
        menuModel = new MainMenuModel();

        settings->appearance.refreshPresetSchemeList();

        // do further initialisation in a moment when the message loop has started
        triggerAsyncUpdate();
    }
}