Example #1
0
        public static void AddBuildService(this IServiceCollection services, BuildMethodType type)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }
            switch (type)
            {
            case BuildMethodType.Docker:
                services.AddSingleton <IBuildService, DockerBuildService>();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Example #2
0
 private static object BuildMethodSettingFrom(BuildMethodType buildMethodType, IConfiguration configuration)
 {
     return(buildMethodType.GetBuildMethodSettingType().InvokeMember(null, BindingFlags.CreateInstance, null, null, new object[] { configuration }));
 }
Example #3
0
 public BuildSetting(IConfiguration configuration)
 {
     _buildMethodType    = BuildMethodTypeFrom(configuration.GetValue <string>("Method"));
     _buildMethodSetting = BuildMethodSettingFrom(_buildMethodType, configuration.GetSection("Config"));
 }