Skip to content

Commit 6f3640b

Browse files
committed
Fix/benchmarking (#3495)
* Initial stab at incorporating Elastic.BenchmarkDotNetExporter * WIP: use latest version of the exporter * update exporter * add es-net-abstractions appveyor myget feed as restore source * Update to latest exporter and temporary remove some of the benchmarks to quickly reduce the benchmark run time * re-enable benchmarking * make sure we report the repository as well * update paket targets * update to latest exporter and update the build scripts to use the new arguments * make sure Tests.ScratchPad uses the same BDNet version (cherry picked from commit 24b1bfb)
1 parent c5458a5 commit 6f3640b

17 files changed

+226
-1126
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ packages/*
4141
paket.exe
4242
paket-files/*.cached
4343

44+
BenchmarkDotNet.Artifacts
4445
build/*
4546
!build/tools
4647
!build/keys

.paket/Paket.Restore.targets

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,17 @@
141141

142142
<ItemGroup Condition="($(DesignTimeBuild) != true OR '$(PaketPropsLoaded)' != 'true') AND '@(PaketReferencesFileLines)' != '' " >
143143
<PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
144+
<Splits>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length)</Splits>
144145
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
145146
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
146147
<AllPrivateAssets>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4])</AllPrivateAssets>
147-
<CopyLocal>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
148+
<CopyLocal Condition="'$(Splits)' == '6'">$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5])</CopyLocal>
148149
</PaketReferencesFileLinesInfo>
149150
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
150151
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
151152
<PrivateAssets Condition=" ('%(PaketReferencesFileLinesInfo.AllPrivateAssets)' == 'true') Or ('$(PackAsTool)' == 'true') ">All</PrivateAssets>
152-
<ExcludeAssets Condition="%(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
153+
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
154+
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
153155
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
154156
</PackageReference>
155157
</ItemGroup>
@@ -182,19 +184,27 @@
182184
<Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
183185
<PropertyGroup>
184186
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
187+
<DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion>
188+
<DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion>
185189
</PropertyGroup>
186190
</Target>
187191

188192
<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" >
189193
<ItemGroup>
190194
<_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/>
195+
<MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" />
196+
<MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" />
191197
</ItemGroup>
192198

193199
<PropertyGroup>
194200
<PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
195201
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
196-
<UseNewPack>false</UseNewPack>
197-
<UseNewPack Condition=" '$(NuGetToolVersion)' != '4.0.0' ">true</UseNewPack>
202+
<UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack>
203+
<UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' > '15' OR ('@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8') ">true</UseMSBuild15_9_Pack>
204+
<UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack>
205+
<UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) ">true</UseMSBuild15_8_Pack>
206+
<UseNuGet4_Pack>false</UseNuGet4_Pack>
207+
<UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) ">true</UseNuGet4_Pack>
198208
<AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath>
199209
<AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath>
200210
</PropertyGroup>
@@ -209,9 +219,52 @@
209219
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
210220
</ConvertToAbsolutePath>
211221

212-
213222
<!-- Call Pack -->
214-
<PackTask Condition="$(UseNewPack)"
223+
<PackTask Condition="$(UseMSBuild15_9_Pack)"
224+
PackItem="$(PackProjectInputFile)"
225+
PackageFiles="@(_PackageFiles)"
226+
PackageFilesToExclude="@(_PackageFilesToExclude)"
227+
PackageVersion="$(PackageVersion)"
228+
PackageId="$(PackageId)"
229+
Title="$(Title)"
230+
Authors="$(Authors)"
231+
Description="$(Description)"
232+
Copyright="$(Copyright)"
233+
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
234+
LicenseUrl="$(PackageLicenseUrl)"
235+
ProjectUrl="$(PackageProjectUrl)"
236+
IconUrl="$(PackageIconUrl)"
237+
ReleaseNotes="$(PackageReleaseNotes)"
238+
Tags="$(PackageTags)"
239+
DevelopmentDependency="$(DevelopmentDependency)"
240+
BuildOutputInPackage="@(_BuildOutputInPackage)"
241+
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
242+
SymbolPackageFormat="symbols.nupkg"
243+
TargetFrameworks="@(_TargetFrameworks)"
244+
AssemblyName="$(AssemblyName)"
245+
PackageOutputPath="$(PackageOutputAbsolutePath)"
246+
IncludeSymbols="$(IncludeSymbols)"
247+
IncludeSource="$(IncludeSource)"
248+
PackageTypes="$(PackageType)"
249+
IsTool="$(IsTool)"
250+
RepositoryUrl="$(RepositoryUrl)"
251+
RepositoryType="$(RepositoryType)"
252+
SourceFiles="@(_SourceFiles->Distinct())"
253+
NoPackageAnalysis="$(NoPackageAnalysis)"
254+
MinClientVersion="$(MinClientVersion)"
255+
Serviceable="$(Serviceable)"
256+
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
257+
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
258+
NuspecOutputPath="$(AdjustedNuspecOutputPath)"
259+
IncludeBuildOutput="$(IncludeBuildOutput)"
260+
BuildOutputFolder="$(BuildOutputTargetFolder)"
261+
ContentTargetFolders="$(ContentTargetFolders)"
262+
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
263+
NuspecFile="$(NuspecFileAbsolutePath)"
264+
NuspecBasePath="$(NuspecBasePath)"
265+
NuspecProperties="$(NuspecProperties)"/>
266+
267+
<PackTask Condition="$(UseMSBuild15_8_Pack)"
215268
PackItem="$(PackProjectInputFile)"
216269
PackageFiles="@(_PackageFiles)"
217270
PackageFilesToExclude="@(_PackageFilesToExclude)"
@@ -254,7 +307,7 @@
254307
NuspecBasePath="$(NuspecBasePath)"
255308
NuspecProperties="$(NuspecProperties)"/>
256309

257-
<PackTask Condition="! $(UseNewPack)"
310+
<PackTask Condition="$(UseNuGet4_Pack)"
258311
PackItem="$(PackProjectInputFile)"
259312
PackageFiles="@(_PackageFiles)"
260313
PackageFilesToExclude="@(_PackageFilesToExclude)"

NuGet.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<configuration>
33
<packageSources>
44
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
5-
<add key="Elastic abstractions" value="https://www.myget.org/F/elasticsearch-net-abstractions-temp/api/v3/index.json" />
5+
<add key="Elastic Abstractions CI" value="https://ci.appveyor.com/nuget/elasticsearch-net-abstractions" />
66
</packageSources>
77
</configuration>

0 commit comments

Comments
 (0)