示例#1
0
 protected override void Init(IConfigReader configReader)
 {
     PlatformAssembliesDir = GetPath(configReader, nameof(PlatformAssembliesDir));
     PlatformAssemblies    = configReader
                             .ReadValue(nameof(PlatformAssemblies))
                             ?.Split(';') ?? new string[] { "netstandard.dll", "System.Runtime.dll" };
 }
        private WorkingDirectories(IConfigReader configReader)
        {
            AssemblyCacheDir = GetPath(nameof(AssemblyCacheDir));
            SourceDump       = GetPath(nameof(SourceDump));
            LogDump          = GetPath(nameof(LogDump));

            string?GetPath(string name)
            {
                string?result = configReader.ReadValue(name);

                if (result is not null)
                {
                    result = Environment.ExpandEnvironmentVariables(result);

                    if (!Path.IsPathRooted(result))
                    {
                        result = Path.Combine(configReader.BasePath, result);
                    }
                }

                return(result);
            }
        }
示例#3
0
        protected override void Init(IConfigReader configReader)
        {
            DebugGenerator = ReadBool(nameof(DebugGenerator));

            bool ReadBool(string name) => configReader.ReadValue(name)?.Equals(true.ToString(), StringComparison.OrdinalIgnoreCase) == true;
        }