diff --git a/.gitignore b/.gitignore index cee822a6..a7d34775 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,13 @@ src/CommandLine/bin/* src/CommandLine/obj +src/CommandLine.dotnet/bin/* +src/CommandLine.dotnet/obj demo/ReadText.Demo/bin/* demo/ReadText.Demo/obj tests/CommandLine.Tests/bin/* tests/CommandLine.Tests/obj +tests/CommandLine.DotNet.Tests/bin/* +tests/CommandLine.DotNet.Tests/obj tests/CommandLine.Tests.Properties/bin/* tests/CommandLine.Tests.Properties/obj src/templates/CSharpTemplate/bin/* @@ -31,3 +35,8 @@ StyleCop.Cache .fake *.cache docs/output/* +artifacts/* +.vs/* +*.xproj.user +*.nuget.targets +*.lock.json \ No newline at end of file diff --git a/CommandLine.sln b/CommandLine.sln index 096f28c0..a8488e86 100644 --- a/CommandLine.sln +++ b/CommandLine.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine", "src\CommandLine\CommandLine.csproj", "{E1BD3C65-49C3-49E7-BABA-C60980CB3F20}" EndProject @@ -23,6 +23,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine.Tests", "tests\CommandLine.Tests\CommandLine.Tests.csproj", "{0A15C4D2-B3E9-43AB-8155-1B39F7AC8A5E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine.dotnet", "src\CommandLine.dotnet\CommandLine.dotnet.csproj", "{1E72E75F-888A-400E-865C-44251B8013E1}" + ProjectSection(ProjectDependencies) = postProject + {E1BD3C65-49C3-49E7-BABA-C60980CB3F20} = {E1BD3C65-49C3-49E7-BABA-C60980CB3F20} + EndProjectSection +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "CommandLine.DotNet.Tests", "tests\CommandLine.DotNet.Tests\CommandLine.DotNet.Tests.xproj", "{C271A22B-B09A-44DA-A82D-8DF49135FA4C}" + ProjectSection(ProjectDependencies) = postProject + {1E72E75F-888A-400E-865C-44251B8013E1} = {1E72E75F-888A-400E-865C-44251B8013E1} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -37,6 +47,14 @@ Global {0A15C4D2-B3E9-43AB-8155-1B39F7AC8A5E}.Debug|Any CPU.Build.0 = Debug|Any CPU {0A15C4D2-B3E9-43AB-8155-1B39F7AC8A5E}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A15C4D2-B3E9-43AB-8155-1B39F7AC8A5E}.Release|Any CPU.Build.0 = Release|Any CPU + {1E72E75F-888A-400E-865C-44251B8013E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E72E75F-888A-400E-865C-44251B8013E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E72E75F-888A-400E-865C-44251B8013E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E72E75F-888A-400E-865C-44251B8013E1}.Release|Any CPU.Build.0 = Release|Any CPU + {C271A22B-B09A-44DA-A82D-8DF49135FA4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C271A22B-B09A-44DA-A82D-8DF49135FA4C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C271A22B-B09A-44DA-A82D-8DF49135FA4C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C271A22B-B09A-44DA-A82D-8DF49135FA4C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/global.json b/global.json new file mode 100644 index 00000000..3eb265a4 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "projects": [ + "wrap" + ] +} \ No newline at end of file diff --git a/nuget/CommandLine.nuspec b/nuget/CommandLine.nuspec index 0117ad51..9164e019 100644 --- a/nuget/CommandLine.nuspec +++ b/nuget/CommandLine.nuspec @@ -1,25 +1,44 @@ - - - - CommandLineParser - 2.0.275-beta - Command Line Parser Library - Giacomo Stelluti Scala - Terse syntax C# command line parser for .NET with F# support. The Command Line Parser Library offers to CLR applications a clean and concise API for manipulating command line arguments and related tasks. - - Copyright (c) 2005 - 2015 Giacomo Stelluti Scala - https://raw.githubusercontent.com/gsscoder/commandline/master/doc/LICENSE - https://github.com/gsscoder/commandline - Giacomo Stelluti Scala - https://raw.githubusercontent.com/gsscoder/commandline/master/art/CommandLine20.png - false - command line argument option parser parsing library syntax shell - - - - - - - - - + + + + CommandLineParser + 2.1.0-beta + Command Line Parser Library + Giacomo Stelluti Scala + Terse syntax C# command line parser for .NET with F# support. The Command Line Parser Library offers to CLR applications a clean and concise API for manipulating command line arguments and related tasks. + + Copyright (c) 2005 - 2015 Giacomo Stelluti Scala + https://raw.githubusercontent.com/gsscoder/commandline/master/doc/LICENSE + https://github.com/gsscoder/commandline + Giacomo Stelluti Scala + https://raw.githubusercontent.com/gsscoder/commandline/master/art/CommandLine20.png + false + command line argument option parser parsing library syntax shell + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/paket.lock b/paket.lock index b6ceb456..a222dd38 100644 --- a/paket.lock +++ b/paket.lock @@ -1,238 +1,238 @@ NUGET - remote: https://nuget.org/api/v2 + remote: https://www.nuget.org/api/v2 specs: FAKE (4.3.4) - FluentAssertions (4.0.0) - System.Collections (>= 4.0.10) - System.Diagnostics.Debug (>= 4.0.10) - System.Globalization (>= 4.0.10) - System.Linq (>= 4.0.0) - System.Linq.Expressions (>= 4.0.10) - System.ObjectModel (>= 4.0.10) - System.Reflection (>= 4.0.10) - System.Reflection.Extensions (>= 4.0.0) - System.Reflection.Primitives (>= 4.0.0) - System.Reflection.TypeExtensions (>= 4.0.0) - System.Runtime (>= 4.0.20) - System.Runtime.Extensions (>= 4.0.10) - System.Text.RegularExpressions (>= 4.0.10) - System.Threading (>= 4.0.10) - System.Threading.Tasks (>= 4.0.10) - System.Xml.XDocument (>= 4.0.10) + FluentAssertions (4.0) + System.Collections (>= 4.0.10) - framework: dnxcore50 + System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 + System.Globalization (>= 4.0.10) - framework: dnxcore50 + System.Linq (>= 4.0) - framework: dnxcore50 + System.Linq.Expressions (>= 4.0.10) - framework: dnxcore50 + System.ObjectModel (>= 4.0.10) - framework: dnxcore50 + System.Reflection (>= 4.0.10) - framework: dnxcore50 + System.Reflection.Extensions (>= 4.0) - framework: dnxcore50 + System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 + System.Reflection.TypeExtensions (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 + System.Text.RegularExpressions (>= 4.0.10) - framework: dnxcore50 + System.Threading (>= 4.0.10) - framework: dnxcore50 + System.Threading.Tasks (>= 4.0.10) - framework: dnxcore50 + System.Xml.XDocument (>= 4.0.10) - framework: dnxcore50 FsCheck (2.0.7) FSharp.Core (>= 3.1.2.5) FSharp.Compiler.Service (1.4.0.1) FSharp.Core (4.0.0.1) - FSharp.Formatting (2.10.0) + FSharp.Formatting (2.10) FSharp.Compiler.Service (>= 0.0.87) - FSharpVSPowerTools.Core (1.8.0) - FSharpVSPowerTools.Core (1.8.0) + FSharpVSPowerTools.Core (1.8) + FSharpVSPowerTools.Core (1.8) FSharp.Compiler.Service (>= 0.0.87) - System.Collections (4.0.10) - System.Diagnostics.Debug (>= 4.0.0) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0.0) - framework: dnxcore50 - System.Runtime (>= 4.0.0) - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0.0) - framework: dnxcore50 - System.Threading (>= 4.0.0) - framework: dnxcore50 - System.Diagnostics.Contracts (4.0.0) - framework: dnxcore50 - System.Runtime (>= 4.0.0) - System.Diagnostics.Debug (4.0.10) - System.Runtime (>= 4.0.0) - System.Globalization (4.0.10) - System.Runtime (>= 4.0.0) - System.IO (4.0.10) - System.Globalization (>= 4.0.0) - framework: dnxcore50 - System.Runtime (>= 4.0.20) - System.Text.Encoding (>= 4.0.0) + System.Collections (4.0.10) - framework: dnxcore50 + System.Diagnostics.Debug (>= 4.0) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Runtime.Extensions (>= 4.0) - framework: dnxcore50 + System.Threading (>= 4.0) - framework: dnxcore50 + System.Diagnostics.Contracts (4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Diagnostics.Debug (4.0.10) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Globalization (4.0.10) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.IO (4.0.10) - framework: dnxcore50 + System.Globalization (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Text.Encoding (>= 4.0) - framework: dnxcore50 System.Text.Encoding (>= 4.0.10) - framework: dnxcore50 - System.Text.Encoding.Extensions (>= 4.0.0) - framework: dnxcore50 - System.Threading (>= 4.0.0) - framework: dnxcore50 - System.Threading.Tasks (>= 4.0.0) - System.IO.FileSystem (4.0.0) + System.Text.Encoding.Extensions (>= 4.0) - framework: dnxcore50 + System.Threading (>= 4.0) - framework: dnxcore50 + System.Threading.Tasks (>= 4.0) - framework: dnxcore50 + System.IO.FileSystem (4.0) - framework: dnxcore50 System.Collections (>= 4.0.10) - framework: dnxcore50 System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 - System.IO (>= 4.0.0) + System.IO (>= 4.0) - framework: dnxcore50 System.IO (>= 4.0.10) - framework: dnxcore50 - System.IO.FileSystem.Primitives (>= 4.0.0) - System.Resources.ResourceManager (>= 4.0.0) - framework: dnxcore50 - System.Runtime (>= 4.0.0) + System.IO.FileSystem.Primitives (>= 4.0) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 System.Runtime (>= 4.0.20) - framework: dnxcore50 System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 - System.Runtime.Handles (>= 4.0.0) + System.Runtime.Handles (>= 4.0) - framework: dnxcore50 System.Runtime.InteropServices (>= 4.0.20) - framework: dnxcore50 - System.Runtime.WindowsRuntime (>= 4.0.0) - framework: dnxcore50 - System.Text.Encoding (>= 4.0.0) + System.Runtime.WindowsRuntime (>= 4.0) - framework: dnxcore50 + System.Text.Encoding (>= 4.0) - framework: dnxcore50 System.Text.Encoding (>= 4.0.10) - framework: dnxcore50 System.Text.Encoding.Extensions (>= 4.0.10) - framework: dnxcore50 System.Threading (>= 4.0.10) - framework: dnxcore50 - System.Threading.Overlapped (>= 4.0.0) - framework: dnxcore50 - System.Threading.Tasks (>= 4.0.0) + System.Threading.Overlapped (>= 4.0) - framework: dnxcore50 + System.Threading.Tasks (>= 4.0) - framework: dnxcore50 System.Threading.Tasks (>= 4.0.10) - framework: dnxcore50 - System.IO.FileSystem.Primitives (4.0.0) - System.Runtime (>= 4.0.20) - System.Linq (4.0.0) - System.Collections (>= 4.0.10) - System.Diagnostics.Debug (>= 4.0.10) - System.Resources.ResourceManager (>= 4.0.0) - System.Runtime (>= 4.0.20) - System.Runtime.Extensions (>= 4.0.10) - System.Linq.Expressions (4.0.10) - System.Collections (>= 4.0.0) - framework: dnxcore50 - System.Diagnostics.Debug (>= 4.0.0) - framework: dnxcore50 - System.Globalization (>= 4.0.0) - framework: dnxcore50 - System.IO (>= 4.0.0) - framework: dnxcore50 - System.Linq (>= 4.0.0) - framework: dnxcore50 - System.ObjectModel (>= 4.0.0) - framework: dnxcore50 - System.Reflection (>= 4.0.0) - System.Reflection.Emit (>= 4.0.0) - framework: dnxcore50 - System.Reflection.Extensions (>= 4.0.0) - framework: dnxcore50 - System.Reflection.Primitives (>= 4.0.0) - framework: dnxcore50 - System.Reflection.TypeExtensions (>= 4.0.0) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0.0) - framework: dnxcore50 - System.Runtime (>= 4.0.0) - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0.0) - framework: dnxcore50 - System.Threading (>= 4.0.0) - framework: dnxcore50 - System.ObjectModel (4.0.10) - System.Collections (>= 4.0.10) - System.Diagnostics.Debug (>= 4.0.10) - System.Resources.ResourceManager (>= 4.0.0) - System.Runtime (>= 4.0.20) - System.Threading (>= 4.0.10) - System.Private.Uri (4.0.0) - framework: dnxcore50 - System.Reflection (4.0.10) - System.IO (>= 4.0.0) - System.Reflection.Primitives (>= 4.0.0) - System.Runtime (>= 4.0.20) - System.Reflection.Emit (4.0.0) - framework: dnxcore50 - System.IO (>= 4.0.0) - System.Reflection (>= 4.0.0) - System.Reflection.Emit.ILGeneration (>= 4.0.0) - System.Reflection.Primitives (>= 4.0.0) - System.Runtime (>= 4.0.0) - System.Reflection.Emit.ILGeneration (4.0.0) - System.Reflection (>= 4.0.0) - System.Reflection.Primitives (>= 4.0.0) - System.Runtime (>= 4.0.0) - System.Reflection.Extensions (4.0.0) + System.IO.FileSystem.Primitives (4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Linq (4.0) - framework: dnxcore50 + System.Collections (>= 4.0.10) - framework: dnxcore50 System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 - System.Reflection (>= 4.0.0) + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 + System.Linq.Expressions (4.0.10) - framework: dnxcore50 + System.Collections (>= 4.0) - framework: dnxcore50 + System.Diagnostics.Debug (>= 4.0) - framework: dnxcore50 + System.Globalization (>= 4.0) - framework: dnxcore50 + System.IO (>= 4.0) - framework: dnxcore50 + System.Linq (>= 4.0) - framework: dnxcore50 + System.ObjectModel (>= 4.0) - framework: dnxcore50 + System.Reflection (>= 4.0) - framework: dnxcore50 + System.Reflection.Emit (>= 4.0) - framework: dnxcore50 + System.Reflection.Extensions (>= 4.0) - framework: dnxcore50 + System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 + System.Reflection.TypeExtensions (>= 4.0) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Runtime.Extensions (>= 4.0) - framework: dnxcore50 + System.Threading (>= 4.0) - framework: dnxcore50 + System.ObjectModel (4.0.10) - framework: dnxcore50 + System.Collections (>= 4.0.10) - framework: dnxcore50 + System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Threading (>= 4.0.10) - framework: dnxcore50 + System.Private.Uri (4.0) - framework: dnxcore50 + System.Reflection (4.0.10) - framework: dnxcore50 + System.IO (>= 4.0) - framework: dnxcore50 + System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Reflection.Emit (4.0) - framework: dnxcore50 + System.IO (>= 4.0) - framework: dnxcore50 + System.Reflection (>= 4.0) - framework: dnxcore50 + System.Reflection.Emit.ILGeneration (>= 4.0) - framework: dnxcore50 + System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Reflection.Emit.ILGeneration (4.0) - framework: dnxcore50 + System.Reflection (>= 4.0) - framework: dnxcore50 + System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Reflection.Extensions (4.0) - framework: dnxcore50 + System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 + System.Reflection (>= 4.0) - framework: dnxcore50 System.Reflection (>= 4.0.10) - framework: dnxcore50 - System.Reflection.Primitives (>= 4.0.0) - framework: dnxcore50 - System.Reflection.TypeExtensions (>= 4.0.0) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0.0) - framework: dnxcore50 - System.Runtime (>= 4.0.0) + System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 + System.Reflection.TypeExtensions (>= 4.0) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 System.Runtime (>= 4.0.20) - framework: dnxcore50 System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 - System.Reflection.Primitives (4.0.0) - System.Runtime (>= 4.0.0) - System.Threading (>= 4.0.0) - framework: dnxcore50 - System.Reflection.TypeExtensions (4.0.0) - System.Diagnostics.Contracts (>= 4.0.0) - framework: dnxcore50 + System.Reflection.Primitives (4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Threading (>= 4.0) - framework: dnxcore50 + System.Reflection.TypeExtensions (4.0) - framework: dnxcore50 + System.Diagnostics.Contracts (>= 4.0) - framework: dnxcore50 System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 - System.Linq (>= 4.0.0) - framework: dnxcore50 - System.Reflection (>= 4.0.0) + System.Linq (>= 4.0) - framework: dnxcore50 + System.Reflection (>= 4.0) - framework: dnxcore50 System.Reflection (>= 4.0.10) - framework: dnxcore50 - System.Reflection.Primitives (>= 4.0.0) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0.0) - framework: dnxcore50 - System.Runtime (>= 4.0.0) + System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 System.Runtime (>= 4.0.20) - framework: dnxcore50 System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 - System.Resources.ResourceManager (4.0.0) - framework: dnxcore50 - System.Globalization (>= 4.0.0) - System.Reflection (>= 4.0.0) + System.Resources.ResourceManager (4.0) - framework: dnxcore50 + System.Globalization (>= 4.0) - framework: dnxcore50 + System.Reflection (>= 4.0) - framework: dnxcore50 System.Reflection (>= 4.0.10) - framework: dnxcore50 - System.Runtime (>= 4.0.0) - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime (4.0.20) - System.Private.Uri (>= 4.0.0) - framework: dnxcore50 - System.Runtime.Extensions (4.0.10) - System.Runtime (>= 4.0.20) - System.Runtime.Handles (4.0.0) - System.Runtime (>= 4.0.0) - System.Runtime.InteropServices (4.0.20) - System.Reflection (>= 4.0.0) - System.Reflection.Primitives (>= 4.0.0) - System.Runtime (>= 4.0.0) - System.Runtime.Handles (>= 4.0.0) + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Runtime (4.0.20) - framework: dnxcore50 + System.Private.Uri (>= 4.0) - framework: dnxcore50 + System.Runtime.Extensions (4.0.10) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Runtime.Handles (4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Runtime.InteropServices (4.0.20) - framework: dnxcore50 + System.Reflection (>= 4.0) - framework: dnxcore50 + System.Reflection.Primitives (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Runtime.Handles (>= 4.0) - framework: dnxcore50 System.Runtime.WindowsRuntime (4.0.10) - framework: dnxcore50 System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 - System.Globalization (>= 4.0.0) - framework: dnxcore50 - System.IO (>= 4.0.0) + System.Globalization (>= 4.0) - framework: dnxcore50 + System.IO (>= 4.0) - framework: dnxcore50 System.IO (>= 4.0.10) - framework: dnxcore50 - System.ObjectModel (>= 4.0.0) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0.0) - framework: dnxcore50 - System.Runtime (>= 4.0.0) + System.ObjectModel (>= 4.0) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0.0) - framework: dnxcore50 + System.Runtime.Extensions (>= 4.0) - framework: dnxcore50 System.Runtime.InteropServices (>= 4.0.20) - framework: dnxcore50 System.Threading (>= 4.0.10) - framework: dnxcore50 - System.Threading.Tasks (>= 4.0.0) + System.Threading.Tasks (>= 4.0) - framework: dnxcore50 System.Threading.Tasks (>= 4.0.10) - framework: dnxcore50 - System.Text.Encoding (4.0.10) - System.Runtime (>= 4.0.0) - System.Text.Encoding.Extensions (4.0.10) - System.Runtime (>= 4.0.0) - System.Text.Encoding (>= 4.0.10) - System.Text.RegularExpressions (4.0.10) - System.Collections (>= 4.0.10) - System.Globalization (>= 4.0.10) - System.Resources.ResourceManager (>= 4.0.0) - System.Runtime (>= 4.0.20) - System.Runtime.Extensions (>= 4.0.10) - System.Threading (>= 4.0.10) - System.Threading (4.0.10) - System.Runtime (>= 4.0.0) - System.Threading.Tasks (>= 4.0.0) - System.Threading.Overlapped (4.0.0) - framework: dnxcore50 - System.Resources.ResourceManager (>= 4.0.0) - framework: dnxcore50 - System.Runtime (>= 4.0.0) - System.Runtime (>= 4.0.20) - framework: dnxcore50 - System.Runtime.Extensions (>= 4.0.0) - framework: dnxcore50 - System.Runtime.Handles (>= 4.0.0) + System.Text.Encoding (4.0.10) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Text.Encoding.Extensions (4.0.10) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Text.Encoding (>= 4.0.10) - framework: dnxcore50 + System.Text.RegularExpressions (4.0.10) - framework: dnxcore50 + System.Collections (>= 4.0.10) - framework: dnxcore50 + System.Globalization (>= 4.0.10) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 + System.Threading (>= 4.0.10) - framework: dnxcore50 + System.Threading (4.0.10) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Threading.Tasks (>= 4.0) - framework: dnxcore50 + System.Threading.Overlapped (4.0) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Runtime.Extensions (>= 4.0) - framework: dnxcore50 + System.Runtime.Handles (>= 4.0) - framework: dnxcore50 + System.Runtime.InteropServices (>= 4.0.20) - framework: dnxcore50 + System.Threading (>= 4.0.10) - framework: dnxcore50 + System.Threading.Tasks (4.0.10) - framework: dnxcore50 + System.Runtime (>= 4.0) - framework: dnxcore50 + System.Xml.ReaderWriter (4.0.10) - framework: dnxcore50 + System.Collections (>= 4.0.10) - framework: dnxcore50 + System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 + System.Globalization (>= 4.0.10) - framework: dnxcore50 + System.IO (>= 4.0.10) - framework: dnxcore50 + System.IO.FileSystem (>= 4.0) - framework: dnxcore50 + System.IO.FileSystem.Primitives (>= 4.0) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 System.Runtime.InteropServices (>= 4.0.20) - framework: dnxcore50 + System.Text.Encoding (>= 4.0.10) - framework: dnxcore50 + System.Text.Encoding.Extensions (>= 4.0.10) - framework: dnxcore50 + System.Text.RegularExpressions (>= 4.0.10) - framework: dnxcore50 + System.Threading.Tasks (>= 4.0.10) - framework: dnxcore50 + System.Xml.XDocument (4.0.10) - framework: dnxcore50 + System.Collections (>= 4.0.10) - framework: dnxcore50 + System.Diagnostics.Debug (>= 4.0.10) - framework: dnxcore50 + System.Globalization (>= 4.0.10) - framework: dnxcore50 + System.IO (>= 4.0.10) - framework: dnxcore50 + System.Reflection (>= 4.0.10) - framework: dnxcore50 + System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50 + System.Runtime (>= 4.0.20) - framework: dnxcore50 + System.Runtime.Extensions (>= 4.0.10) - framework: dnxcore50 + System.Text.Encoding (>= 4.0.10) - framework: dnxcore50 System.Threading (>= 4.0.10) - framework: dnxcore50 - System.Threading.Tasks (4.0.10) - System.Runtime (>= 4.0.0) - System.Xml.ReaderWriter (4.0.10) - System.Collections (>= 4.0.10) - System.Diagnostics.Debug (>= 4.0.10) - System.Globalization (>= 4.0.10) - System.IO (>= 4.0.10) - System.IO.FileSystem (>= 4.0.0) - System.IO.FileSystem.Primitives (>= 4.0.0) - System.Resources.ResourceManager (>= 4.0.0) - System.Runtime (>= 4.0.20) - System.Runtime.Extensions (>= 4.0.10) - System.Runtime.InteropServices (>= 4.0.20) - System.Text.Encoding (>= 4.0.10) - System.Text.Encoding.Extensions (>= 4.0.10) - System.Text.RegularExpressions (>= 4.0.10) - System.Threading.Tasks (>= 4.0.10) - System.Xml.XDocument (4.0.10) - System.Collections (>= 4.0.10) - System.Diagnostics.Debug (>= 4.0.10) - System.Globalization (>= 4.0.10) - System.IO (>= 4.0.10) - System.Reflection (>= 4.0.10) - System.Resources.ResourceManager (>= 4.0.0) - System.Runtime (>= 4.0.20) - System.Runtime.Extensions (>= 4.0.10) - System.Text.Encoding (>= 4.0.10) - System.Threading (>= 4.0.10) - System.Xml.ReaderWriter (>= 4.0.10) - xunit (2.0.0) - xunit.assert (2.0.0) - xunit.core (2.0.0) - xunit.abstractions (2.0.0) - xunit.assert (2.0.0) - xunit.core (2.0.0) - xunit.extensibility.core (2.0.0) - xunit.extensibility.core (2.0.0) - xunit.abstractions (2.0.0) - xunit.runner.console (2.0.0) - xunit.runner.visualstudio (2.0.1) + System.Xml.ReaderWriter (>= 4.0.10) - framework: dnxcore50 + xunit (2.0) + xunit.assert (2.0) + xunit.core (2.0) + xunit.abstractions (2.0) + xunit.assert (2.0) + xunit.core (2.0) + xunit.extensibility.core (2.0) + xunit.extensibility.core (2.0) + xunit.abstractions (2.0) + xunit.runner.console (2.0) + xunit.runner.visualstudio (2.1) - version_in_path: true GITHUB remote: gsscoder/CSharpx specs: diff --git a/src/CommandLine.dotnet/CommandLine.dotnet.csproj b/src/CommandLine.dotnet/CommandLine.dotnet.csproj new file mode 100644 index 00000000..50a5a1da --- /dev/null +++ b/src/CommandLine.dotnet/CommandLine.dotnet.csproj @@ -0,0 +1,269 @@ + + + + + 14.0 + Debug + AnyCPU + {1E72E75F-888A-400E-865C-44251B8013E1} + Library + Properties + CommandLine + CommandLine + en-US + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + v5.0 + ..\..\ + + + true + full + false + bin\portable-dotnet\Debug\ + TRACE;DEBUG;CSX_EITHER_INTERNAL; CSX_REM_EITHER_BEYOND_2; CSX_ENUM_INTERNAL; ERRH_INTERNAL; ERRH_DISABLE_INLINE_METHODS; CSX_MAYBE_INTERNAL; CSX_REM_EITHER_FUNC;PLATFORM_DOTNET + prompt + 4 + + + pdbonly + true + bin\portable-dotnet\Release\ + TRACE;CSX_EITHER_INTERNAL; CSX_REM_EITHER_BEYOND_2; CSX_ENUM_INTERNAL; ERRH_INTERNAL; ERRH_DISABLE_INLINE_METHODS; CSX_MAYBE_INTERNAL; CSX_REM_EITHER_FUNC;PLATFORM_DOTNET + prompt + 4 + + + + + + + true + + + ..\..\CommandLine.snk + + + + True + Infrastructure/ErrorHandling.cs + + + True + Infrastructure/EnumerableExtensions.cs + + + True + Infrastructure/Maybe.cs + + + + + BaseAttribute.cs + + + Core\ArgumentsExtensions.cs + + + Core\InstanceBuilder.cs + + + Core\InstanceChooser.cs + + + Core\KeyValuePairHelper.cs + + + Core\NameExtensions.cs + + + Core\NameLookup.cs + + + Core\OptionMapper.cs + + + Core\OptionSpecification.cs + + + Core\PreprocessorGuards.cs + + + Core\ReflectionExtensions.cs + + + Core\Scalar.cs + + + Core\Sequence.cs + + + Core\Specification.cs + + + Core\SpecificationExtensions.cs + + + Core\SpecificationGuards.cs + + + Core\SpecificationProperty.cs + + + Core\SpecificationPropertyExtensions.cs + + + Core\SpecificationPropertyRules.cs + + + Core\Switch.cs + + + Core\Token.cs + + + Core\Tokenizer.cs + + + Core\TokenPartitioner.cs + + + Core\TypeConverter.cs + + + Core\TypeDescriptor.cs + + + Core\TypeLookup.cs + + + Core\ValueMapper.cs + + + Core\ValueSpecification.cs + + + Core\Verb.cs + + + Error.cs + + + ErrorExtensions.cs + + + Infrastructure\EnumerableExtensions`1.cs + + + Infrastructure\ExceptionExtensions.cs + + + Infrastructure\FSharpOptionHelper.cs + + + Infrastructure\PopsicleSetter.cs + + + Infrastructure\ReflectionHelper.cs + + + Infrastructure\ResultExtensions.cs + + + Infrastructure\StringBuilderExtensions.cs + + + Infrastructure\StringExtensions.cs + + + NameInfo.cs + + + NullInstance.cs + + + OptionAttribute.cs + + + Parser.cs + + + ParserExtensions.cs + + + ParserResult.cs + + + ParserResultExtensions.cs + + + ParserSettings.cs + + + Properties\AssemblyInfo.cs + + + Text\AssemblyLicenseAttribute.cs + + + Text\AssemblyUsageAttribute.cs + + + Text\CopyrightInfo.cs + + + Text\Example.cs + + + Text\HeadingInfo.cs + + + Text\HelpText.cs + + + Text\MultiLineTextAttribute.cs + + + Text\SentenceBuilder.cs + + + Text\UsageAttribute.cs + + + UnParserExtensions.cs + + + ValueAttribute.cs + + + VerbAttribute.cs + + + Properties\SharedAssemblyInfo.cs + + + + + ..\..\packages\FSharp.Core\lib\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll + True + + + + + + + + + + + + + .NETStandard,Version=v1.3 + + \ No newline at end of file diff --git a/src/CommandLine.dotnet/paket.references b/src/CommandLine.dotnet/paket.references new file mode 100644 index 00000000..dc337e5d --- /dev/null +++ b/src/CommandLine.dotnet/paket.references @@ -0,0 +1,3 @@ +File:Maybe.cs Infrastructure +File:EnumerableExtensions.cs Infrastructure +File:ErrorHandling.cs Infrastructure diff --git a/src/CommandLine.dotnet/project.json b/src/CommandLine.dotnet/project.json new file mode 100644 index 00000000..9a36ab80 --- /dev/null +++ b/src/CommandLine.dotnet/project.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "NETStandard.Library": "1.5.0-rc2-24027", + "System.Linq.Expressions": "4.0.11-rc2-24027", + "System.Reflection.TypeExtensions": "4.1.0-rc2-24027" + }, + "frameworks": { + "netstandard1.3": { + } + } +} \ No newline at end of file diff --git a/src/CommandLine/CommandLine.csproj b/src/CommandLine/CommandLine.csproj index c2605663..1683d761 100644 --- a/src/CommandLine/CommandLine.csproj +++ b/src/CommandLine/CommandLine.csproj @@ -167,7 +167,16 @@ - + + + + ..\..\packages\FSharp.Core\lib\net40\FSharp.Core.dll + True + True + + + + ..\..\packages\FSharp.Core\lib\portable-net45+netcore45\FSharp.Core.dll @@ -176,10 +185,10 @@ - + - ..\..\packages\FSharp.Core\lib\net40\FSharp.Core.dll + ..\..\packages\FSharp.Core\lib\portable-net45+monoandroid10+monotouch10+xamarinios10\FSharp.Core.dll True True diff --git a/src/CommandLine/Core/InstanceBuilder.cs b/src/CommandLine/Core/InstanceBuilder.cs index b6921d82..cceff735 100644 --- a/src/CommandLine/Core/InstanceBuilder.cs +++ b/src/CommandLine/Core/InstanceBuilder.cs @@ -4,6 +4,9 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; +#if PLATFORM_DOTNET +using System.Reflection; +#endif using CommandLine.Infrastructure; using CSharpx; using RailwaySharp.ErrorHandling; diff --git a/src/CommandLine/Core/ReflectionExtensions.cs b/src/CommandLine/Core/ReflectionExtensions.cs index ac83fe85..7f1a690e 100644 --- a/src/CommandLine/Core/ReflectionExtensions.cs +++ b/src/CommandLine/Core/ReflectionExtensions.cs @@ -58,7 +58,7 @@ private static IEnumerable FlattenHierarchy(this Type type) { yield return @interface; } - foreach (var @interface in FlattenHierarchy(type.BaseType)) + foreach (var @interface in FlattenHierarchy(type.GetTypeInfo().BaseType)) { yield return @interface; } @@ -97,16 +97,20 @@ public static T SetProperties( private static T SetValue(this PropertyInfo property, T instance, object value) { - Action fail = inner => { throw new ApplicationException("Cannot set value to target instance.", inner); }; + Action fail = inner => { + throw new InvalidOperationException("Cannot set value to target instance.", inner); + }; try { property.SetValue(instance, value, null); } +#if !PLATFORM_DOTNET catch (TargetException e) { fail(e); } +#endif catch (TargetParameterCountException e) { fail(e); @@ -153,7 +157,7 @@ public static object CreateDefaultForImmutable(this Type type) { return string.Empty; } - if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>)) + if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>)) { return type.GetGenericArguments()[0].CreateEmptyArray(); } @@ -179,39 +183,27 @@ public static TypeInfo ToTypeInfo(this Type type) public static object StaticMethod(this Type type, string name, params object[] args) { - return type.InvokeMember( - name, - BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static, - null, - null, - args); + var methodInfo = type.GetMethod(name, BindingFlags.Public | BindingFlags.Static); + return methodInfo.Invoke(null, args); } public static object StaticProperty(this Type type, string name) { - return type.InvokeMember( - name, - BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Static, - null, - null, - new object[] { }); + var propertyInfo = type.GetProperty(name, BindingFlags.Public | BindingFlags.Static); + return propertyInfo.GetGetMethod().Invoke(null, null); } public static object InstanceProperty(this Type type, string name, object target) { - return type.InvokeMember( - name, - BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance, - null, - target, - new object[] { }); + var propertyInfo = type.GetProperty(name, BindingFlags.Public | BindingFlags.Instance); + return propertyInfo.GetGetMethod().Invoke(target, null); } public static bool IsPrimitiveEx(this Type type) { return - (type.IsValueType && type != typeof(Guid)) - || type.IsPrimitive + (type.GetTypeInfo().IsValueType && type != typeof(Guid)) + || type.GetTypeInfo().IsPrimitive || new [] { typeof(string) ,typeof(decimal) @@ -221,5 +213,23 @@ public static bool IsPrimitiveEx(this Type type) }.Contains(type) || Convert.GetTypeCode(type) != TypeCode.Object; } + + +#if !PLATFORM_DOTNET + public static Type GetTypeInfo(this Type type) + { + return type; + } +#else + public static Attribute[] GetCustomAttributes(this Type type, Type attributeType, bool inherit) + { + return type.GetTypeInfo().GetCustomAttributes(attributeType, inherit).ToArray(); + } + + public static Attribute[] GetCustomAttributes(this Assembly assembly, Type attributeType, bool inherit) + { + return assembly.GetCustomAttributes(attributeType).ToArray(); + } +#endif } } \ No newline at end of file diff --git a/src/CommandLine/Core/Specification.cs b/src/CommandLine/Core/Specification.cs index 74a09190..a0a46f7e 100644 --- a/src/CommandLine/Core/Specification.cs +++ b/src/CommandLine/Core/Specification.cs @@ -108,7 +108,7 @@ public static Specification FromProperty(PropertyInfo property) if (oa.Count() == 1) { var spec = OptionSpecification.FromAttribute(oa.Single(), property.PropertyType, - property.PropertyType.IsEnum + property.PropertyType.GetTypeInfo().IsEnum ? Enum.GetNames(property.PropertyType) : Enumerable.Empty()); if (spec.ShortName.Length == 0 && spec.LongName.Length == 0) @@ -122,7 +122,7 @@ public static Specification FromProperty(PropertyInfo property) if (va.Count() == 1) { return ValueSpecification.FromAttribute(va.Single(), property.PropertyType, - property.PropertyType.IsEnum + property.PropertyType.GetTypeInfo().IsEnum ? Enum.GetNames(property.PropertyType) : Enumerable.Empty()); } diff --git a/src/CommandLine/Core/SpecificationExtensions.cs b/src/CommandLine/Core/SpecificationExtensions.cs index cad4187f..d8a30bb4 100644 --- a/src/CommandLine/Core/SpecificationExtensions.cs +++ b/src/CommandLine/Core/SpecificationExtensions.cs @@ -47,7 +47,7 @@ public static IEnumerable ThrowingValidate(this IEnumerable guard.Item1(spec))) { - throw new ApplicationException(guard.Item2); + throw new InvalidOperationException(guard.Item2); } } diff --git a/src/CommandLine/Core/SpecificationPropertyExtensions.cs b/src/CommandLine/Core/SpecificationPropertyExtensions.cs index 5e26c18e..eeb79a89 100644 --- a/src/CommandLine/Core/SpecificationPropertyExtensions.cs +++ b/src/CommandLine/Core/SpecificationPropertyExtensions.cs @@ -3,6 +3,9 @@ using System; using System.Collections.Generic; using System.Linq; +#if PLATFORM_DOTNET +using System.Reflection; +#endif using CSharpx; namespace CommandLine.Core diff --git a/src/CommandLine/Core/TypeConverter.cs b/src/CommandLine/Core/TypeConverter.cs index 18df00a0..a06d3c3e 100644 --- a/src/CommandLine/Core/TypeConverter.cs +++ b/src/CommandLine/Core/TypeConverter.cs @@ -4,6 +4,9 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; +#if PLATFORM_DOTNET +using System.Reflection; +#endif using CommandLine.Infrastructure; using CSharpx; using RailwaySharp.ErrorHandling; @@ -26,7 +29,8 @@ private static Maybe ChangeTypeSequence(IEnumerable values, Type .SingleOrDefault() .ToMaybe() .FromJustOrFail( - new ApplicationException("Non scalar properties should be sequence of type IEnumerable.")); + new InvalidOperationException("Non scalar properties should be sequence of type IEnumerable.") + ); var converted = values.Select(value => ChangeTypeScalar(value, type, conversionCulture, ignoreValueCase)); @@ -71,7 +75,7 @@ private static Result ChangeTypeScalarImpl(string value, Type }; return value.IsBooleanString() - ? value.ToBoolean() : conversionType.IsEnum + ? value.ToBoolean() : conversionType.GetTypeInfo().IsEnum ? value.ToEnum(conversionType, ignoreValueCase) : safeChangeType(); }; diff --git a/src/CommandLine/Core/Verb.cs b/src/CommandLine/Core/Verb.cs index c2c00351..c186ee1d 100644 --- a/src/CommandLine/Core/Verb.cs +++ b/src/CommandLine/Core/Verb.cs @@ -3,6 +3,9 @@ using System; using System.Collections.Generic; using System.Linq; +#if PLATFORM_DOTNET +using System.Reflection; +#endif namespace CommandLine.Core { diff --git a/src/CommandLine/Infrastructure/FSharpOptionHelper.cs b/src/CommandLine/Infrastructure/FSharpOptionHelper.cs index 8166cd2d..86445857 100644 --- a/src/CommandLine/Infrastructure/FSharpOptionHelper.cs +++ b/src/CommandLine/Infrastructure/FSharpOptionHelper.cs @@ -1,4 +1,7 @@ using System; +#if PLATFORM_DOTNET +using System.Reflection; +#endif using CommandLine.Core; using Microsoft.FSharp.Core; diff --git a/src/CommandLine/Infrastructure/ReflectionHelper.cs b/src/CommandLine/Infrastructure/ReflectionHelper.cs index 9ada710b..a140fe47 100644 --- a/src/CommandLine/Infrastructure/ReflectionHelper.cs +++ b/src/CommandLine/Infrastructure/ReflectionHelper.cs @@ -13,7 +13,11 @@ static class ReflectionHelper public static Maybe GetAttribute() where TAttribute : Attribute { +#if !PLATFORM_DOTNET var assembly = Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly(); +#else + var assembly = typeof(ReflectionHelper).GetTypeInfo().Assembly; +#endif var attributes = assembly.GetCustomAttributes(typeof(TAttribute), false); return attributes.Length > 0 @@ -23,13 +27,21 @@ public static Maybe GetAttribute() public static string GetAssemblyName() { +#if !PLATFORM_DOTNET var assembly = Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly(); +#else + var assembly = typeof(ReflectionHelper).GetTypeInfo().Assembly; +#endif return assembly.GetName().Name; } public static string GetAssemblyVersion() { +#if !PLATFORM_DOTNET var assembly = Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly(); +#else + var assembly = typeof(ReflectionHelper).GetTypeInfo().Assembly; +#endif return assembly.GetName().Version.ToStringInvariant(); } diff --git a/src/CommandLine/Properties/AssemblyInfo.cs b/src/CommandLine/Properties/AssemblyInfo.cs index f86d4221..5f156a44 100644 --- a/src/CommandLine/Properties/AssemblyInfo.cs +++ b/src/CommandLine/Properties/AssemblyInfo.cs @@ -14,6 +14,14 @@ "846d706b5cef35389e5b90051991ee8b6ed73ee1e19f108e409be69af6219b2e31862405f4b8ba" + "101662fbbb54ba92a35d97664fe65c90c2bebd07aef530b01b709be5ed01b7e4d67a6b01c8643e" + "42a20fb4")] +#if PLATFORM_DOTNET +[assembly: InternalsVisibleTo("CommandLine.DotNet.Tests, PublicKey=" + + "002400000480000094000000060200000024000052534131000400000100010015eb7571d696c0" + + "75627830f9468969103bc35764467bdbccfc0850f2fbe6913ee233d5d7cf3bbcb870fd42e6a8cc" + + "846d706b5cef35389e5b90051991ee8b6ed73ee1e19f108e409be69af6219b2e31862405f4b8ba" + + "101662fbbb54ba92a35d97664fe65c90c2bebd07aef530b01b709be5ed01b7e4d67a6b01c8643e" + + "42a20fb4")] +#endif [assembly: InternalsVisibleTo("CommandLine.FSharp, PublicKey=" + "002400000480000094000000060200000024000052534131000400000100010015eb7571d696c0" + "75627830f9468969103bc35764467bdbccfc0850f2fbe6913ee233d5d7cf3bbcb870fd42e6a8cc" + diff --git a/src/CommandLine/Text/HelpText.cs b/src/CommandLine/Text/HelpText.cs index 8319094c..2003271c 100644 --- a/src/CommandLine/Text/HelpText.cs +++ b/src/CommandLine/Text/HelpText.cs @@ -654,8 +654,7 @@ private static Maybe>> GetUsageFromTy var prop = tuple.Item1; var attr = tuple.Item2; - var examples = (IEnumerable)prop - .GetValue(null, BindingFlags.Public | BindingFlags.Static | BindingFlags.GetProperty, null, null, null); + var examples = (IEnumerable)prop.GetGetMethod().Invoke(null, null); return Tuple.Create(attr, examples); }); diff --git a/tests/CommandLine.DotNet.Tests/CommandLine.DotNet.Tests.xproj b/tests/CommandLine.DotNet.Tests/CommandLine.DotNet.Tests.xproj new file mode 100644 index 00000000..3aeeb06c --- /dev/null +++ b/tests/CommandLine.DotNet.Tests/CommandLine.DotNet.Tests.xproj @@ -0,0 +1,19 @@ + + + + 14.0.25123 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + c271a22b-b09a-44da-a82d-8df49135fa4c + CommandLine.DotNet.Tests + .\obj + .\bin\ + + + + 2.0 + + + \ No newline at end of file diff --git a/tests/CommandLine.DotNet.Tests/project.json b/tests/CommandLine.DotNet.Tests/project.json new file mode 100644 index 00000000..e93e6345 --- /dev/null +++ b/tests/CommandLine.DotNet.Tests/project.json @@ -0,0 +1,39 @@ +{ + "version": "1.0.0-*", + "description": "CommandLine.DotNet.Tests", + + "buildOptions": { + "compile":{ + "include": [ + "../CommandLine.Tests/**/*.cs" + ] + } + }, + + "dependencies": { + "xunit": "2.1.0" + }, + + "testRunner": "xunit", + + "frameworks": { + "netcoreapp1.0": { + "buildOptions": { "define": [ "PLATFORM_DOTNET" ], "keyFile": "../../CommandLine.snk" }, + "dependencies": { + "CommandLine": { + "target": "project", + "version": "" + }, + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.0-rc2-3002702" + }, + "System.Reflection": "4.1.0-rc2-24027", + "System.Reflection.TypeExtensions": "4.1.0-rc2-24027", + "FluentAssertions": "4.2.2", + "dotnet-test-xunit": "1.0.0-rc2-build10015" + }, + "imports": [ "dotnet5.4", "dnxcore50", "portable-net451+win81" ] + } + } +} diff --git a/tests/CommandLine.Tests.Properties/CommandLine.Tests.Properties.csproj b/tests/CommandLine.Tests.Properties/CommandLine.Tests.Properties.csproj index 41681a1c..52ca0b2c 100644 --- a/tests/CommandLine.Tests.Properties/CommandLine.Tests.Properties.csproj +++ b/tests/CommandLine.Tests.Properties/CommandLine.Tests.Properties.csproj @@ -57,6 +57,72 @@ + + + + <__paket__xunit_runner_visualstudio_props>win81\xunit.runner.visualstudio + <__paket__xunit_runner_visualstudio_targets>win81\xunit.runner.visualstudio + + + + + <__paket__xunit_runner_visualstudio_props>net20\xunit.runner.visualstudio + + + + + <__paket__xunit_runner_visualstudio_props>wpa81\xunit.runner.visualstudio + <__paket__xunit_runner_visualstudio_targets>wpa81\xunit.runner.visualstudio + + + + + <__paket__xunit_runner_visualstudio_props>portable-net45+win8+wp8+wpa81\xunit.runner.visualstudio + + + + + + + + <__paket__xunit_core_props>win8\xunit.core + <__paket__xunit_core_targets>win8\xunit.core + + + + + <__paket__xunit_core_props>monoandroid\xunit.core + + + + + <__paket__xunit_core_props>monotouch\xunit.core + + + + + <__paket__xunit_core_props>wp8\xunit.core + <__paket__xunit_core_targets>wp8\xunit.core + + + + + <__paket__xunit_core_props>Xamarin.iOS\xunit.core + + + + + <__paket__xunit_core_props>portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core + + + + + <__paket__xunit_core_props>portable-win81+wpa81\xunit.core + <__paket__xunit_core_targets>portable-win81+wpa81\xunit.core + + + +