Skip to content
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

Merged
merged 24 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
cb3e0ea
Removed NDesk.Options Library
JimmySanchezGlobant Jun 22, 2023
0f9174d
Merge branch 'DynamoDS:master' into DYN-5944
JimmySanchezGlobant Jun 23, 2023
4bb7b70
Removed Ndesk.Options from License and About Box
JimmySanchezGlobant Jun 23, 2023
d0b8b8d
Merge branch 'DynamoDS:master' into DYN-5944
JimmySanchezGlobant Jun 27, 2023
91fafcd
Fixed formatting and included CommandLine.dll
JimmySanchezGlobant Jun 27, 2023
2fb22c2
Moved references under .NET 4.8 ItemGroup
JimmySanchezGlobant Jun 27, 2023
61b2630
Moved more references under .NET 4.8 ItemGroup
JimmySanchezGlobant Jun 28, 2023
f1e6aec
Merge branch 'DynamoDS:master' into DYN-5944
JimmySanchezGlobant Jun 28, 2023
7cdc64c
Merge branch 'DynamoDS:master' into DYN-5944
JimmySanchezGlobant Jun 29, 2023
e855f59
Removed ILMerge and added dependencies directly to project
JimmySanchezGlobant Jun 29, 2023
324bb3e
Merge branch 'DYN-5944' of https://github.com/JimmySanchezGlobant/Dyn…
JimmySanchezGlobant Jun 29, 2023
fc1a09f
update
pinzart Jul 5, 2023
2e0af94
Merge branch 'DynamoDS:master' into DYN-5944
JimmySanchezGlobant Jul 5, 2023
33a1310
Update Md2Html.csproj
pinzart Jul 6, 2023
de6659d
Merge branch 'master' into pr/14106
pinzart Jul 6, 2023
4e5216a
Merge branch 'DYN-5944' of https://github.com/JimmySanchezGlobant/Dyn…
pinzart Jul 6, 2023
fc78c58
Update License.rtf
pinzart Jul 6, 2023
c819987
Update License.rtf
pinzart Jul 6, 2023
8e44108
Merge branch 'master' into pr/14106
pinzart Jul 12, 2023
ad9c4ef
Update License.rtf
pinzart Jul 12, 2023
2cf6b72
Merge branch 'master' into pr/14106
pinzart Jul 18, 2023
bda2f98
Update Md2Html.csproj
pinzart Jul 19, 2023
3d73767
Merge branch 'master' into pr/14106
pinzart Jul 19, 2023
4d6b5cb
Update License.rtf
pinzart Jul 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@ Copyright © 2021 Alexe Zimarev

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.

Ndesk.Options v.0.2.1.0:

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

System.Collections.Immutable v.1.4.0:
Copyright (c) 2017 .NET Foundation and Contributors
All rights reserved.
Expand Down
366 changes: 178 additions & 188 deletions doc/distrib/License.rtf

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/Dynamo.All.Net6.sln
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoSandbox", "DynamoSand
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssemblyRenamerCLI", "Tools\AssemblyRenamerCLI\AssemblyRenamerCLI.csproj", "{F382C3F8-C55C-4350-800A-3D13A94F8E13}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Md2Html", "Tools\Md2Html\Md2Html.csproj", "{0893F745-CB1A-427A-8E87-CA927273039A}"
Copy link
Member

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?

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreNodeModelsWpf", "Libraries\CoreNodeModelsWpf\CoreNodeModelsWpf.csproj", "{F5932F7D-8E34-4787-80B8-E7F9D996EDFF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkspaceDependencyViewExtension", "WorkspaceDependencyViewExtension\WorkspaceDependencyViewExtension.csproj", "{5E76AAB3-6302-473E-9655-081B53FB1419}"
EndProject
Expand Down Expand Up @@ -349,6 +350,10 @@ Global
{F382C3F8-C55C-4350-800A-3D13A94F8E13}.Debug|NET60_Windows.ActiveCfg = Debug|NET60_Windows
{F382C3F8-C55C-4350-800A-3D13A94F8E13}.Debug|NET60_Windows.Build.0 = Debug|NET60_Windows
{F382C3F8-C55C-4350-800A-3D13A94F8E13}.Release|NET60_Windows.ActiveCfg = Release|NET60_Windows
{0893F745-CB1A-427A-8E87-CA927273039A}.Debug|NET60_Windows.ActiveCfg = Debug|NET60_Windows
{0893F745-CB1A-427A-8E87-CA927273039A}.Debug|NET60_Windows.Build.0 = Debug|NET60_Windows
{0893F745-CB1A-427A-8E87-CA927273039A}.Release|NET60_Windows.ActiveCfg = Release|NET60_Windows
{0893F745-CB1A-427A-8E87-CA927273039A}.Release|NET60_Windows.Build.0 = Release|NET60_Windows
{F5932F7D-8E34-4787-80B8-E7F9D996EDFF}.Debug|NET60_Windows.ActiveCfg = Debug|NET60_Windows
{F5932F7D-8E34-4787-80B8-E7F9D996EDFF}.Debug|NET60_Windows.Build.0 = Debug|NET60_Windows
{F5932F7D-8E34-4787-80B8-E7F9D996EDFF}.Release|NET60_Windows.ActiveCfg = Release|NET60_Windows
Expand Down Expand Up @@ -431,6 +436,7 @@ Global
{4C2AEACC-617D-4B90-ADCD-FE294A43A68F} = {2C6A6573-28B0-4239-BD33-6AECCD25106C}
{0DD3E4ED-66AA-47FC-9EB9-2A0E6A0EA01B} = {D114C59C-CF66-4CC2-980F-9301FB4EA4E1}
{F382C3F8-C55C-4350-800A-3D13A94F8E13} = {D114C59C-CF66-4CC2-980F-9301FB4EA4E1}
{0893F745-CB1A-427A-8E87-CA927273039A} = {D114C59C-CF66-4CC2-980F-9301FB4EA4E1}
{F5932F7D-8E34-4787-80B8-E7F9D996EDFF} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
{5E76AAB3-6302-473E-9655-081B53FB1419} = {88D45B00-E564-41DB-B57C-9509646CAA49}
{47D2166C-5261-4093-9660-E72B7035E666} = {88D45B00-E564-41DB-B57C-9509646CAA49}
Expand Down
100 changes: 52 additions & 48 deletions src/Tools/Md2Html/Md2Html.csproj
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>
27 changes: 19 additions & 8 deletions src/Tools/Md2Html/Program.cs
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; }
Copy link
Member

Choose a reason for hiding this comment

The 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 / vs - or --, I can't remember for certain.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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)
Expand Down Expand Up @@ -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);

Copy link
Member

Choose a reason for hiding this comment

The 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();
}

Expand Down
45 changes: 31 additions & 14 deletions src/Tools/SignDynamo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography.X509Certificates;

using CommandLine;
using CommandLine.Text;
using DynamoCrypto;
using NDesk.Options;

namespace SignDynamo
{
internal class CMDLineOptions
{
[Option('i', "installer", Required = false, HelpText = "The path to the installer to sign.")]
public string Installer { get; set; } = String.Empty;

[Option('h', "help", Required = false, HelpText = "Show this message and exit.")]
public bool ShowHelp { get; set; }
}

class Program
{
private static byte[] privateBlob = null;
Expand Down Expand Up @@ -51,22 +60,30 @@ static void Main(string[] args)
private static bool ParseArguments(IEnumerable<string> args)
{
var showHelp = false;

var p = new OptionSet
var parser = new Parser(options =>
{
{"i:|installer","The path to the installer to sign.", v=> installerPath = v},
{"h|help", "Show this message and exit.", v=> showHelp = v != null}
};

options.IgnoreUnknownArguments = true; options.HelpWriter = Console.Out;
options.CaseSensitive = false;
});
var notParsed = new List<string>();

const string helpMessage = "Try 'SignDynamo --help' for more information.";

ParserResult<CMDLineOptions> parserResult;
var lineOptions = new CMDLineOptions();
var errors = new List<Error>();

try
{
notParsed = p.Parse(args);
parserResult = Parser.Default.ParseArguments<CMDLineOptions>(args)
.WithParsed(o => lineOptions = o)
.WithNotParsed(e => errors = (List<Error>)e);

errors.ForEach(x => notParsed.Add(x.ToString()));
installerPath = lineOptions.Installer;
showHelp = lineOptions.ShowHelp;
}
catch (OptionException e)
catch (AggregateException e)
{
Console.WriteLine(e.Message);
Console.WriteLine(helpMessage);
Expand All @@ -81,7 +98,7 @@ private static bool ParseArguments(IEnumerable<string> args)

if (showHelp)
{
ShowHelp(p);
ShowHelp(parserResult);
return false;
}

Expand All @@ -100,13 +117,13 @@ private static bool ParseArguments(IEnumerable<string> args)
return true;
}

private static void ShowHelp(OptionSet p)
private static void ShowHelp(ParserResult<CMDLineOptions> results)
{
Console.WriteLine("Usage: SignDynamo [OPTIONS]");
Console.WriteLine("Generate a signature file for a dynamo installer.");
Console.WriteLine();
Console.WriteLine("Options:");
p.WriteOptionDescriptions(Console.Out);
Console.WriteLine(HelpText.AutoBuild(results, null, null).ToString());
}
}
}
2 changes: 1 addition & 1 deletion src/Tools/SignDynamo/SignDynamo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<OutputPath>bin\$(Configuration)\</OutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NDesk.Options" Version="0.2.1" />
<PackageReference Include="CommandLineParser" Version="2.8.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\DynamoCrypto\DynamoCrypto.csproj">
JimmySanchezGlobant marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading