-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DYN-5944 Removed NDesk.Options Library #14106
Changes from 20 commits
cb3e0ea
0f9174d
4bb7b70
d0b8b8d
91fafcd
2fb22c2
61b2630
f1e6aec
7cdc64c
e855f59
324bb3e
fc1a09f
2e0af94
33a1310
de6659d
4e5216a
fc78c58
c819987
8e44108
ad9c4ef
2cf6b72
bda2f98
3d73767
4d6b5cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,65 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ImportGroup Label="PropertySheets"> | ||
<Import Project="$(SolutionDir)Config\CS_SDK.props" /> | ||
</ImportGroup> | ||
<PropertyGroup> | ||
<ProjectGuid>{0893F745-CB1A-427A-8E87-CA927273039A}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>Md2Html</RootNamespace> | ||
<AssemblyName>Md2Html</AssemblyName> | ||
<SharedOutputPath>$(OutputPath)\Md2Html\</SharedOutputPath> | ||
<OutputPath>bin\AnyCPU\$(Configuration)\</OutputPath> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="HtmlSanitizer"> | ||
<Version>5.0.372</Version> | ||
</PackageReference> | ||
<PackageReference Include="ILMerge"> | ||
<Version>3.0.41</Version> | ||
</PackageReference> | ||
<PackageReference Include="Markdig"> | ||
<Version>0.22.0</Version> | ||
</PackageReference> | ||
<PackageReference Include="NDesk.Options"> | ||
<Version>0.2.1</Version> | ||
</PackageReference> | ||
</ItemGroup> | ||
<Target Name="AfterBuildOps" AfterTargets="Build"> | ||
<Exec Condition=" '$([MSBuild]::IsOSPlatform(`Windows`))' == 'True'" | ||
Command="if not exist $(SharedOutputPath) mkdir $(SharedOutputPath)"/> | ||
<!-- the ILMergePath property points to the location of ILMerge.exe console application --> | ||
<Exec Condition=" '$([MSBuild]::IsOSPlatform(`Windows`))' == 'True'" | ||
Command="$(ILMergeConsolePath) $(OutputPath)Md2Html.exe ^ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ImportGroup Label="PropertySheets"> | ||
<Import Project="$(SolutionDir)Config\CS_SDK.props" /> | ||
</ImportGroup> | ||
<PropertyGroup> | ||
<ProjectGuid>{0893F745-CB1A-427A-8E87-CA927273039A}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>Md2Html</RootNamespace> | ||
<AssemblyName>Md2Html</AssemblyName> | ||
<SharedOutputPath>$(OutputPath)\Md2Html\</SharedOutputPath> | ||
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' "> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
<SelfContained>false</SelfContained> | ||
</PropertyGroup> | ||
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' "> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
JimmySanchezGlobant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<ItemGroup> | ||
<PackageReference Include="CommandLineParser"> | ||
<Version>2.8.0</Version> | ||
</PackageReference> | ||
<PackageReference Include="HtmlSanitizer"> | ||
<Version>5.0.372</Version> | ||
</PackageReference> | ||
<PackageReference Include="ILMerge" Condition=" '$(TargetFramework)' == 'net48'"> | ||
<Version>3.0.41</Version> | ||
</PackageReference> | ||
<PackageReference Include="Markdig"> | ||
<Version>0.22.0</Version> | ||
</PackageReference> | ||
</ItemGroup> | ||
<Target Name="Publish net6" Condition=" '$(TargetFramework)' == 'net6.0' And '$([MSBuild]::IsOSPlatform(`Windows`))' == 'True' " AfterTargets="Build"> | ||
<CallTarget Targets="Publish" /> | ||
<Exec Command="if not exist $(SharedOutputPath) mkdir $(SharedOutputPath)"/> | ||
<Copy SourceFiles="$(OutputPath)win10-x64\publish\Md2Html.exe" DestinationFolder="$(SharedOutputPath)" /> | ||
</Target> | ||
<Target Name="AfterBuildOps" AfterTargets="Build" Condition=" '$(TargetFramework)' == 'net48' And '$([MSBuild]::IsOSPlatform(`Windows`))' == 'True'"> | ||
<Exec Command="if not exist $(SharedOutputPath) mkdir $(SharedOutputPath)"/> | ||
<!-- the ILMergePath property points to the location of ILMerge.exe console application --> | ||
<Exec Command="$(ILMergeConsolePath) $(OutputPath)Md2Html.exe ^ | ||
/allowDup ^ | ||
/lib:$(OutputPath) ^ | ||
/out:$(SharedOutputPath)Md2Html.exe ^ | ||
AngleSharp.Css.dll ^ | ||
AngleSharp.dll ^ | ||
HtmlSanitizer.dll ^ | ||
Markdig.dll ^ | ||
NDesk.Options.dll ^ | ||
CommandLine.dll ^ | ||
System.Buffers.dll ^ | ||
System.Memory.dll ^ | ||
System.Numerics.Vectors.dll ^ | ||
System.Runtime.CompilerServices.Unsafe.dll ^ | ||
System.Text.Encoding.CodePages.dll " /> | ||
<Exec Condition=" '!$([MSBuild]::IsOSPlatform(`Windows`))' == 'True' " | ||
Command="mkdir -p $(SharedOutputPath)"/> | ||
<Exec Condition=" '!$([MSBuild]::IsOSPlatform(`Windows`))' == 'True' " | ||
Command="cp $(OutputPath)*.* $(SharedOutputPath)"/> | ||
</Target> | ||
<Copy SourceFiles="$(OutputPath)Md2Html.exe" DestinationFolder="$(SharedOutputPath)" /> | ||
</Target> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
using System; | ||
using System; | ||
using System.IO; | ||
using NDesk.Options; | ||
using CommandLine; | ||
using CommandLine.Text; | ||
|
||
namespace Md2Html | ||
{ | ||
internal class CMDLineOptions | ||
{ | ||
[Option('h', "help", Required = false, HelpText = "Show help and exit")] | ||
public bool ShowHelp { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pinzart90 ... two thoughts - I don't see that this PR updates any of the tests. I think that ndesk options and command line parser require setting flags differently... ie Have you tried running the docs browser tests locally? Perhaps the markdown converter tool is never shutting down causing some kind of deadlock in the test runner etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mjkkirschner good catch, the md2html tests do seem to hang locally. Hopefully it is the same cause on the build machine |
||
} | ||
|
||
static class Program | ||
{ | ||
static void Main(string[] args) | ||
|
@@ -82,15 +89,19 @@ static string GetData() | |
static bool CheckForHelp(string[] args) | ||
{ | ||
bool help = false; | ||
var options = new OptionSet() | ||
{ | ||
{@"h|?|help", @"Show help and exit", v => help = v != null }, | ||
}; | ||
var parser = new Parser(options => { | ||
options.IgnoreUnknownArguments = true; options.HelpWriter = Console.Out; | ||
options.CaseSensitive = false; | ||
}); | ||
var results = parser.ParseArguments<CMDLineOptions>(args); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. guess it's also possible that this is somehow messing with Console.Out or modifying the input argument list so it never makes its way to the rest of the Main function? |
||
help = results.MapResult((cmdArgs) => { | ||
return cmdArgs.ShowHelp; | ||
}, errs => false); | ||
|
||
options.Parse(args); | ||
if (help) | ||
{ | ||
options.WriteOptionDescriptions(Console.Out); | ||
Console.WriteLine(HelpText.AutoBuild(results, null, null).ToString()); | ||
DisplayHelp(); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinzart90 looks like a missing
EndProject
tag maybe messing up the build somehow?