Skip to content

Commit 61a2c41

Browse files
authored
Merge pull request #437 from moh-hassan/master-revert
Resolving the build error in the master branch
2 parents 030eb8d + 28d1376 commit 61a2c41

File tree

8 files changed

+5
-49
lines changed

8 files changed

+5
-49
lines changed

Diff for: CommandLine.snk

1 Byte
Binary file not shown.

Diff for: appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#version should be only changed with RELEASE eminent, see RELEASE.md
2-
version: 2.4.{build}
2+
version: 2.5.{build}
33

44
image: Visual Studio 2017
55

Diff for: src/CommandLine/CommandLine.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<DefineConstants Condition="'$(BuildTarget)' != 'fsharp'">$(DefineConstants);SKIP_FSHARP</DefineConstants>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010
<AssemblyOriginatorKeyFile>..\..\CommandLine.snk</AssemblyOriginatorKeyFile>
11+
1112
<SignAssembly>true</SignAssembly>
1213
<PackageId Condition="'$(BuildTarget)' != 'fsharp'">CommandLineParser</PackageId>
1314
<PackageId Condition="'$(BuildTarget)' == 'fsharp'">CommandLineParser.FSharp</PackageId>

Diff for: src/CommandLine/Core/ReflectionExtensions.cs

-13
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ namespace CommandLine.Core
1414
{
1515
static class ReflectionExtensions
1616
{
17-
public const string CannotSetValueToTargetInstance = "Cannot set value to target instance.";
18-
1917
public static IEnumerable<T> GetSpecifications<T>(this Type type, Func<PropertyInfo, T> selector)
2018
{
2119
return from pi in type.FlattenHierarchy().SelectMany(x => x.GetTypeInfo().GetProperties())
@@ -93,10 +91,6 @@ public static IEnumerable<Error> SetProperties<T>(
9391

9492
private static IEnumerable<Error> SetValue<T>(this SpecificationProperty specProp, T instance, object value)
9593
{
96-
Action<Exception> fail = inner => {
97-
throw new InvalidOperationException(CannotSetValueToTargetInstance, inner);
98-
};
99-
10094
try
10195
{
10296
specProp.Property.SetValue(instance, value, null);
@@ -110,13 +104,6 @@ private static IEnumerable<Error> SetValue<T>(this SpecificationProperty specPro
110104
{
111105
return new[] { new SetValueExceptionError(specProp.Specification.FromSpecification(), e, value) };
112106
}
113-
catch(ArgumentException e)
114-
{
115-
var argEx = new ArgumentException(InvalidAttributeConfigurationError.ErrorMessage, e);
116-
fail(argEx);
117-
}
118-
119-
return instance;
120107
}
121108

122109
public static object CreateEmptyArray(this Type type)

Diff for: src/CommandLine/Error.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,7 @@ public enum ErrorType
6464
/// <summary>
6565
/// Value of <see cref="CommandLine.SetValueExceptionError"/> type.
6666
/// </summary>
67-
SetValueExceptionError,
68-
69-
VersionRequestedError,
70-
/// <summary>
71-
/// Value of <see cref="CommandLine.InvalidAttributeConfigurationError"/> type.
72-
/// </summary>
73-
InvalidAttributeConfigurationError
67+
SetValueExceptionError
7468
}
7569

7670
/// <summary>

Diff for: src/CommandLine/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
using System.Runtime.CompilerServices;
44

5-
[assembly: InternalsVisibleTo("CommandLine.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010015eb7571d696c075627830f9468969103bc35764467bdbccfc0850f2fbe6913ee233d5d7cf3bbcb870fd42e6a8cc846d706b5cef35389e5b90051991ee8b6ed73ee1e19f108e409be69af6219b2e31862405f4b8ba101662fbbb54ba92a35d97664fe65c90c2bebd07aef530b01b709be5ed01b7e4d67a6b01c8643e42a20fb4")]
5+
[assembly: InternalsVisibleTo("CommandLine.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010009ab24ef889cd26bf46f7eaeda28e0fa5c04c50c93c6e121337b154bca0a1fd58ac6cb86195b709c2120f482730ced04a0e167a5758e56d3464bfabafe022b31510c39a61968fde795480dd60f6a396015c5f69a942074a3f4654b6dd66d0c63608bea78bdf96b35b1b48bb75741c2caad1f70579f286f1dbc2c560511c648d2")]

Diff for: tests/CommandLine.Tests/Fakes/Options_With_InvalidDefaults.cs

-11
This file was deleted.

Diff for: tests/CommandLine.Tests/Unit/Core/InstanceBuilderTests.cs

+1-16
Original file line numberDiff line numberDiff line change
@@ -1133,21 +1133,6 @@ public void Parse_TimeSpan()
11331133
// Teardown
11341134
}
11351135

1136-
[Fact]
1137-
public void Build_DefaultBoolTypeString_ThrowsInvalidOperationException()
1138-
{
1139-
// Exercize system
1140-
Action test = () => InvokeBuild<Options_With_InvalidDefaults>(
1141-
new string[] { });
1142-
1143-
// Verify outcome
1144-
test.ShouldThrow<InvalidOperationException>()
1145-
.WithMessage(ReflectionExtensions.CannotSetValueToTargetInstance)
1146-
.WithInnerException<ArgumentException>()
1147-
.WithInnerMessage(InvalidAttributeConfigurationError.ErrorMessage);
1148-
}
1149-
1150-
11511136
[Fact]
11521137
public void OptionClass_IsImmutable_HasNoCtor()
11531138
{
@@ -1163,7 +1148,7 @@ private class ValueWithNoSetterOptions
11631148
}
11641149

11651150

1166-
public static IEnumerable<object> RequiredValueStringData
1151+
public static IEnumerable<object[]> RequiredValueStringData
11671152
{
11681153
get
11691154
{

0 commit comments

Comments
 (0)