Exemplo n.º 1
0
 private ISemanticVersioning BuildVersioning()
 {
     //TODO: Use castle windsor to load these items
     var currentDir = Directory.GetCurrentDirectory();
     var installPath = Path.Combine(Path.GetTempPath(), "NumericTests");
     var config = new NuGetConfiguration() { PackageSource = currentDir, InstallPath = installPath };
     var nuget = new NuGet(config);
     var versioning = (ISemanticVersioning)new SemanticVersioning(nuget);
     return versioning;
 }
Exemplo n.º 2
0
            public Task Initialize(IList <string> references, IList <string> imports, NuGetConfiguration nuGetConfiguration, string workingDirectory)
            {
                _parseOptions = new CSharpParseOptions().WithPreprocessorSymbols("__DEMO__", "__DEMO_EXPERIMENTAL__");

                var scriptOptions = _scriptOptions
                                    .WithReferences(references)
                                    .WithImports(imports);

                if (nuGetConfiguration != null)
                {
                    var resolver = new NuGetScriptMetadataResolver(nuGetConfiguration, workingDirectory);
                    scriptOptions = scriptOptions.WithMetadataResolver(resolver);
                }
                _scriptOptions = scriptOptions;

                _callbackChannel = OperationContext.Current.GetCallbackChannel <IServiceCallback>();

                return(Task.CompletedTask);
            }
Exemplo n.º 3
0
            public Task Initialize(IList <string> references, IList <string> imports, NuGetConfiguration nuGetConfiguration, string workingDirectory)
            {
                // TODO: remove this once C# 7 is finalized
                var scriptCompilerType = Type.GetType("Microsoft.CodeAnalysis.CSharp.Scripting.CSharpScriptCompiler, Microsoft.CodeAnalysis.CSharp.Scripting", throwOnError: true);
                var optionsField       = scriptCompilerType.GetField("s_defaultOptions", BindingFlags.Static | BindingFlags.NonPublic);
                var options            = ((CSharpParseOptions)optionsField.GetValue(null)).WithPreprocessorSymbols("__DEMO__", "__DEMO_EXPERIMENTAL__");

                optionsField.SetValue(null, options);

                var scriptOptions = _scriptOptions
                                    .WithReferences(references)
                                    .WithImports(imports);

                if (nuGetConfiguration != null)
                {
                    var resolver = new NuGetScriptMetadataResolver(nuGetConfiguration, workingDirectory);
                    scriptOptions = scriptOptions.WithMetadataResolver(resolver);
                }
                _scriptOptions = scriptOptions;

                _callbackChannel = OperationContext.Current.GetCallbackChannel <IServiceCallback>();

                return(Task.CompletedTask);
            }
Exemplo n.º 4
0
 public RoslynHostWithGlobals(NuGetConfiguration nuGetConfiguration = null, IEnumerable <Assembly> additionalAssemblies = null, RoslynHostReferences references = null)
     : base(nuGetConfiguration, additionalAssemblies, references)
 {
 }