Skip to content

Commit

Permalink
(chocolateyGH-15)(config) Add features section
Browse files Browse the repository at this point in the history
Adding this will allow feature flagging new features.c
  • Loading branch information
ferventcoder committed Jan 18, 2015
1 parent 6038194 commit a024b03
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/chocolatey/chocolatey.csproj
Expand Up @@ -86,6 +86,7 @@
<Compile Include="infrastructure.app\commands\ChocolateySourceCommand.cs" />
<Compile Include="infrastructure.app\commands\ChocolateyUninstallCommand.cs" />
<Compile Include="infrastructure.app\commands\ChocolateyUpgradeCommand.cs" />
<Compile Include="infrastructure.app\configuration\ConfigFileFeatureSetting.cs" />
<Compile Include="infrastructure.app\domain\SourceCommandType.cs" />
<Compile Include="infrastructure.app\messages\PostRunEvent.cs" />
<Compile Include="infrastructure.app\nuget\NugetPush.cs" />
Expand Down Expand Up @@ -214,7 +215,9 @@
<EmbeddedResource Include="infrastructure\logging\log4net.config.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="infrastructure.app\configuration\chocolatey.config" />
<EmbeddedResource Include="infrastructure.app\configuration\chocolatey.config">
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="targets\Microsoft.Application.targets" />
</ItemGroup>
Expand Down
@@ -0,0 +1,34 @@
// Copyright © 2011 - Present RealDimensions Software, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace chocolatey.infrastructure.app.configuration
{
using System;
using System.Xml.Serialization;

/// <summary>
/// XML config file features element
/// </summary>
[Serializable]
[XmlType("feature")]
public sealed class ConfigFileFeatureSetting
{
[XmlAttribute(AttributeName = "id")]
public string Id { get; set; }

[XmlAttribute(AttributeName = "enabled")]
public bool Enabled { get; set; }
}
}
Expand Up @@ -42,7 +42,10 @@ public class ConfigFileSettings
public int CommandExecutionTimeoutSeconds { get; set; }

[XmlArray("sources")]
public HashSet<ConfigFileSourceSetting> Sources { get; set; }
public HashSet<ConfigFileSourceSetting> Sources { get; set; }

[XmlArray("features")]
public HashSet<ConfigFileFeatureSetting> Features { get; set; }

[XmlArray("apiKeys")]
public HashSet<ConfigFileApiKeySetting> ApiKeys { get; set; }
Expand Down

0 comments on commit a024b03

Please sign in to comment.