Skip to content

Commit

Permalink
Include symbols and deterministic build
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma committed Feb 21, 2024
1 parent 19d7875 commit 03a66b7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ TestResults
*.orig
Help/*
release/*
/_ReSharper.*
_ReSharper.*
*.pidb
*.userprefs
packages
Expand Down
26 changes: 11 additions & 15 deletions YamlDotNet/YamlDotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

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

<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' != 'netcoreapp3.1'">
Expand Down Expand Up @@ -49,6 +53,7 @@
</PropertyGroup>

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

Expand All @@ -58,37 +63,28 @@

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>$(DefineConstants);RELEASE;TRACE;SIGNED</DefineConstants>
<DebugSymbols>false</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
</PropertyGroup>

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

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp3.1|AnyCPU'">
<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</Version>
</PackageReference>
<PackageReference Include="System.ComponentModel.TypeConverter">
<Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.Debug">
<Version>4.3.0</Version>
</PackageReference>
<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">
<PropertyGroup>
<Empty></Empty>
</PropertyGroup>
<Message Importance="high" Text=" " Condition="'$(RealTargetFramework)' != ''" />
<Message Importance="high" Text="==== Building $(RealTargetFramework) $(Empty.PadRight($([MSBuild]::Subtract(100, $(RealTargetFramework.Length))), '='))" Condition="'$(RealTargetFramework)' != ''" />
</Target>
Expand Down
8 changes: 8 additions & 0 deletions YamlDotNet/YamlDotNet.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<icon>images/yamldotnet.png</icon>
<repository type="git" url="https://github.com/aaubry/YamlDotNet.git" />
<tags>yaml parser development library serialization</tags>
<readme>README.md</readme>
<dependencies>
<group targetFramework=".NETFramework4.7" />
<group targetFramework=".NETStandard2.0" />
Expand All @@ -24,23 +25,30 @@
</metadata>
<files>
<file src="bin/Release/net47/YamlDotNet.dll" target="lib/net47" />
<file src="bin/Release/net47/YamlDotNet.pdb" target="lib/net47" />
<file src="bin/Release/net47/YamlDotNet.xml" target="lib/net47" />

<file src="bin/Release/net60/YamlDotNet.dll" target="lib/net6.0" />
<file src="bin/Release/net60/YamlDotNet.pdb" target="lib/net6.0" />
<file src="bin/Release/net60/YamlDotNet.xml" target="lib/net6.0" />

<file src="bin/Release/net70/YamlDotNet.dll" target="lib/net7.0" />
<file src="bin/Release/net70/YamlDotNet.pdb" target="lib/net7.0" />
<file src="bin/Release/net70/YamlDotNet.xml" target="lib/net7.0" />

<file src="bin/Release/net80/YamlDotNet.dll" target="lib/net8.0" />
<file src="bin/Release/net80/YamlDotNet.pdb" target="lib/net8.0" />
<file src="bin/Release/net80/YamlDotNet.xml" target="lib/net8.0" />

<file src="bin/Release/netstandard2.0/YamlDotNet.dll" target="lib/netstandard2.0" />
<file src="bin/Release/netstandard2.0/YamlDotNet.pdb" target="lib/netstandard2.0" />
<file src="bin/Release/netstandard2.0/YamlDotNet.xml" target="lib/netstandard2.0" />

<file src="bin/Release/netstandard2.1/YamlDotNet.dll" target="lib/netstandard2.1" />
<file src="bin/Release/netstandard2.1/YamlDotNet.pdb" target="lib/netstandard2.1" />
<file src="bin/Release/netstandard2.1/YamlDotNet.xml" target="lib/netstandard2.1" />

<file src="../README.md" target="" />
<file src="../LICENSE.txt" target="" />
<file src="../yamldotnet.png" target="images/" />
</files>
Expand Down
6 changes: 3 additions & 3 deletions tools/build/BuildDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static Task<MetadataSet> SetMetadata(GitVersion version)
public static Task<SuccessfulBuild> Build(Options options, MetadataSet _)
{
var verbosity = options.Verbose ? "detailed" : "minimal";
Run("dotnet", $"build YamlDotNet.sln --configuration Release --verbosity {verbosity}", BasePath);
Run("dotnet", $"build YamlDotNet.sln --configuration Release --verbosity {verbosity} -p:ContinuousIntegrationBuild=true", BasePath);

return Task.FromResult(new SuccessfulBuild());
}
Expand All @@ -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", buildDir);
Run("nuget", $"pack YamlDotNet.nuspec -Version {version.NuGetVersion} -OutputDirectory bin -Symbols -SymbolPackageFormat snupkg", 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", buildDir);
Run("nuget", $"pack YamlDotNet.Analyzers.StaticGenerator.nuspec -Version {version.NuGetVersion} -OutputDirectory bin -Symbols -SymbolPackageFormat snupkg", 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 03a66b7

Please sign in to comment.