Exemplo n.º 1
0
 // Expects correct arguments.
 internal CompilationOptions(
     OutputKind outputKind,
     string moduleName,
     string mainTypeName,
     string scriptClassName,
     string cryptoKeyContainer,
     string cryptoKeyFile,
     bool?delaySign,
     bool optimize,
     bool checkOverflow,
     int fileAlignment,
     ulong baseAddress,
     Platform platform,
     ReportDiagnostic generalDiagnosticOption,
     int warningLevel,
     IEnumerable <KeyValuePair <string, ReportDiagnostic> > specificDiagnosticOptions,
     bool highEntropyVirtualAddressSpace,
     DebugInformationKind debugInformationKind,
     SubsystemVersion subsystemVersion,
     bool concurrentBuild,
     XmlReferenceResolver xmlReferenceResolver,
     SourceReferenceResolver sourceReferenceResolver,
     MetadataReferenceResolver metadataReferenceResolver,
     MetadataReferenceProvider metadataReferenceProvider,
     AssemblyIdentityComparer assemblyIdentityComparer,
     StrongNameProvider strongNameProvider,
     MetadataImportOptions metadataImportOptions)
 {
     Initialize(
         outputKind, moduleName, mainTypeName, scriptClassName, cryptoKeyContainer, cryptoKeyFile, delaySign, optimize, checkOverflow, fileAlignment,
         baseAddress, platform, generalDiagnosticOption, warningLevel, specificDiagnosticOptions, highEntropyVirtualAddressSpace, debugInformationKind,
         subsystemVersion, concurrentBuild, xmlReferenceResolver, sourceReferenceResolver, metadataReferenceResolver, metadataReferenceProvider, assemblyIdentityComparer, strongNameProvider,
         metadataImportOptions);
 }
 internal ModulePropertiesForSerialization(
     Guid persistentIdentifier,
     ushort fileAlignment,
     string targetRuntimeVersion,
     Platform platform,
     bool trackDebugData,
     ulong baseAddress,
     ulong sizeOfHeapReserve,
     ulong sizeOfHeapCommit,
     ulong sizeOfStackReserve,
     ulong sizeOfStackCommit,
     bool enableHighEntropyVA,
     bool strongNameSigned,
     bool configureToExecuteInAppContainer,
     SubsystemVersion subsystemVersion)
 {
     this.PersistentIdentifier             = (persistentIdentifier == default(Guid)) ? Guid.NewGuid() : persistentIdentifier;
     this.FileAlignment                    = fileAlignment;
     this.TargetRuntimeVersion             = targetRuntimeVersion;
     this.Platform                         = platform;
     this.TrackDebugData                   = trackDebugData;
     this.BaseAddress                      = baseAddress;
     this.SizeOfHeapReserve                = sizeOfHeapReserve;
     this.SizeOfHeapCommit                 = sizeOfHeapCommit;
     this.SizeOfStackReserve               = sizeOfStackReserve;
     this.SizeOfStackCommit                = sizeOfStackCommit;
     this.EnableHighEntropyVA              = enableHighEntropyVA;
     this.StrongNameSigned                 = strongNameSigned;
     this.ConfigureToExecuteInAppContainer = configureToExecuteInAppContainer;
     this.SubsystemVersion                 = subsystemVersion.Equals(SubsystemVersion.None)
         ? SubsystemVersion.Default(OutputKind.ConsoleApplication, this.Platform)
         : subsystemVersion;
 }
Exemplo n.º 3
0
        internal void Initialize(
            OutputKind outputKind,
            string moduleName,
            string mainTypeName,
            string scriptClassName,
            string cryptoKeyContainer,
            string cryptoKeyFile,
            bool?delaySign,
            bool optimize,
            bool checkOverflow,
            int fileAlignment,
            ulong baseAddress,
            Platform platform,
            ReportDiagnostic generalDiagnosticOption,
            int warningLevel,
            IEnumerable <KeyValuePair <string, ReportDiagnostic> > specificDiagnosticOptions,
            bool highEntropyVirtualAddressSpace,
            DebugInformationKind debugInformationKind,
            SubsystemVersion subsystemVersion,
            bool concurrentBuild,
            FileResolver fileResolver,
            MetadataReferenceProvider metadataReferenceProvider,
            AssemblyIdentityComparer assemblyIdentityComparer,
            StrongNameProvider strongNameProvider,
            MetadataImportOptions metadataImportOptions)
        {
            this.OutputKind                     = outputKind;
            this.ModuleName                     = moduleName;
            this.MainTypeName                   = mainTypeName;
            this.ScriptClassName                = scriptClassName;
            this.CryptoKeyContainer             = cryptoKeyContainer;
            this.CryptoKeyFile                  = cryptoKeyFile;
            this.DelaySign                      = delaySign;
            this.CheckOverflow                  = checkOverflow;
            this.FileAlignment                  = fileAlignment;
            this.BaseAddress                    = baseAddress;
            this.Platform                       = platform;
            this.GeneralDiagnosticOption        = generalDiagnosticOption;
            this.WarningLevel                   = warningLevel;
            this.SpecificDiagnosticOptions      = specificDiagnosticOptions.ToImmutableDictionaryOrEmpty();
            this.HighEntropyVirtualAddressSpace = highEntropyVirtualAddressSpace;
            this.DebugInformationKind           = debugInformationKind;
            this.Optimize                       = optimize;
            this.ConcurrentBuild                = concurrentBuild;
            this.SubsystemVersion               = subsystemVersion;
            this.FileResolver                   = fileResolver ?? FileResolver.Default;
            this.MetadataReferenceProvider      = metadataReferenceProvider ?? MetadataReferenceProvider.Default;
            this.StrongNameProvider             = strongNameProvider;
            this.AssemblyIdentityComparer       = assemblyIdentityComparer ?? AssemblyIdentityComparer.Default;
            this.MetadataImportOptions          = metadataImportOptions;

            this.lazyErrors = new Lazy <ImmutableArray <Diagnostic> >(() =>
            {
                var builder = ArrayBuilder <Diagnostic> .GetInstance();
                ValidateOptions(builder);
                return(builder.ToImmutableAndFree());
            });
        }