Skip to content

Commit 2020c0a

Browse files
committed
Fix/old connection random (#3391)
* FEATURE_HTTP_WEB_REQUEST is outdated both netstandard2x and net4x support it, rely on DOTNETCORE pragma only * update .editorconfig to make sure props and targets are formatted like xml and csproj * Move away from Directory.build.props for a more explicit inclusion approach, reformatted Solution items and moved scripts out of Solution items * Remove random old connection usage and add explict net461 testing back * Remove Tests\Directory.build.props it set a TESTINGNUGETPACKAGE pragma which was never used * cleanup namespaces on full .net HttpConnection alias class * Obsolete HttpWebRequestConnection on CoreFX since it does not reuse HttpClient instances * Revert "Remove Tests\Directory.build.props it set a TESTINGNUGETPACKAGE pragma which was never used" This reverts commit da2d826. * Remove setting of the TESTINGNUGETPACKAGE constant, not used anywher * Comment looping up for Directory.build.props for now * Add root Directory.build.props (for now only sets LangVersion to latest) (cherry picked from commit 8ca1e0b)
1 parent e1daca0 commit 2020c0a

38 files changed

+161
-133
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ indent_size = 4
1616
indent_style = space
1717
indent_size = 4
1818

19-
[*.{md,markdown,json,js,csproj,fsproj,targets}]
19+
[*.{md,markdown,json,js,csproj,fsproj,targets,targets,props}]
2020
indent_style = space
2121
indent_size = 2
2222

build/scripts/scripts.fsproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@
6161
<None Include="Commandline.fsx" />
6262
<None Include="Targets.fsx" />
6363
</ItemGroup>
64+
<ItemGroup>
65+
<Content Include="..\..\paket.bat"><Link>paket.bat</Link></Content>
66+
<Content Include="..\..\paket.dependencies"><Link>paket.bat</Link></Content>
67+
<Content Include="..\..\build.sh"><Link>paket.bat</Link></Content>
68+
<Content Include="..\..\build.bat"><Link>paket.bat</Link></Content>
69+
</ItemGroup>
6470
<PropertyGroup>
6571
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
6672
</PropertyGroup>

src/Artifacts.build.props

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))\src\Library.build.props" />
4+
<!--
5+
Sets up the properties for assemblies we want to publish to a separate output folder (outside of src) during our build process.
6+
e.g ApiGenerator we'd like to keep private but we do want to publish it to build/_output during our FAKE build
7+
-->
8+
<PropertyGroup>
9+
<OutputPath Condition="'$(OutputPathBaseDir)' != ''">$(OutputPathBaseDir)\$(MSBuildProjectName)\</OutputPath>
10+
</PropertyGroup>
11+
</Project>

src/CodeGeneration/ApiGenerator/ApiGenerator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))\src\Artifacts.build.props" />
34
<PropertyGroup>
45
<OutputType>Exe</OutputType>
56
<TargetFramework>netcoreapp2.1</TargetFramework>
@@ -17,5 +18,4 @@
1718
<PackageReference Include="RazorLight.Unofficial" Version="2.0.0-beta1.1" />
1819
<!--<PackageReference Include="RazorLight" Version="2.0.0-beta1" />-->
1920
</ItemGroup>
20-
<Import Project="..\..\outputpath.props" />
2121
</Project>

src/CodeGeneration/DocGenerator/Buildalyzer/ProjectAnalyzer.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ public Project Load()
119119
}
120120
}
121121

122+
123+
122124
// Tweaks the project file a bit to ensure a succesfull build
123125
private static XDocument TweakProjectDocument(XDocument projectDocument, string projectFolder)
124126
{
@@ -128,10 +130,12 @@ private static XDocument TweakProjectDocument(XDocument projectDocument, string
128130
if (att == null) continue;
129131

130132
var project = att.Value;
131-
if (project.EndsWith("Clients.Common.targets"))
132-
att.Value = Path.GetFullPath(Path.Combine(projectFolder, att.Value));
133-
else if (project.EndsWith("outputpath.props"))
134-
att.Value = Path.GetFullPath(Path.Combine(projectFolder, att.Value));
133+
134+
if (!ResolveKnownPropsPath(projectFolder, project, att, "PublishArtifacts.build.props"))
135+
{
136+
ResolveKnownPropsPath(projectFolder, project, att, "Artifacts.build.props");
137+
}
138+
ResolveKnownPropsPath(projectFolder, project, att, "Library.build.props");
135139
}
136140
// Add SkipGetTargetFrameworkProperties to every ProjectReference
137141
foreach (XElement projectReference in projectDocument.GetDescendants("ProjectReference").ToArray())
@@ -149,6 +153,17 @@ private static XDocument TweakProjectDocument(XDocument projectDocument, string
149153
return projectDocument;
150154
}
151155

156+
private static bool ResolveKnownPropsPath(string projectFolder, string project, XAttribute att, string buildPropFile)
157+
{
158+
if (!project.Contains(buildPropFile)) return false;
159+
var dir = new DirectoryInfo(projectFolder).Parent;
160+
while (dir != null && dir.Name != "src")
161+
dir = dir.Parent;
162+
if (dir == null) return true;
163+
att.Value = Path.GetFullPath(Path.Combine(dir.FullName, buildPropFile));
164+
return false;
165+
}
166+
152167
private ProjectCollection CreateProjectCollection()
153168
{
154169
ProjectCollection projectCollection = new ProjectCollection(_globalProperties);

src/CodeGeneration/DocGenerator/DocGenerator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))\src\Artifacts.build.props" />
34
<PropertyGroup>
45
<OutputType>Exe</OutputType>
56
<TargetFramework>netcoreapp2.1</TargetFramework>
@@ -17,5 +18,4 @@
1718
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.3.2" />
1819
<PackageReference Include="NuDoq" Version="1.2.5" />
1920
</ItemGroup>
20-
<Import Project="..\..\outputpath.props" />
2121
</Project>

src/Directory.build.props

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<!-- Default Version numbers -->
4-
<CurrentVersion>6.0.0</CurrentVersion>
5-
<CurrentAssemblyVersion>6.0.0</CurrentAssemblyVersion>
6-
<CurrentAssemblyFileVersion>6.0.0</CurrentAssemblyFileVersion>
7-
<!-- Version and Informational reflect actual version -->
8-
<Version>$(CurrentVersion)</Version>
9-
<InformationalVersion>$(CurrentVersion)</InformationalVersion>
10-
<!-- Assembly version is sticky to MAJOR.0.0.0 to avoid binding redirects because we strong name our assemblies -->
11-
<AssemblyVersion>$(CurrentAssemblyVersion)</AssemblyVersion>
12-
<!-- File version reflects actual version number without prelease since that not allowed in its struct -->
13-
<FileVersion>$(CurrentAssemblyFileVersion)</FileVersion>
14-
15-
<DefineConstants Condition="'$(TargetFramework)'=='netstandard2.0'">$(DefineConstants);DOTNETCORE</DefineConstants>
16-
17-
<RepoUri>https://raw.githubusercontent.com/elastic/elasticsearch-net</RepoUri>
18-
<Authors>Elasticsearch BV</Authors>
19-
<Copyright>Elasticsearch BV</Copyright>
20-
<PackageProjectUrl>https://github.com/elastic/elasticsearch-net</PackageProjectUrl>
21-
<PackageLicenseUrl>https://github.com/elastic/elasticsearch-net/blob/master/license.txt</PackageLicenseUrl>
22-
<ReleaseNotes>See https://github.com/elastic/elasticsearch-net/releases</ReleaseNotes>
23-
<PackageIconUrl>https://raw.githubusercontent.com/elastic/elasticsearch-net/master/build/nuget-icon.png</PackageIconUrl>
3+
<LangVersion>Latest</LangVersion>
244
</PropertyGroup>
255
</Project>

src/Elasticsearch.Net/Configuration/ConnectionConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.Security.Cryptography.X509Certificates;
88
using System.Threading;
99

10-
#if !FEATURE_HTTPWEBREQUEST
10+
#if DOTNETCORE
1111
using System.Net;
1212
using System.Net.Http;
1313
#endif
@@ -22,7 +22,7 @@ namespace Elasticsearch.Net
2222
public class ConnectionConfiguration : ConnectionConfiguration<ConnectionConfiguration>
2323
{
2424
internal static bool IsCurlHandler { get; } =
25-
#if !FEATURE_HTTPWEBREQUEST
25+
#if DOTNETCORE
2626
typeof(HttpClientHandler).Assembly().GetType("System.Net.Http.CurlHandler") != null;
2727
#else
2828
false;

src/Elasticsearch.Net/Connection/ClientCertificate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ THE SOFTWARE.
3636

3737
namespace Elasticsearch.Net
3838
{
39-
//.NET removed the setter for PrivateKey for X509Certificate, you'll have to manually convert to pfx/p12 or add the key to the machine store
39+
//.NET core removed the setter for PrivateKey for X509Certificate, you'll have to manually convert to pfx/p12 or add the key to the machine store
4040
#if !DOTNETCORE
4141

4242
public class ClientCertificate

src/Elasticsearch.Net/Connection/HttpConnection-CoreFx.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !FEATURE_HTTPWEBREQUEST
1+
#if DOTNETCORE
22
using System;
33
using System.Collections.Concurrent;
44
using System.Collections.Generic;
@@ -29,6 +29,8 @@ internal class WebProxy : IWebProxy
2929
public bool IsBypassed(Uri host) => host.IsLoopback;
3030
}
3131

32+
33+
/// <summary> The default IConnection implementation. Uses <see cref="HttpClient"/>.</summary>
3234
public class HttpConnection : IConnection
3335
{
3436
private readonly object _lock = new object();
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
#if FEATURE_HTTPWEBREQUEST
2-
using System;
3-
using System.Collections.Generic;
4-
using System.IO;
5-
using System.IO.Compression;
6-
using System.Linq;
1+
#if !DOTNETCORE
72
using System.Net;
8-
using System.Net.Security;
9-
using System.Text;
10-
using System.Threading;
11-
using System.Threading.Tasks;
123

134
namespace Elasticsearch.Net
145
{
15-
public class HttpConnection : HttpWebRequestConnection
16-
{
17-
}
6+
/// <summary> The default IConnection implementation. Uses <see cref="HttpWebRequest"/> on the current .NET desktop framework.</summary>
7+
public class HttpConnection : HttpWebRequestConnection { }
188
}
199
#endif

src/Elasticsearch.Net/Connection/HttpWebRequestConnection.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
namespace Elasticsearch.Net
1313
{
14+
#if DOTNETCORE
15+
[Obsolete("CoreFX HttpWebRequest uses HttpClient under the covers but does not reuse HttpClient instances, we'll therefor stop shipping with this class in the next major version")]
16+
#endif
1417
public class HttpWebRequestConnection : IConnection
1518
{
1619
internal static bool IsMono { get; } = Type.GetType("Mono.Runtime") != null;
@@ -59,6 +62,7 @@ protected virtual HttpWebRequest CreateWebRequest(RequestData requestData)
5962
request.Accept = requestData.Accept;
6063
request.ContentType = requestData.ContentType;
6164
#if !DOTNETCORE
65+
// on netstandard/netcoreapp2.0 this throws argument exception
6266
request.MaximumResponseHeadersLength = -1;
6367
#endif
6468
request.Pipelined = requestData.Pipelined;
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
3-
<Import Project="..\..\build\Clients.Common.targets" />
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))\src\PublishArtifacts.build.props" />
44
<PropertyGroup>
55
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">netstandard2.0;net461</TargetFrameworks>
66
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard2.0</TargetFrameworks>
77
</PropertyGroup>
88
<ItemGroup>
99
<PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
1010
</ItemGroup>
11-
<Import Project="..\outputpath.props" />
1211
</Project>

src/Elasticsearch.sln

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.27130.2003
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Build", "_Build", "{432D5575-2347-4D3C-BF8C-3E38410C46CA}"
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RelatedFiles", "RelatedFiles", "{432D5575-2347-4D3C-BF8C-3E38410C46CA}"
77
ProjectSection(SolutionItems) = preProject
8-
..\.editorconfig = ..\.editorconfig
9-
..\.gitignore = ..\.gitignore
10-
..\.travis.yml = ..\.travis.yml
11-
..\appveyor.yml = ..\appveyor.yml
12-
..\build.bat = ..\build.bat
13-
..\build.sh = ..\build.sh
14-
..\build\Clients.Common.targets = ..\build\Clients.Common.targets
15-
..\contributing.md = ..\contributing.md
16-
..\build\Elasticsearch.Net.nuspec = ..\build\Elasticsearch.Net.nuspec
17-
..\global.json = ..\global.json
18-
..\license.txt = ..\license.txt
19-
..\build\NEST.JsonNetSerializer.nuspec = ..\build\NEST.JsonNetSerializer.nuspec
20-
..\build\NEST.nuspec = ..\build\NEST.nuspec
21-
..\NuGet.config = ..\NuGet.config
22-
..\paket.bat = ..\paket.bat
23-
..\paket.dependencies = ..\paket.dependencies
24-
..\readme.md = ..\readme.md
25-
outputpath.props = outputpath.props
8+
..\src\PublishArtifacts.build.props = ..\src\PublishArtifacts.build.props
9+
..\src\Artifacts.build.props = ..\src\Artifacts.build.props
10+
..\src\Library.build.props = ..\src\Library.build.props
2611
Directory.build.props = Directory.build.props
2712
EndProjectSection
2813
EndProject
@@ -61,6 +46,30 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.Reproduce", "Tests\Te
6146
EndProject
6247
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.ScratchPad", "Tests\Tests.ScratchPad\Tests.ScratchPad.csproj", "{CE7AC1D4-15AF-47FB-83FA-F7137DFD9076}"
6348
EndProject
49+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{EAE89579-CCA9-45CE-AF83-3DCD98690EA8}"
50+
ProjectSection(SolutionItems) = preProject
51+
..\.editorconfig = ..\.editorconfig
52+
..\.gitignore = ..\.gitignore
53+
..\.travis.yml = ..\.travis.yml
54+
..\appveyor.yml = ..\appveyor.yml
55+
..\global.json = ..\global.json
56+
EndProjectSection
57+
EndProject
58+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nuget", "Nuget", "{C7865979-1D1C-46AF-BDE8-1DA6F3ED81B3}"
59+
ProjectSection(SolutionItems) = preProject
60+
..\build\NEST.JsonNetSerializer.nuspec = ..\build\NEST.JsonNetSerializer.nuspec
61+
..\build\NEST.nuspec = ..\build\NEST.nuspec
62+
..\NuGet.config = ..\NuGet.config
63+
..\build\Elasticsearch.Net.nuspec = ..\build\Elasticsearch.Net.nuspec
64+
EndProjectSection
65+
EndProject
66+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Markdown", "Markdown", "{2FABB663-F4DB-499A-89F8-3A08828D1D91}"
67+
ProjectSection(SolutionItems) = preProject
68+
..\contributing.md = ..\contributing.md
69+
..\license.txt = ..\license.txt
70+
..\readme.md = ..\readme.md
71+
EndProjectSection
72+
EndProject
6473
Global
6574
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6675
Debug|Any CPU = Debug|Any CPU
@@ -85,6 +94,9 @@ Global
8594
{8C119416-DB47-4971-A9EC-566217241D95} = {6C4A2627-AF22-4388-9DF7-7A9AEACFD635}
8695
{30FB80AE-3B37-4FBB-8450-9666969EEE1A} = {6C4A2627-AF22-4388-9DF7-7A9AEACFD635}
8796
{CE7AC1D4-15AF-47FB-83FA-F7137DFD9076} = {6C4A2627-AF22-4388-9DF7-7A9AEACFD635}
97+
{EAE89579-CCA9-45CE-AF83-3DCD98690EA8} = {432D5575-2347-4D3C-BF8C-3E38410C46CA}
98+
{C7865979-1D1C-46AF-BDE8-1DA6F3ED81B3} = {432D5575-2347-4D3C-BF8C-3E38410C46CA}
99+
{2FABB663-F4DB-499A-89F8-3A08828D1D91} = {432D5575-2347-4D3C-BF8C-3E38410C46CA}
88100
EndGlobalSection
89101
GlobalSection(ProjectConfigurationPlatforms) = postSolution
90102
{5B393962-7586-49BA-BD99-3B1E35F48E94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU

src/Library.build.props

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project>
2+
<!-- Sets up the common properties for all Elastic assemblies -->
3+
<PropertyGroup>
4+
<!-- Default Version numbers -->
5+
<CurrentVersion>5.0.0</CurrentVersion>
6+
<CurrentAssemblyVersion>5.0.0</CurrentAssemblyVersion>
7+
<CurrentAssemblyFileVersion>5.0.0</CurrentAssemblyFileVersion>
8+
<!-- Version and Informational reflect actual version -->
9+
<Version>$(CurrentVersion)</Version>
10+
<InformationalVersion>$(CurrentVersion)</InformationalVersion>
11+
<!-- Assembly version is sticky to MAJOR.0.0.0 to avoid binding redirects because we strong name our assemblies -->
12+
<AssemblyVersion>$(CurrentAssemblyVersion)</AssemblyVersion>
13+
<!-- File version reflects actual version number without prelease since that not allowed in its struct -->
14+
<FileVersion>$(CurrentAssemblyFileVersion)</FileVersion>
15+
16+
<DefineConstants Condition="'$(TargetFramework)'=='netstandard2.0'">$(DefineConstants);DOTNETCORE</DefineConstants>
17+
<DefineConstants Condition="'$(TargetFramework)'=='netcoreapp2.0'">$(DefineConstants);DOTNETCORE</DefineConstants>
18+
<DefineConstants Condition="'$(TargetFramework)'=='netcoreapp2.1'">$(DefineConstants);DOTNETCORE</DefineConstants>
19+
20+
<RepoUri>https://raw.githubusercontent.com/elastic/elasticsearch-net</RepoUri>
21+
<Authors>Elasticsearch BV</Authors>
22+
<Copyright>Elasticsearch BV</Copyright>
23+
<PackageProjectUrl>https://github.com/elastic/elasticsearch-net</PackageProjectUrl>
24+
<PackageLicenseUrl>https://github.com/elastic/elasticsearch-net/blob/master/license.txt</PackageLicenseUrl>
25+
<ReleaseNotes>See https://github.com/elastic/elasticsearch-net/releases</ReleaseNotes>
26+
<PackageIconUrl>https://raw.githubusercontent.com/elastic/elasticsearch-net/master/build/nuget-icon.png</PackageIconUrl>
27+
</PropertyGroup>
28+
</Project>

src/Nest/Nest.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
3-
<Import Project="..\..\build\Clients.Common.targets" />
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))\src\PublishArtifacts.build.props" />
44
<PropertyGroup>
55
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">netstandard2.0;net461</TargetFrameworks>
66
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard2.0</TargetFrameworks>
@@ -11,5 +11,4 @@
1111
<ItemGroup>
1212
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
1313
</ItemGroup>
14-
<Import Project="..\outputpath.props" />
1514
</Project>
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!--
4+
Sets up the properties for assemblies we intent to push to a NuGet server
5+
-->
6+
7+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))\src\Artifacts.build.props" />
38
<PropertyGroup>
49

510
<SignAssembly Condition="'$(OS)' == 'Windows_NT'">true</SignAssembly>
6-
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\keys\keypair.snk</AssemblyOriginatorKeyFile>
11+
<AssemblyOriginatorKeyFile>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))\build\keys\keypair.snk</AssemblyOriginatorKeyFile>
712
<GenerateDocumentationFile>true</GenerateDocumentationFile>
813
<NoWarn>1591,1572,1571,1573,1587,1570</NoWarn>
914
<Prefer32Bit>false</Prefer32Bit>
@@ -12,21 +17,19 @@
1217

1318
<DoSourceLink></DoSourceLink>
1419
<SourceLink Condition="'$(DoSourceLink)'!=''">$(BaseIntermediateOutputPath)\sl-$(MsBuildProjectName)-$(TargetFramework).json</SourceLink>
15-
1620
<!-- we need to referenced assemblies during the command line build so that ILRepack can pick them up -->
1721
<CopyLocalLockFileAssemblies Condition="'$(TargetFramework)'=='netstandard2.0'">true</CopyLocalLockFileAssemblies>
18-
<DefineConstants Condition="'$(TargetFramework)'=='net461'">$(DefineConstants);FEATURE_HTTPWEBREQUEST</DefineConstants>
19-
22+
2023
</PropertyGroup>
2124

2225
<Target Name="GenerateSourceLink" BeforeTargets="CoreCompile" Condition="'$(DoSourceLink)'!=''">
23-
<Delete Files="$(SourceLink)" Condition="Exists('$(SourceLink)')" />
26+
<Delete Files="$(SourceLink)" Condition="Exists('$(SourceLink)')"/>
2427
<Exec Command="git rev-parse HEAD" ConsoleToMSBuild="true">
25-
<Output TaskParameter="ConsoleOutput" PropertyName="LatestCommit" />
28+
<Output TaskParameter="ConsoleOutput" PropertyName="LatestCommit"/>
2629
</Exec>
2730
<Exec Command="git rev-parse --show-toplevel" ConsoleToMSBuild="true">
28-
<Output TaskParameter="ConsoleOutput" PropertyName="GitRootFolder" />
31+
<Output TaskParameter="ConsoleOutput" PropertyName="GitRootFolder"/>
2932
</Exec>
30-
<WriteLinesToFile File="$(SourceLink)" Lines="{&quot;documents&quot;: { &quot;$([System.IO.Path]::GetFullPath('$(GitRootFolder)/').Replace('\','\\'))*&quot; : &quot;$(RepoUri)/$(LatestCommit)/*&quot; }}" />
33+
<WriteLinesToFile File="$(SourceLink)" Lines="{&quot;documents&quot;: { &quot;$([System.IO.Path]::GetFullPath('$(GitRootFolder)/').Replace('\','\\'))*&quot; : &quot;$(RepoUri)/$(LatestCommit)/*&quot; }}"/>
3134
</Target>
3235
</Project>

0 commit comments

Comments
 (0)