public virtual string[] GetReferencesCommand(string[] references, IIntermediateCompilerOptions options) { return(Tweaks.ProcessArray(references, delegate(string r) { return GetReferenceCommand(r, options); })); }
public virtual string[] GetSourcesCommand(string[] files, IIntermediateCompilerOptions options) { return(Tweaks.ProcessArray(files, delegate(string f) { return GetSourceCommand(f, options); })); }
/// <summary> /// Creates a new <see cref="IntermediateCompilerBase"/> with the <paramref name="project"/> and /// <paramref name="translator"/> provided. /// </summary> /// <param name="project">The <see cref="IIntermediateProject"/> that needs compiled.</param> /// <param name="translator">The <see cref="IIntermediateCodeTranslator"/> root to /// translate the intermediate code into a proper langauge for compilation.</param> /// <param name="options">The <see cref="IIntermediateCompilerOptions"/> which guides the <see cref="Compile()"/> process.</param> internal IntermediateCompilerBase(IIntermediateProject project, IIntermediateCodeTranslator translator, IIntermediateCompilerOptions options, IIntermediateCompilerModule module) { this.translator = translator; this.project = project; this.options = options; this.module = module; }
public override string GetEntryPointCommand(IMethodMember entrypointMethod, IIntermediateCompilerOptions options) { if (entrypointMethod == null) { throw new ArgumentNullException("entrypointMethod"); } return(string.Format(EntryPointCommand, ((IDeclaredType)entrypointMethod.ParentTarget).GetTypeName(CodeGeneratorHelper.DefaultTranslatorOptions))); }
public override string GetOptimizationCommand(bool optimize, IIntermediateCompilerOptions options) { if (optimize) { return(string.Format(OptimizeCommand, "+")); } else { return(string.Format(OptimizeCommand, "-")); } }
public override string GetDebugCommand(DebugSupport support, IIntermediateCompilerOptions options) { switch (support) { case DebugSupport.None: return(DebugNone); case DebugSupport.PDB: return(DebugPDBOnly); case DebugSupport.Full: return(DebugFull); } return(string.Empty); }
public override string GetTypeCommand(ProjectOutputType outputType, IIntermediateCompilerOptions options) { switch (outputType) { case ProjectOutputType.ClassLibrary: return(OutputClassLibrary); case ProjectOutputType.ConsoleApplication: return(OutputConsoleApp); case ProjectOutputType.Module: return(OutputModule); case ProjectOutputType.WindowsApplication: return(OutputWindowsApp); } return(string.Empty); }
public override string GetXMLDocumentationCommand(bool generateDocs, IIntermediateCompilerOptions options) { if (!generateDocs) { return(string.Empty); } string output = options.Target; if (output.Contains(".")) { output = string.Format("{0}.xml", output.Substring(0, output.LastIndexOf('.'))); } else { output = string.Format("{0}.xml", output); } return(string.Format(XMLDocCommand, output)); }
public override string GetSetWarningLevel(CompilerWarnLevel warnLevel, IIntermediateCompilerOptions options) { byte warnID = 0; switch (warnLevel) { case CompilerWarnLevel.Level1: warnID = 1; break; case CompilerWarnLevel.Level2: warnID = 2; break; case CompilerWarnLevel.Level3: warnID = 3; break; case CompilerWarnLevel.Level4: warnID = 4; break; } return(string.Format(WarnLevelCommand, warnID.ToString())); }
public override string GetSourceCommand(string file, IIntermediateCompilerOptions options) { return(string.Format("\"{0}\"", file)); }
public override string GetBaseAddressCommand(uint baseAddress, IIntermediateCompilerOptions options) { throw new Exception("The method or operation is not implemented."); }
public abstract string GetTypeCommand(ProjectOutputType outputType, IIntermediateCompilerOptions options);
public override IIntermediateCompilerResults Compile(string[] commandSequences, string responseFile, TempFileCollection temporaryFiles, IIntermediateCompilerOptions options) { IntermediateCompilerResults results = new IntermediateCompilerResults(); results.TemporaryFiles = temporaryFiles; results.CommandLine = string.Join(" ", commandSequences); string outputText = string.Empty; string errorText = string.Empty; results.NativeReturnValue = Executor.ExecWaitWithCapture(string.Format("{0}csc.exe /noconfig @\"{1}\"", _OIL._Core.GetRuntimeDirectory(), responseFile), temporaryFiles, ref outputText, ref errorText); return(results); }
public abstract string GetOutputCommand(string target, IIntermediateCompilerOptions options);
/// <summary> /// Creates a new <see cref="CSharpIntermediateCompiler"/> with the <paramref name="project"/> provided. /// </summary> /// <param name="project">The <see cref="IIntermediateProject"/> that needs compiled.</param> /// <param name="options">The <see cref="IIntermediateCompilerOptions"/> which guides the <see cref="Compile()"/> process.</param> public CSharpIntermediateCompiler(IIntermediateProject project, IIntermediateCompilerOptions options) : base(project, _OIL._Core.DefaultCSharpCodeTranslator, options, _OIL._Core.DefaultCSharpCompilerModule) { }
public abstract string GetBaseAddressCommand(uint baseAddress, IIntermediateCompilerOptions options);
public override string GetResourceCommand(string resourceFile, IIntermediateCompilerOptions options) { throw new Exception("The method or operation is not implemented."); }
public abstract string GetSetWarningLevel(CompilerWarnLevel warnLevel, IIntermediateCompilerOptions options);
public abstract string GetEntryPointCommand(IMethodMember entrypointMethod, IIntermediateCompilerOptions options);
public abstract IIntermediateCompilerResults Compile(string[] commandSequences, string responseFile, TempFileCollection tempFiles, IIntermediateCompilerOptions options);
public abstract string GetReferenceCommand(string reference, IIntermediateCompilerOptions options);
public abstract string GetResourceCommand(string resourceFile, IIntermediateCompilerOptions options);
public abstract string GetXMLDocumentationCommand(bool generateDocs, IIntermediateCompilerOptions options);
public abstract string[] GetModuleCommand(IIntermediateModule module, string[] sourceFiles, string[] resourceFiles, IIntermediateCompilerOptions options);
public override string GetReferenceCommand(string reference, IIntermediateCompilerOptions options) { return(string.Format(ReferenceCommand, reference)); }
/// <summary> /// Creates a new <see cref="IntermediateCompiler"/> with the <paramref name="project"/> and /// <paramref name="translator"/> /// </summary> /// <param name="project">The <see cref="IIntermediateProject"/> that needs compiled.</param> /// <param name="translator">The <see cref="IIntermediateCodeTranslator"/> root to /// translate the intermediate code into a proper langauge for compilation.</param> /// <param name="options">The <see cref="IIntermediateCompilerOptions"/> which guides the <see cref="Compile()"/> process.</param> public IntermediateCompiler(IIntermediateProject project, IIntermediateCodeTranslator translator, IIntermediateCompilerOptions options, IIntermediateCompilerModule module) : base(project, translator, options, module) { }
public override string[] GetModuleCommand(IIntermediateModule module, string[] sourceFiles, string[] resourceFiles, IIntermediateCompilerOptions options) { string target = options.Target; if (module != module.Project.RootModule) { target = string.Format("{0}.{1}.part", target.Substring(0, target.LastIndexOf('.')), module.Name); } return(Tweaks.MergeArrays <string>(new string[] { GetTypeCommand(module != module.Project.RootModule ? ProjectOutputType.Module : module.Project.OutputType, options), GetOutputCommand(target, options) }, GetSourcesCommand(sourceFiles, options))); //return string.Format("{0} {1} {2}", , string.Join(" ", )); }
/// <summary> /// Creates a new <see cref="IntermediateCompiler"/> instance with the <paramref name="project"/>, /// <paramref name="translator"/> and <paramref name="fileRegulationDelegate"/> provided. /// </summary> /// <param name="project">The <see cref="IIntermediateProject"/> that needs compiled.</param> /// <param name="translator">The <see cref="IIntermediateProject"/> root to translate /// the intermediate code into a proper langauge for compilation.</param> /// <param name="fileRegulationDelegate">The <see cref="Predicate{T}"/> which determines /// whether to translate any given <see cref="IIntermediateProject"/> partial /// into code.</param> /// <param name="options">The <see cref="IIntermediateCompilerOptions"/> which guides the <see cref="Compile()"/> process.</param> public IntermediateCompiler(IIntermediateProject project, IIntermediateCodeTranslator translator, IIntermediateCompilerOptions options, IIntermediateCompilerModule module, Predicate <IIntermediateProject> fileRegulationDelegate) : base(project, translator, options, module, fileRegulationDelegate) { }
/// <summary> /// Creates a new <see cref="CSharpIntermediateCompiler"/> instance with the <paramref name="project"/> and /// <paramref name="fileRegulationDelegate"/> provided. /// </summary> /// <param name="project">The <see cref="IIntermediateProject"/> that needs compiled.</param> /// <param name="fileRegulationDelegate">The <see cref="Predicate{T}"/> which determines /// whether to translate any given <see cref="IIntermediateProject"/> partial /// into code.</param> /// <param name="options">The <see cref="IIntermediateCompilerOptions"/> which guides the <see cref="Compile()"/> process.</param> public CSharpIntermediateCompiler(IIntermediateProject project, IIntermediateCompilerOptions options, Predicate <IIntermediateProject> fileRegulationDelegate) : base(project, _OIL._Core.DefaultCSharpCodeTranslator, options, _OIL._Core.DefaultCSharpCompilerModule, fileRegulationDelegate) { }
public override string GetOutputCommand(string target, IIntermediateCompilerOptions options) { return(string.Format(OutputCommand, target)); }