예제 #1
0
        /// <nodoc/>
        public AstConversionConfiguration(
            [CanBeNull] IEnumerable <string> policyRules,
            bool disableLanguagePolicies)
        {
            PolicyRules   = policyRules ?? CollectionUtilities.EmptyArray <string>();
            UnsafeOptions = UnsafeConversionConfiguration.GetConfigurationFromEnvironmentVariables();

            DegreeOfParalellism     = 1;
            DisableLanguagePolicies = disableLanguagePolicies;
        }
        /// <nodoc/>
        public AstConversionConfiguration(
            [CanBeNull] IEnumerable <string> policyRules,
            int degreeOfParallelism,
            bool disableLanguagePolicies,
            bool useLegacyOfficeLogic)
        {
            PolicyRules   = policyRules ?? CollectionUtilities.EmptyArray <string>();
            UnsafeOptions = UnsafeConversionConfiguration.GetConfigurationFromEnvironmentVariables();

            // In DScript V2 AST converter itself does not convert nodes in parallel.
            DegreeOfParalellism     = useLegacyOfficeLogic ? degreeOfParallelism : 1;
            DisableLanguagePolicies = disableLanguagePolicies;
        }
예제 #3
0
        /// <nodoc/>
        public AstConversionConfiguration(
            [CanBeNull] IEnumerable <string> policyRules,
            bool disableLanguagePolicies,
            bool unsafeOptimized = false)
        {
            PolicyRules   = policyRules ?? CollectionUtilities.EmptyArray <string>();
            UnsafeOptions = UnsafeConversionConfiguration.GetConfigurationFromEnvironmentVariables();

            if (unsafeOptimized)
            {
                UnsafeOptions.DisableAnalysis = true;
                UnsafeOptions.DisableDeclarationBeforeUseCheck = true;
                UnsafeOptions.SkipTypeConversion = true;
            }

            DegreeOfParalellism     = 1;
            DisableLanguagePolicies = disableLanguagePolicies;
        }
예제 #4
0
        /// <nodoc />
        public static UnsafeConversionConfiguration GetConfigurationFromEnvironmentVariables()
        {
            var result = new UnsafeConversionConfiguration();

            if (Environment.GetEnvironmentVariable("BUILDXL_DISABLE_DECLARE_BEFORE_USE_CHECK") != null)
            {
                result.DisableDeclarationBeforeUseCheck = true;
            }

            if (Environment.GetEnvironmentVariable("BUILDXL_DISABLE_BINDING_AND_ANALYSIS") != null)
            {
                result.DisableAnalysis = true;
            }

            if (Environment.GetEnvironmentVariable("BUILDXL_DISABLE_LINE_INFO_CONVERSION") != null)
            {
                result.DisableLineInfoConversion = true;
            }

            return(result);
        }