Search in sources :

Example 1 with BrppIDEFrame

use of cc.brino.Brpp.IDEui.BrppIDEFrame in project Brino by BrinoOficial.

the class BrppCompilerMain method main.

public static void main(String[] args) {
    BrppCompilerMain.init();
    final String[] getArgs = args;
    // cria o diretorio do Brino
    logger.log(Level.CONFIG, "Criando o diretorio do Brino");
    File dir = new File(FileUtils.getBrinodirectory());
    dir.mkdirs();
    // cria o diretorio do Brino
    logger.log(Level.CONFIG, "Criando o diretorio de bibliotecas do Brino");
    File libDir = new File(Paths.get(FileUtils.getBrinodirectory(), "bibliotecas").toAbsolutePath().toString());
    libDir.mkdirs();
    // salva o diretorio do brino
    logger.log(Level.INFO, "Path set to: " + currentRelativePath);
    setPath(currentRelativePath);
    try {
        logger.log(Level.CONFIG, "Configurando preferências");
        PrefManager.setPrefs();
        logger.log(Level.CONFIG, "Configurando lingua");
        JSONUtils.config(currentRelativePath);
        logger.log(Level.CONFIG, "Configurando bibliotecas");
        FileUtils.copyFolder(libDir, destDir);
        logger.log(Level.CONFIG, "Processando bibliotecas para highlight");
        KeywordManagerUtils.processLibraries();
        logger.log(Level.CONFIG, "Atualizando lingua");
        LanguageVersionUtils.updateLanguages();
        logger.log(Level.CONFIG, "Verificando versao");
        VersionUtils.checkVersion();
    } catch (FileNotFoundException fnfe) {
        logger.log(Level.SEVERE, "Erro ao configurar o programa! Arquivo não encontrado : \n", fnfe);
    } catch (UnknownHostException uhe) {
        logger.log(Level.CONFIG, "Nao ha internet. Nao foi possivel atualizar a lingua!\n", uhe);
    } catch (MalformedURLException mue) {
        logger.log(Level.SEVERE, "Erro ao acessar a URL da lingua!\n", mue);
    } catch (IOException ioe) {
        logger.log(Level.SEVERE, "Erro ao configurar o programa!\n", ioe);
    } catch (ParseException pe) {
        logger.log(Level.SEVERE, "Erro ao fazer o parse da lingua!\n", pe);
    } catch (NullPointerException npe) {
        logger.log(Level.SEVERE, "Erro ao mover bibliotecas!\n", npe);
    } catch (URISyntaxException e) {
        logger.log(Level.SEVERE, "Erro ao abrir página de downloads!\n", e);
    }
    SwingUtilities.invokeLater(new Runnable() {

        public void run() {
            frame = new BrppIDEFrame("Brino " + BrppCompiler.version);
            frame.setSize(500, 600);
            frame.setLocation(100, 30);
            logger.log(Level.CONFIG, "Inicializando frame");
            frame.setVisible(true);
            if (getArgs.length > 0) {
                String filePath = getArgs[0];
                FileUtils.abrirFile(filePath, BrppIDEFrame.getTextArea(), true);
            }
        }
    });
}
Also used : MalformedURLException(java.net.MalformedURLException) BrppIDEFrame(cc.brino.Brpp.IDEui.BrppIDEFrame) UnknownHostException(java.net.UnknownHostException) FileNotFoundException(java.io.FileNotFoundException) IOException(java.io.IOException) ParseException(org.json.simple.parser.ParseException) URISyntaxException(java.net.URISyntaxException) File(java.io.File)

Aggregations

BrppIDEFrame (cc.brino.Brpp.IDEui.BrppIDEFrame)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 UnknownHostException (java.net.UnknownHostException)1 ParseException (org.json.simple.parser.ParseException)1