[nnyeah] Add dotnet tool support (#14914)

- Stores legacy XI/XM and NET6 XI/XM inside nuget (unused for now)

% dotnet nnyeah
  -h, -?, --help
  -i, --input=VALUE
  -o, --output=VALUE
  -v, --verbose
  -f, --force-overwrite
  -s, --suppress-warnings

% mv nupkg/nnyeah.0.1.0.nupkg nupkg/nnyeah.0.1.0.zip
% unzip nupkg/nnyeah.0.1.0.zip
Archive:  nupkg/nnyeah.0.1.0.zip
..
  inflating: content/legacy/Xamarin.iOS.dll
  inflating: content/legacy/Xamarin.Mac.dll
  inflating: content/net6/Microsoft.iOS.dll
  inflating: content/net6/Microsoft.macOS.dll
..



Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Update PackagePath for net libs

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
This commit is contained in:
Chris Hamons 2022-05-06 12:55:27 -05:00 коммит произвёл GitHub
Родитель 2eb220caae
Коммит a9cab8f1c1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 43 добавлений и 0 удалений

1
tools/nnyeah/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1 @@
nupkg/

Просмотреть файл

@ -13,3 +13,16 @@ nnyeah/bin/Debug/net5.0/nnyeah.dll: $(wildcard **/*.cs) $(wildcard **/*.csproj)
clean:
$(Q_BUILD) $(SYSTEM_DOTNET) build "/bl:$@.binlog" /restore $(MSBUILD_VERBOSITY) /t:Clean $(wildcard *.sln)
NUPKG_VERSION=$(shell grep '<PackageVersion>' nnyeah/nnyeah.csproj | sed 's_.*<PackageVersion>\(.*\)</PackageVersion>.*_\1_')
nuget::
$(Q) $(SYSTEM_DOTNET) pack nnyeah/nnyeah.csproj
$(Q) mkdir -p nupkg
$(Q) cp nnyeah/bin/Debug/nnyeah.$(NUPKG_VERSION).nupkg ./nupkg/nnyeah.$(NUPKG_VERSION).nupkg
nuget-install:: nuget
$(Q) dotnet tool install --add-source ./nupkg -g nnyeah
nuget-uninstall::
$(Q) dotnet tool uninstall --global nnyeah

Просмотреть файл

@ -5,6 +5,14 @@
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.MaciOS.Nnyeah</RootNamespace>
<Nullable>enable</Nullable>
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<ToolCommandName>dotnet-nnyeah</ToolCommandName>
<Authors>Microsoft</Authors>
<PackageVersion>0.1.0</PackageVersion>
<PackageDescription>Attempt to convert Xamarin nugets using nint and nfloat types to NET6.</PackageDescription>
<!-- We are adding .dll files to context/ for a reason -->
<NoWarn>NU5100;</NoWarn>
</PropertyGroup>
<ItemGroup>
@ -26,4 +34,25 @@
<DependentUpon>Errors.resx</DependentUpon>
</Compile>
</ItemGroup>
<Target Name="IncludeLegacy" BeforeTargets="_GetPackageFiles">
<PropertyGroup>
<ProjectRoot>$(MSBuildProjectDirectory)/../../..</ProjectRoot>
<LegacyiOSRoot>$(ProjectRoot)/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/lib/mono</LegacyiOSRoot>
<LegacyMacRoot>$(ProjectRoot)/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/git/lib/mono</LegacyMacRoot>
<NetRoot>$(MSBuildProjectDirectory)/../../../_build</NetRoot>
</PropertyGroup>
<ItemGroup>
<Content Include="$(LegacyiOSRoot)/Xamarin.iOS/Xamarin.iOS.dll;$(LegacyMacRoot)/Xamarin.Mac/Xamarin.Mac.dll">
<Pack>true</Pack>
<PackagePath>content/legacy</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="$(NetRoot)/Microsoft.iOS.Ref/ref/net$(BundledNETCoreAppTargetFrameworkVersion)/Microsoft.iOS.dll;$(NetRoot)/Microsoft.macOS.Ref/ref/net$(BundledNETCoreAppTargetFrameworkVersion)/Microsoft.macOS.dll">
<Pack>true</Pack>
<PackagePath>content/net</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Target>
</Project>