コード例 #1
0
 public CompilerResultUtility CompileToJavaScript(string typeScriptFile, JavaScriptEngine javaScriptEngine)
 {
     var r2 = new CompilerResultUtility();
     r2.InputFileName = typeScriptFile;
     var typeScriptCompilerFile = this.ExportTypeScriptCompiler();
     r2.OutputFileName = Path.Combine(Path.GetDirectoryName(typeScriptFile), Path.GetFileNameWithoutExtension(typeScriptFile)+ ".js");
     var commandLine = @" ""{0}"" ""{1}"" -out ""{2}"" ".format(typeScriptCompilerFile, typeScriptFile, r2.OutputFileName);
     var r = Utils.Execute(NodeJSExe, commandLine);
     r2.ConsoleOutput = r.Succeeded ? r.Output : r.ErrorOutput;
     r2.Succeeded = r.Succeeded;
     return r2;
 }
コード例 #2
0
        public CompilerResultUtility CompileToJavaScript(string typeScriptFile, JavaScriptEngine javaScriptEngine)
        {
            var r2 = new CompilerResultUtility();

            r2.InputFileName = typeScriptFile;
            var typeScriptCompilerFile = this.ExportTypeScriptCompiler();

            r2.OutputFileName = Path.Combine(Path.GetDirectoryName(typeScriptFile), Path.GetFileNameWithoutExtension(typeScriptFile) + ".js");
            var commandLine = @" ""{0}"" ""{1}"" -out ""{2}"" ".format(typeScriptCompilerFile, typeScriptFile, r2.OutputFileName);
            var r           = Utils.Execute(NodeJSExe, commandLine);

            r2.ConsoleOutput = r.Succeeded ? r.Output : r.ErrorOutput;
            r2.Succeeded     = r.Succeeded;
            return(r2);
        }