Skip to content

Commit

Permalink
Merge pull request #958 from MattKotsenas/refactor/dotnet-pack
Browse files Browse the repository at this point in the history
Switch from .nuspec files to project properties
+semver:fix
  • Loading branch information
EdwardCooke authored Sep 11, 2024
2 parents 1127009 + 55eab20 commit 00026fb
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 119 deletions.
11 changes: 6 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<Project>

<PropertyGroup>

<PackageProjectUrl>https://github.com/aaubry/YamlDotNet</PackageProjectUrl>
<PropertyGroup Label="Package properties">
<Authors>Antoine Aubry</Authors>
<PackageProjectUrl>https://github.com/aaubry/YamlDotNet/wiki</PackageProjectUrl>
<RepositoryUrl>https://github.com/aaubry/YamlDotNet</RepositoryUrl>
<Description>YamlDotNet is a .NET library for YAML. YamlDotNet provides low level parsing and emitting of YAML as well as a high level object model similar to XmlDocument. A serialization library is also included that allows to read and write objects from and to YAML streams.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright (c) Antoine Aubry and contributors</Copyright>
<PackageTags>yaml parser development library serialization</PackageTags>
</PropertyGroup>

<PropertyGroup>
<LangVersion>12.0</LangVersion>

</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>enable</Nullable>
<IncludeBuildOutput>false</IncludeBuildOutput><!-- Don't place the output assembly in the package's lib/ folder -->
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking><!-- Don't add the TargetFramework as a package dependency -->
</PropertyGroup>

<PropertyGroup Label="Package Properties">
<PackageId>YamlDotNet.Analyzers.StaticGenerator</PackageId>
<Authors>YamlDotNet Contributors</Authors>
<Description>Roslyn Code Generator that will generate a static context for use with YamlDotNet to support ahead-of-time and library trimming.</Description>
<PackageIcon>images/yamldotnet.png</PackageIcon>
</PropertyGroup>

<ItemGroup Label="Package Contents">
<None Include="../yamldotnet.png" Pack="true" PackagePath="images/yamldotnet.png" />
<None Include="$(OutputPath)/$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
Expand Down

This file was deleted.

45 changes: 7 additions & 38 deletions YamlDotNet/YamlDotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<WarningsAsErrors>true</WarningsAsErrors>

<Nullable>enable</Nullable>

<NetStandard>false</NetStandard>
<RealTargetFramework>$(TargetFramework)</RealTargetFramework>
</PropertyGroup>

<PropertyGroup Label="Package Properties">
<PackageId>YamlDotNet</PackageId>
<Description>YamlDotNet is a .NET library for YAML. YamlDotNet provides low level parsing and emitting of YAML as well as a high level object model similar to XmlDocument. A serialization library is also included that allows to read and write objects from and to YAML streams.</Description>
<PackageIcon>images/yamldotnet.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand All @@ -27,29 +31,9 @@
<NoWarn>1591;1574;8600;8602;8604</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<NetStandard>true</NetStandard>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<NetStandard>true</NetStandard>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<NetStandard>true</NetStandard>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0'">
<NetStandard>true</NetStandard>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<NetStandard>true</NetStandard>
</PropertyGroup>

<ItemGroup>
<None Include="../README.md" Pack="true" PackagePath="README.md" />
<None Include="../LICENSE.txt" Pack="true" PackagePath="LICENSE.txt" />
<None Include="../yamldotnet.png" Pack="true" PackagePath="images/yamldotnet.png" />
</ItemGroup>

<ItemGroup>
Expand All @@ -60,25 +44,10 @@
<DefineConstants>$(DefineConstants);RELEASE;TRACE;SIGNED</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(NetStandard)' == 'false'">
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup Condition="'$(NetStandard)' == 'false'">
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>

<ItemGroup Condition="'$(NetStandard)' == 'true'">
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
</ItemGroup>

<Target Name="Info" BeforeTargets="CoreCompile">
<Message Importance="high" Text=" " Condition="'$(RealTargetFramework)' != ''" />
<Message Importance="high" Text="==== Building $(RealTargetFramework) $(Empty.PadRight($([MSBuild]::Subtract(100, $(RealTargetFramework.Length))), '='))" Condition="'$(RealTargetFramework)' != ''" />
Expand Down
50 changes: 0 additions & 50 deletions YamlDotNet/YamlDotNet.nuspec

This file was deleted.

4 changes: 2 additions & 2 deletions tools/build/BuildDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ public static Task<List<NuGetPackage>> Pack(Options options, GitVersion version,
var result = new List<NuGetPackage>();
var verbosity = options.Verbose ? "detailed" : "minimal";
var buildDir = Path.Combine(BasePath, "YamlDotNet");
Run("nuget", $"pack YamlDotNet.nuspec -Version {version.NuGetVersion} -OutputDirectory bin -Symbols -SymbolPackageFormat snupkg", buildDir);
Run("dotnet", $"pack --no-build -p:PackageVersion={version.NuGetVersion} -p:ContinuousIntegrationBuild=true --output bin", buildDir);
var packagePath = Path.Combine(buildDir, "bin", $"YamlDotNet.{version.NuGetVersion}.nupkg");
result.Add(new NuGetPackage(packagePath, "YamlDotNet"));

if (PushSerializer)
{
buildDir = Path.Combine(BasePath, "YamlDotNet.Analyzers.StaticGenerator");
Run("nuget", $"pack YamlDotNet.Analyzers.StaticGenerator.nuspec -Version {version.NuGetVersion} -OutputDirectory bin -Symbols -SymbolPackageFormat snupkg", buildDir);
Run("dotnet", $"pack --no-build -p:PackageVersion={version.NuGetVersion} -p:ContinuousIntegrationBuild=true --output bin", buildDir);
packagePath = Path.Combine(buildDir, "bin", $"YamlDotNet.Analyzers.StaticGenerator.{version.NuGetVersion}.nupkg");
result.Add(new NuGetPackage(packagePath, "YamlDotNet.Analyzers.StaticGenerator"));
}
Expand Down

0 comments on commit 00026fb

Please sign in to comment.