Installs ENSIME server with a bootstrap sbt project and generates its classpath.
765807
def install(self):
        """"""
        project_dir = os.path.dirname(self.classpath_file)
        sbt_plugin = """addSbtPlugin("{0}" % "{1}" % "{2}")"""

        Util.mkdir_p(project_dir)
        Util.mkdir_p(os.path.join(project_dir, "project"))
        Util.write_file(
            os.path.join(project_dir, "build.sbt"),
            self.build_sbt())
        Util.write_file(
            os.path.join(project_dir, "project", "build.properties"),
            "sbt.version={}".format(self.SBT_VERSION))
        Util.write_file(
            os.path.join(project_dir, "project", "plugins.sbt"),
            sbt_plugin.format(*self.SBT_COURSIER_COORDS))

        # Synchronous update of the classpath via sbt
        # see https://github.com/ensime/ensime-vim/issues/29
        cd_cmd = "cd {}".format(project_dir)
        sbt_cmd = "sbt -Dsbt.log.noformat=true -batch saveClasspath"

        if int(self.vim.eval("has('nvim')")):
            import tempfile
            import re
            tmp_dir = tempfile.gettempdir()
            flag_file = "{}/ensime-vim-classpath.flag".format(tmp_dir)
            self.vim.command("echo 'Waiting for generation of classpath...'")
            if re.match(".+fish$", self.vim.eval("&shell")):
                sbt_cmd += "; echo $status > {}".format(flag_file)
                self.vim.command("terminal {}; and {}".format(cd_cmd, sbt_cmd))
            else:
                sbt_cmd += "; echo $? > {}".format(flag_file)
                self.vim.command("terminal ({} && {})".format(cd_cmd, sbt_cmd))

            # Block execution when sbt is run
            waiting_for_flag = True
            while waiting_for_flag:
                waiting_for_flag = not os.path.isfile(flag_file)
                if not waiting_for_flag:
                    with open(flag_file, "r") as f:
                        rtcode = f.readline()
                    os.remove(flag_file)
                    if rtcode and int(rtcode) != 0:  # error
                        self.vim.command(
                            "echo 'Something wrong happened, check the "
                            "execution log...'")
                        return None
                else:
                    time.sleep(0.2)
        else:
            self.vim.command("!({} && {})".format(cd_cmd, sbt_cmd))

        success = self.reorder_classpath(self.classpath_file)
        if not success:
            self.vim.command("echo 'Classpath ordering failed.'")

        return True
450772
public void runAfterApplicationCreateBootstrap(
      Instrumentation instrumentation, String[] bootstrapClasses) {
    if (!isWithExtension) {
      SelendroidLogger.error("Cannot run bootstrap. Must load an extension first.");
      return;
    }

    for (String bootstrapClassName : bootstrapClasses) {
      try {
        SelendroidLogger.info("Running afterApplicationCreate bootstrap: " + bootstrapClassName);
        loadBootstrap(bootstrapClassName).runAfterApplicationCreate(instrumentation);
        SelendroidLogger.info("\"Running afterApplicationCreate bootstrap: " + bootstrapClassName);
      } catch (Exception e) {
        throw new SelendroidException(
            "Cannot run bootstrap " + bootstrapClassName, e);
      }
    }
  }
480864
public function boot()
    {
        $finder = $this->app->make('orchestra.extension.finder');

        foreach ($this->extensions as $name => $path) {
            if (\is_numeric($name)) {
                $finder->addPath($path);
            } else {
                $finder->registerExtension($name, $path);
            }
        }
    }
44484
protected function bootstrap()
    {
        (new Presets\Bootstrap($this->filesystem))->install();
        $this->info('Bootstrap scaffolding installed successfully.');
        $this->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
    }
636981
def _setup_default_templates(settings, path, prompt=True):
    
    project_templates = [{
        "name": "Basic Bootstrap 3 template",
        "url": "https://github.com/tarbell-project/tarbell-template",
    }, {
        "name": "Searchable map template",
        "url": "https://github.com/tarbell-project/tarbell-map-template",
    }, {
        "name": "Tarbell template walkthrough",
        "url": "https://github.com/tarbell-project/tarbell-tutorial-template",
    }]
    for project in project_templates:
        puts("+ Adding {0} ({1})".format(project["name"], project["url"]))

    puts("\n- Done configuring project templates.")
    return {"project_templates": project_templates}
294226
def install(self):
        
        try:
            if self.args.server is not None:
                server = ServerLists(self.server_type)
                DynamicImporter(
                    'ezhost',
                    server.name,
                    args=self.args,
                    configure=self.configure
                )
            else:
                ServerCommand(self.args)
        except Exception as e:
            raise e
1197209
public function main()
    {
        if ($this->typeFile === null
            && ($this->name === null || $this->classname === null)
        ) {
            throw new BuildException("You must specify name and class attributes for <taskdef>.");
        }
        if ($this->typeFile == null) {
            $this->log("Task " . $this->name . " will be handled by class " . $this->classname, Project::MSG_VERBOSE);
            $this->project->addTaskDefinition($this->name, $this->classname, $this->classpath);
        } else {
            try { // try to load taskdefs given in file
                $props = new Properties();
                $in = new PhingFile((string) $this->typeFile);

                if ($in === null) {
                    throw new BuildException("Can't load task list {$this->typeFile}");
                }
                $props->load($in);

                $enum = $props->propertyNames();
                foreach ($enum as $key) {
                    $value = $props->getProperty($key);
                    $this->project->addTaskDefinition($key, $value, $this->classpath);
                }
            } catch (IOException $ioe) {
                throw new BuildException("Can't load task list {$this->typeFile}");
            }
        }
    }
1330057
public function install()
    {
        $type = $this->typeResolver->resolve();
        if (!isset($this->mapping[$type])) {
            return;
        }

        foreach ($this->mapping[$type] as $package) {
            if (!$this->isPackageRequired($package['name'])) {
                $this->io->write(
                    sprintf('Requiring package %s', $package['name'])
                );

                $this->installer->installPackage(
                    $package['name'],
                    $package['version']
                );
            }
        }
    }
142242
public function bootstrap()
    {
        if (! class_exists(DotenvFactory::class)) {
            $this->writeErrorAndDie([
                'Unable to load the environment file!',
                'Please install "vlucas/phpdotenv:^3.3".',
            ]);
        }

        try {
            $this->createDotenv()->safeLoad();
        } catch (InvalidFileException $e) {
            $this->writeErrorAndDie([
                'The environment file is invalid!',
                $e->getMessage(),
            ]);
        }
    }
722135
public function bootstrap()
    {

        // setup autoloader
        require SERVER_AUTOLOADER;

        // make the application available and register the class loaders
        $application = $this->getApplication();
        $application->registerClassLoaders();

        // register the applications annotation registries
        $application->registerAnnotationRegistries();

        // try to load the profile logger
        if (isset($this->loggers[LoggerUtils::PROFILE])) {
            $this->profileLogger = $this->loggers[LoggerUtils::PROFILE];
            $this->profileLogger->appendThreadContext('timer-factory');
        }
    }
1268116
public function boot()
    {
        $path = \realpath(__DIR__.'/../');

        $this->addConfigComponent('orchestra/tenanti', 'orchestra/tenanti', "{$path}/config");

        if (! $this->hasPackageRepository()) {
            $this->bootUsingLaravel($path);
        }
    }
1030800
public synchronized static void install() {
        if (!isInstalled()) {
            InputStream is = BMPCLocalLauncher.class.getResourceAsStream(BMP_LOCAL_ZIP_RES);
            try {
                // Unzip BrowserMob Proxy contained in the project "/resources"
                unzip(is, BMPC_USER_DIR);

                // Set executable permissions on the BrowserMob Proxy lanching scripts
                new File(BMP_LOCAL_EXEC_UNIX).setExecutable(true);
                new File(BMP_LOCAL_EXEC_WIN).setExecutable(true);

                // Check there is an installed version
                installedVersion();
            } catch (Exception e) {
                throw new BMPCUnexpectedErrorException("Installation failed", e);
            }
        }
    }
1156044
public function bootstrap()
    {

        // Start the rudimental system
        try {

            // Load settingsfile
            $this->loadSettings();

            // From here starts output buffering
            ob_start();

            // Registe PSR classloader
            $this->registerClassloader();

            // Create core DI container instance and map the instance to comntainer
            $this->di = \Core\DI\DI::getInstance();
            $this->di->mapValue('core.di', $this->di);

            $this->initLogger();

            // Run inits
            $this->initDatabase();
            $this->initMessageHandler();
            $this->initDependencies();
            $this->initHttp();
            $this->initSession();
            $this->initConfig();
            $this->initMailer();
            $this->initRouter();

            // Get an instance of Core app
            $this->getAppInstance('Core');

            $this->initSecurity();
            $this->initPage();
            $this->initAssetManager();

            // Run highlevel system
            $this->autodiscoverApps();

            // Match request against the generic routes to get the ajax request flag and to match a fallback result.
            $this->router->match();

            // Initiate apps
            $this->initApps();

            // Match routes again as now possible app routes are available
            $this->router->match();

            // Run dispatcher
            $result = $this->dispatch();

            // Send mails
            $this->mailer->send();

            // Process all assets
            $this->processAssets();

            // Send cookies
            $this->http->cookies->send();

            // Redirect requested?
            if (!empty($_SESSION['Core']['redirect'])) {

                $this->http->header->location($_SESSION['Core']['redirect']['location'], $_SESSION['Core']['redirect']['permanent']);
                $this->http->header->send();

                // Important: Clear redirect from session!
                unset($_SESSION['Core']['redirect']);

                return;
            }

            switch ($this->router->getFormat()) {

                case 'file':
                    $sendfile = new Sendfile($result);
                    $sendfile->send();

                    break;

                case 'html':

                    $this->http->header->contentType('text/html', 'utf-8');

                    $language = $this->getAppInstance('Core')->language;

                    // Add logoff button for logged in users
                    if ($this->user->isGuest()) {
                        $this->page->menu->createItem('register', $language->get('menu.register'), $this->router->generate('core.register'));
                        $this->page->menu->createItem('login', $language->get('menu.login'), $this->router->generate('core.login', [
                            'action' => 'login'
                        ]));
                    }

                    // or add login and register buttons. But not when current user is currently on banlist
                    else {

                        $usermenu = $this->page->menu->createItem('login', $this->user->getDisplayname());

                        // Show admin menu?
                        if ($this->user->getAdmin()) {
                            $usermenu->createItem('admin', $language->get('menu.admin'), $this->router->generate('core.admin'));
                        }

                        $usermenu->createItem('logout', $language->get('menu.logout'), $this->router->generate('core.login', [
                            'action' => 'logout'
                        ]));
                    }

                    $this->page->setHome($this->config->get('Core', 'url.home'));
                    $this->page->setContent($result);

                    $result = $this->page->render();
            }

            // Send headers so far
            $this->http->header->send();
        }
        catch (\Throwable $t) {

            $error = new ErrorHandler($t);
            $error->setAjax(isset($_REQUEST['ajax']));
            $error->setPublic(isset($this->user) && $this->user->getAdmin());
            $error->setPublic(true);

            if (isset($this->logger)) {
                $error->setLogger($this->logger);
            }

            http_response_code(500);

            $result = $error->handle();
        }

        echo $result;

        ob_end_flush();
    }
974322
private String createModuleStarter(final Map<Class<?>, Set<? extends Element>> annotationMap, ProcessingEnvironment processingEnv) {
        String moduleName;
        try {
            moduleName = getModuleStarterName(processingEnv);
            final String starterName = moduleName.substring(moduleName.lastIndexOf('.') + 1);
            final String pkg = moduleName.substring(0, moduleName.lastIndexOf('.'));

            final JavaClassSource javaClass = Roaster.create(JavaClassSource.class);

            javaClass.setPackage(pkg).setName(starterName);

            javaClass.extendSuperType(AbstractModuleStarter.class);

            final StringBuilder body = new StringBuilder();

            appendRegistrationPoints(javaClass, body, annotationMap.get(RegistrationPoint.class));

            appendRegistrations(javaClass, body, annotationMap.get(Register.class));

            appendPreload(javaClass, body, annotationMap.get(Preload.class));

            appendBootComponent(javaClass, body, annotationMap.get(BootComponent.class));

            if (!javaClass.hasMethodSignature("start")) {
                final MethodSource<?> method = javaClass.addMethod()
                                                        .setName("start")
                                                        .setPublic()
                                                        .setBody(body.toString())
                                                        .setReturnTypeVoid();
                method.getJavaDoc().setFullText("{@inheritDoc}");
                method.addAnnotation(Override.class);

            } else {
                javaClass.getMethod("start").setBody(javaClass.getMethod("start").getBody() + body.toString());
            }

            final Properties prefs = new Properties();
            prefs.load(this.getClass().getResourceAsStream(FORMATTER_PROPERTIES_FILE));
            final String formattedSource = Formatter.format(prefs, javaClass);

            // System.out.println(formattedSource);

            final JavaFileObject jfo = this.processingEnv.getFiler().createSourceFile(moduleName);
            this.processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "creating source file: " + jfo.toUri());

            final Writer writer = jfo.openWriter();
            writer.write(formattedSource);
            writer.close();
        } catch (final Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }

        return moduleName;
    }
1184719
public function main()
    {
        // if composer autoloader is not yet loaded, load it here
        @include_once 'vendor/autoload.php';
        if (!class_exists('\\JShrink\\Minifier')) {
            throw new BuildException(
                'JsMinTask depends on JShrink being installed and on include_path.',
                $this->getLocation()
            );
        }

        if (empty($this->targetDir)) {
            throw new BuildException('Attribute "targetDir" is required');
        }

        foreach ($this->filesets as $fs) {
            try {
                $this->processFileSet($fs);
            } catch (BuildException $be) {
                // directory doesn't exist or is not readable
                if ($this->failonerror) {
                    throw $be;
                } else {
                    $this->log($be->getMessage(), Project::MSG_WARN);
                }
            }
        }
    }
1019950
def setup(self):
    
    return self._load_plugins(
      self._working_set,
      self._bootstrap_options.pythonpath,
      self._bootstrap_options.plugins,
      self._bootstrap_options.backend_packages
    )
270923
public void runBeforeApplicationCreateBootstrap(
      Instrumentation instrumentation, String[] bootstrapClasses) {
    if (!isWithExtension) {
      SelendroidLogger.error("Cannot run bootstrap. Must load an extension first.");
      return;
    }

    for (String bootstrapClassName : bootstrapClasses) {
      try {
        SelendroidLogger.info("Running beforeApplicationCreate bootstrap: " + bootstrapClassName);
        loadBootstrap(bootstrapClassName).runBeforeApplicationCreate(instrumentation);
        SelendroidLogger.info("\"Running beforeApplicationCreate bootstrap: " + bootstrapClassName);
      } catch (Exception e) {
        throw new SelendroidException("Cannot run bootstrap " + bootstrapClassName, e);
      }
    }
  }