コード例 #1
0
ファイル: CodeCompletion.cs プロジェクト: VincentRisi/jportal
        public bool Run()
        {
            string code = editor.Document.TextContent;
            // check if we already have compiled this code before
            int hashCode = code.GetHashCode();

            if (database != null && this.hashCode == hashCode)
            {
                return(false);
            }
            this.hashCode = hashCode;
            java.io.StringReader reader = new java.io.StringReader(code);
            try
            {
                java.io.StringWriter writer = new java.io.StringWriter();
                try
                {
                    java.io.PrintWriter log = new java.io.PrintWriter(writer);
                    try
                    {
                        Database db;
                        db = JPortal.run(name, reader, log);
                        if (db != null)
                        {
                            database = db;
                        }
                    }
                    finally
                    {
                        log.flush();
                        log.close();
                    }
                    string   result = writer.ToString();
                    char[]   sep    = { '\n' };
                    string[] lines  = result.Split(sep);
                    for (int i = 0; i < lines.Length; i++)
                    {
                        string line = lines[i].Trim();
                        if (line.Length == 0)
                        {
                            continue;
                        }
                        form.LogInfo = line;
                    }
                }
                finally
                {
                    writer.close();
                }
            }
            finally
            {
                reader.close();
            }
            return(database != null);
        }
コード例 #2
0
ファイル: AnyDBMain.cs プロジェクト: VincentRisi/jportal
 private void RunCompile(Source source)
 {
     source.Clear();
     java.io.StringWriter writer = new java.io.StringWriter();
     try
     {
         java.io.PrintWriter log = new java.io.PrintWriter(writer);
         try
         {
             string currDir = Directory.GetCurrentDirectory();
             try
             {
                 FileInfo info = new FileInfo(source.FileName);
                 LogVerbose = "Changing to " + info.DirectoryName;
                 Directory.SetCurrentDirectory(info.DirectoryName);
                 LogVerbose = "Compiling " + info.Name;
                 bbd.jportal.Database database = JPortal.run(info.FullName, log);
                 RunGenerators(database, log);
             }
             finally
             {
                 Directory.SetCurrentDirectory(currDir);
             }
         }
         finally
         {
             log.flush();
             log.close();
         }
         string   result = writer.ToString();
         char[]   sep    = { '\n' };
         string[] lines  = result.Split(sep);
         for (int i = 0; i < lines.Length; i++)
         {
             string line = lines[i].Trim();
             if (line.Length == 0)
             {
                 continue;
             }
             if (line.IndexOf("Code: ") == 0)
             {
                 source.Add(line.Substring(6).Trim());
             }
             else if (line.IndexOf("DDL: ") == 0)
             {
                 source.Add(line.Substring(5).Trim());
             }
             LogInfo = line;
         }
     }
     finally
     {
         writer.close();
     }
 }
コード例 #3
0
 public virtual void FixtureTearDown()
 {
     StopGFXDServer(m_defaultDriverType);
     com.pivotal.gemfirexd.@internal.shared.common.sanity.SanityManager
     .SET_DEBUG_STREAM(null);
     if (s_logFileWriter != null)
     {
         s_logFileWriter.close();
         s_logFileWriter = null;
     }
 }
コード例 #4
0
        private bool RunJavac()
        {
            List <String> paramList = new List <String>();

            temp = GetFullPath(Path.Combine("obj", platform, configuration));
            paramList.Add("-d");
            paramList.Add(temp);

            if (sources != null)
            {
                for (int i = 0; i < sources.Length; i++)
                {
                    string sourceFile = GetFullPath(sources[i].ItemSpec);
                    RemoveBOM(sourceFile);
                    paramList.Add(sourceFile);
                }
            }
            String[]    parameters = paramList.ToArray();
            PrintWriter pw         = new PrintWriter(new LogWriter(Log), true);
            int         result     = Javac.compile(parameters, pw);

            pw.close();
            return(result == 0);
        }
コード例 #5
0
ファイル: JavaTask.cs プロジェクト: LogosBible/ikvm-fork
        private bool RunJavac()
        {
            List<String> paramList = new List<String>();

            temp = GetFullPath(Path.Combine("obj", platform, configuration));
            paramList.Add("-d");
            paramList.Add(temp);

            if (sources != null)
            {
                for (int i = 0; i < sources.Length; i++)
                {
                    string sourceFile = GetFullPath(sources[i].ItemSpec);
                    RemoveBOM(sourceFile);
                    paramList.Add(sourceFile);
                }
            }
            String[] parameters = paramList.ToArray();
            PrintWriter pw = new PrintWriter(new LogWriter(Log), true);
            int result = Javac.compile(parameters, pw);
            pw.close();
            return result == 0;
        }