Example #1
0
        public CSharpCompiler(string code, IExecutionProperties execProps, ICompilerProperties compProps,
                              string[] imports = null, IGlobals globals = null)
        {
            SourceCode         = code;
            ExecuteProperties  = execProps;
            CompilerProperties = compProps;
            if (imports == null || !imports.Any())
            {
                LoadReferences();
            }
            else
            {
                Imports = imports;
            }

            Globals = globals ?? new Globals(new StringBuilder());
            Create();
        }
Example #2
0
        public VbCompiler(string code, IExecutionProperties execProps, ICompilerProperties compProps,
                          string[] imports = null)
        {
            SourceCode         = code;
            ExecuteProperties  = execProps;
            CompilerProperties = compProps;
            if (imports == null)
            {
                //TODO: Load references for VB (now: C#)
                //LoadReferences();
            }
            else
            {
                Imports = imports;
            }

            Create();
        }
Example #3
0
        public JavaCompiler(string code, IExecutionProperties execProps, ICompilerProperties compProps,
                            string jdkPath = null)
        {
            SourceCode         = code;
            ExecuteProperties  = execProps;
            CompilerProperties = compProps;

            if (string.IsNullOrWhiteSpace(jdkPath) || !Directory.Exists(jdkPath))
            {
                //Search for JDK if jdkPath is invalid directory
                FindJdk();
            }
            else
            {
                //Use JDK Path parameter
                JdkPath = jdkPath;
            }
        }