Skip to content

Commit 8db0889

Browse files
authored
Feature/new new csproj (elastic#2711)
* moved solely to new new csproj file, removing old project.json/xproj stuff and cleaning up existing csproj files * fixed dependencies of all projects now compiles in 2017 using the new new csproj files * fixate global.json to SDK tooling 1.0.1 and fix annoying warnings * Moved to new new csproj file * remove azure deployment file * post rebase touchups, added new dependencies to DocGenerator * DocGenerator now uses latest roslyn and is able to load new new csproj files. It also returns an exit code of 1 in case something bad happens which should fail the build * post rebase fixes, mainly making sure we bumped the same versions as in 5.x master and 2.x * versioning of assembly, file and product now exactly the same as before the move to new new csproj * travis still called build quick this is now called 'build inc' * removed quick target from build.sh * add dotnet 1.0.1 as dep for travis * move travis to trusty * added dotnetcore only sln for non windows platforms pending #dotnet/sdk/826 * dotnet core on non windows does not support signing or embedded pdbs * updated Bogus to version that depends on 10.0.1 * added explicit appveyor.yml * update appveyor.yml * update appveyor.yml * make test disposable more resilliant on linux
1 parent 815c8ef commit 8db0889

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+670
-12081
lines changed

.deployment

-2
This file was deleted.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ build/tools/*
5252
!build/*.ps1
5353
!build/*.nuspec
5454
!build/*.png
55+
!build/*.targets
5556
!build/scripts
5657

5758

.paket/Paket.Restore.targets

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<!-- Mark that this target file has been loaded. -->
4+
<IsPaketRestoreTargetsFileLoaded>true</IsPaketRestoreTargetsFileLoaded>
5+
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
6+
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
7+
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
8+
<!-- Paket command -->
9+
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
10+
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
11+
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
12+
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
13+
</PropertyGroup>
14+
15+
<Target Name="PaketRestore" BeforeTargets="_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" >
16+
17+
<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" ' />
18+
19+
<PropertyGroup>
20+
<PaketReferencesFilePath>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references</PaketReferencesFilePath>
21+
</PropertyGroup>
22+
23+
<ReadLinesFromFile File="$(PaketReferencesFilePath)" >
24+
<Output TaskParameter="Lines" ItemName="PaketReferencesFileLines"/>
25+
</ReadLinesFromFile>
26+
27+
<ItemGroup Condition=" '@(PaketReferencesFileLines)' != '' " >
28+
<PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
29+
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
30+
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
31+
</PaketReferencesFileLinesInfo>
32+
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
33+
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
34+
</PackageReference>
35+
</ItemGroup>
36+
37+
<PropertyGroup>
38+
<RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
39+
</PropertyGroup>
40+
41+
</Target>
42+
43+
<Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" >
44+
<PropertyGroup>
45+
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
46+
</PropertyGroup>
47+
</Target>
48+
49+
<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" >
50+
<PropertyGroup>
51+
<PaketReferencesFilePath>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references</PaketReferencesFilePath>
52+
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
53+
</PropertyGroup>
54+
55+
<ItemGroup>
56+
<_NuspecFiles Include="$(BaseIntermediateOutputPath)*.nuspec"/>
57+
</ItemGroup>
58+
59+
<Exec Command='$(PaketCommand) fix-nuspec file "@(_NuspecFiles)" references-file "$(PaketReferencesFilePath)" ' />
60+
61+
<ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
62+
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
63+
</ConvertToAbsolutePath>
64+
65+
<!-- Call Pack -->
66+
<PackTask PackItem="$(PackProjectInputFile)"
67+
PackageFiles="@(_PackageFiles)"
68+
PackageFilesToExclude="@(_PackageFilesToExclude)"
69+
PackageVersion="$(PackageVersion)"
70+
PackageId="$(PackageId)"
71+
Title="$(Title)"
72+
Authors="$(Authors)"
73+
Description="$(Description)"
74+
Copyright="$(Copyright)"
75+
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
76+
LicenseUrl="$(PackageLicenseUrl)"
77+
ProjectUrl="$(PackageProjectUrl)"
78+
IconUrl="$(PackageIconUrl)"
79+
ReleaseNotes="$(PackageReleaseNotes)"
80+
Tags="$(PackageTags)"
81+
TargetPathsToAssemblies="@(_TargetPathsToAssemblies->'%(FinalOutputPath)')"
82+
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
83+
TargetFrameworks="@(_TargetFrameworks)"
84+
AssemblyName="$(AssemblyName)"
85+
PackageOutputPath="$(PackageOutputAbsolutePath)"
86+
IncludeSymbols="$(IncludeSymbols)"
87+
IncludeSource="$(IncludeSource)"
88+
PackageTypes="$(PackageType)"
89+
IsTool="$(IsTool)"
90+
RepositoryUrl="$(RepositoryUrl)"
91+
RepositoryType="$(RepositoryType)"
92+
SourceFiles="@(_SourceFiles->Distinct())"
93+
NoPackageAnalysis="$(NoPackageAnalysis)"
94+
MinClientVersion="$(MinClientVersion)"
95+
Serviceable="$(Serviceable)"
96+
AssemblyReferences="@(_References)"
97+
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
98+
NuspecOutputPath="$(BaseIntermediateOutputPath)"
99+
IncludeBuildOutput="$(IncludeBuildOutput)"
100+
BuildOutputFolder="$(BuildOutputTargetFolder)"
101+
ContentTargetFolders="$(ContentTargetFolders)"
102+
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
103+
NuspecFile="$(NuspecFileAbsolutePath)"
104+
NuspecBasePath="$(NuspecBasePath)"
105+
NuspecProperties="$(NuspecProperties)"/>
106+
</Target>
107+
108+
</Project>

.paket/paket.targets

-40
This file was deleted.

.travis.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
language: csharp
22
solution: src/Elasticsearch.sln
3-
script: ./build.sh quick
3+
script: ./build.sh inc
4+
dist: trusty
45
mono: 4.6.2
6+
dotnet: 1.0.1
7+
env:
8+
global:
9+
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
10+
- DOTNET_CLI_TELEMETRY_OPTOUT: 1

appveyor.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 1.0.{build}
2+
image: Visual Studio 2017
3+
build_script:
4+
- cmd: build.bat
5+
test: off
6+
environment:
7+
DOTNET_CLI_TELEMETRY_OPTOUT: true
8+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

build.bat

+7-8
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,22 @@ IF /I "%1"=="skiptests" (
3838
IF NOT [%1]==[] (set TARGET=%1)
3939

4040
SET SKIPPAKET=0
41-
IF /I "%TARGET%"=="quick" SET SKIPPAKET=1
42-
IF /I "%TARGET%"=="forever" SET SKIPPAKET=1
41+
IF /I "%TARGET%"=="inc" SET SKIPPAKET=1
42+
IF /I "%TARGET%"=="canary" SET SKIPTESTS=1
4343

4444
IF "%SKIPPAKET%" neq "1" (
4545
.paket\paket.bootstrapper.exe
46-
.paket\paket.exe restore
46+
IF EXIST paket.lock (.paket\paket.exe restore)
47+
IF NOT EXIST paket.lock (.paket\paket.exe install)
4748
)
4849

4950
REM if `build quick` is called on a fresh checkout force a restore anyway
5051
IF "%SKIPPAKET%"=="1" (
5152
IF NOT EXIST .paket\paket.exe (
5253
.paket\paket.bootstrapper.exe
53-
.paket\paket.exe restore
5454
)
55+
IF EXIST paket.lock (.paket\paket.exe restore)
56+
IF NOT EXIST paket.lock (.paket\paket.exe install)
5557
)
5658

5759
IF /I "%TARGET%"=="version" (
@@ -64,10 +66,7 @@ IF /I "%TARGET%"=="release" (
6466
EXIT /B 1
6567
)
6668
)
67-
IF /I "%TARGET%"=="quick" (
68-
IF NOT [%2]==[] (set NEST_TEST_FILTER="%2")
69-
)
70-
IF /I "%TARGET%"=="forever" (
69+
IF /I "%TARGET%"=="inc" (
7170
IF NOT [%2]==[] (set NEST_TEST_FILTER="%2")
7271
)
7372
IF /I "%TARGET%"=="integrate" (

build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if [[ "${1,,}" == "skiptests" ]]; then SKIPTESTS=1; shift; fi
1717

1818
if [[ ! -z "$1" ]]; then TARGET=$1; fi
1919

20-
if [[ "${TARGET,,}" == "quick" ]]; then SKIPPAKET=1; fi
20+
if [[ "${TARGET,,}" == "inc" ]]; then SKIPPAKET=1; fi
2121
if [[ "${TARGET,,}" == "forever" ]]; then SKIPPAKET=1; fi
2222

2323
if [[ $SKIPPAKET -ne 1 ]]; then
@@ -28,7 +28,7 @@ if [[ $SKIPPAKET -eq 1 && ! -f .paket/paket.exe ]]; then
2828
mono .paket/paket.bootstrapper.exe
2929
mono .paket/paket.exe restore
3030
fi
31-
if [[ "${TARGET,,}" == "quick" ]] || [[ "${TARGET,,}" == "forever" ]]; then
31+
if [[ "${TARGET,,}" == "inc" ]] || [[ "${TARGET,,}" == "forever" ]]; then
3232
if [[ ! -z "$2" ]]; then NEST_TEST_FILTER=$2; fi
3333
fi
3434

build/Clients.Common.targets

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<!-- Default Version numbers -->
5+
<CurrentVersion>0.0.0-bad</CurrentVersion>
6+
<CurrentAssemblyVersion>0.0.0</CurrentAssemblyVersion>
7+
<CurrentAssemblyFileVersion>0.0.0.0</CurrentAssemblyFileVersion>
8+
9+
<!-- Version and Informational reflect actual version -->
10+
<Version>$(CurrentVersion)</Version>
11+
<InformationalVersion>$(CurrentVersion)</InformationalVersion>
12+
<!-- Assembly version is sticky to MAJOR.0.0.0 to avoid binding redirects because we strong name our assemblies -->
13+
<AssemblyVersion>$(CurrentAssemblyVersion)</AssemblyVersion>
14+
<!-- File version reflects actual version number without prelease since that not allowed in its struct -->
15+
<FileVersion>$(CurrentAssemblyFileVersion)</FileVersion>
16+
17+
<Authors></Authors>
18+
<Company></Company>
19+
<NeutralLanguage></NeutralLanguage>
20+
<AssemblyTitle></AssemblyTitle>
21+
<Description></Description>
22+
<Copyright></Copyright>
23+
<SignAssembly>true</SignAssembly>
24+
<AssemblyOriginatorKeyFile Condition="'$(DotNetCoreOnly)'==''">..\..\build\keys\keypair.snk</AssemblyOriginatorKeyFile>
25+
<GenerateDocumentationFile Condition="'$(DotNetCoreOnly)'==''">true</GenerateDocumentationFile>
26+
<NoWarn>1591,1572,1571,1573,1587,1570</NoWarn>
27+
<Prefer32Bit>false</Prefer32Bit>
28+
<DefineConstants Condition="'$(TargetFramework)'=='netstandard1.3' OR '$(DotNetCoreOnly)'=='1'">$(DefineConstants);DOTNETCORE</DefineConstants>
29+
<DebugType Condition="'$(DotNetCoreOnly)'==''">embedded</DebugType>
30+
<SourceLink Condition="'$(DoSourceLink)'!=''">$(BaseIntermediateOutputPath)\sl-$(MsBuildProjectName)-$(TargetFramework).json</SourceLink>
31+
<RepoUri>https://raw.githubusercontent.com/elastic/elasticsearch-net</RepoUri>
32+
</PropertyGroup>
33+
34+
<Target Name="GenerateSourceLink" BeforeTargets="CoreCompile" Condition="'$(DoSourceLink)'!=''">
35+
<Delete Files="$(SourceLink)" Condition="Exists('$(SourceLink)')" />
36+
<Exec Command="git rev-parse HEAD" ConsoleToMSBuild="true">
37+
<Output TaskParameter="ConsoleOutput" PropertyName="LatestCommit" />
38+
</Exec>
39+
<Exec Command="git rev-parse --show-toplevel" ConsoleToMSBuild="true">
40+
<Output TaskParameter="ConsoleOutput" PropertyName="GitRootFolder" />
41+
</Exec>
42+
<WriteLinesToFile File="$(SourceLink)" Lines="{&quot;documents&quot;: { &quot;$([System.IO.Path]::GetFullPath('$(GitRootFolder)/').Replace('\','\\'))*&quot; : &quot;$(RepoUri)/$(LatestCommit)/*&quot; }}" />
43+
</Target>
44+
</Project>

build/Elasticsearch.Net.nuspec

+6-12
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,13 @@
3030
</dependencies>
3131
</metadata>
3232
<files>
33-
<file src="output\v4.5\Elasticsearch.Net\Elasticsearch.Net.dll" target="lib\net45"/>
34-
<file src="output\v4.5\Elasticsearch.Net\Elasticsearch.Net.pdb" target="lib\net45"/>
35-
<file src="output\v4.5\Elasticsearch.Net\Elasticsearch.Net.pdb.srcsrv" target="lib\net45"/>
36-
<file src="output\v4.5\Elasticsearch.Net\Elasticsearch.Net.XML" target="lib\net45"/>
33+
<file src="..\src\Elasticsearch.Net\bin\Release\net45\Elasticsearch.Net.dll" target="lib\net45"/>
34+
<file src="..\src\Elasticsearch.Net\bin\Release\net45\Elasticsearch.Net.XML" target="lib\net45"/>
3735

38-
<file src="output\v4.6\Elasticsearch.Net\Elasticsearch.Net.dll" target="lib\net46"/>
39-
<file src="output\v4.6\Elasticsearch.Net\Elasticsearch.Net.pdb" target="lib\net46"/>
40-
<file src="output\v4.6\Elasticsearch.Net\Elasticsearch.Net.pdb.srcsrv" target="lib\net46"/>
41-
<file src="output\v4.6\Elasticsearch.Net\Elasticsearch.Net.XML" target="lib\net46"/>
36+
<file src="..\src\Elasticsearch.Net\bin\Release\net46\Elasticsearch.Net.dll" target="lib\net46"/>
37+
<file src="..\src\Elasticsearch.Net\bin\Release\net46\Elasticsearch.Net.XML" target="lib\net46"/>
4238

43-
<file src="output\netstandard1.3\Elasticsearch.Net\Elasticsearch.Net.dll" target="lib\netstandard1.3"/>
44-
<file src="output\netstandard1.3\Elasticsearch.Net\Elasticsearch.Net.pdb" target="lib\netstandard1.3"/>
45-
<file src="output\netstandard1.3\Elasticsearch.Net\Elasticsearch.Net.pdb.srcsrv" target="lib\netstandard1.3"/>
46-
<file src="output\netstandard1.3\Elasticsearch.Net\Elasticsearch.Net.xml" target="lib\netstandard1.3"/>
39+
<file src="..\src\Elasticsearch.Net\bin\Release\netstandard1.3\Elasticsearch.Net.dll" target="lib\netstandard1.3"/>
40+
<file src="..\src\Elasticsearch.Net\bin\Release\netstandard1.3\Elasticsearch.Net.xml" target="lib\netstandard1.3"/>
4741
</files>
4842
</package>

build/NEST.nuspec

+8-14
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<iconUrl>https://raw.githubusercontent.com/elastic/elasticsearch-net/master/build/nuget-icon.png</iconUrl>
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1313
<description>Strongly typed interface to Elasticsearch. Fluent and classic object initializer mappings of requests and responses. Uses and exposes Elasticsearch.Net</description>
14-
<summary>Strongly typed interface to Elasticsearch. Fluent and classic object initializer mappings of requests and responses. Uses and exposes Elasticsearch.Net</summary>
14+
<summary>Strongly typed interface to Elasticsearch. Fluent and classic object initializer mappings of requests and responses. Uses and exposes Elasticsearch.Net</summary>
1515
<releaseNotes>See https://github.com/elastic/elasticsearch-net/releases/tag/$version$</releaseNotes>
1616
<copyright>2014-$year$ Elasticsearch BV</copyright>
1717
<tags>elasticsearch,elastic,search,lucene,nest</tags>
@@ -35,19 +35,13 @@
3535
</dependencies>
3636
</metadata>
3737
<files>
38-
<file src="output\v4.5\Nest\Nest.dll" target="lib\net45"/>
39-
<file src="output\v4.5\Nest\Nest.pdb" target="lib\net45"/>
40-
<file src="output\v4.5\Nest\Nest.pdb.srcsrv" target="lib\net45"/>
41-
<file src="output\v4.5\Nest\Nest.XML" target="lib\net45"/>
38+
<file src="..\src\Nest\bin\Release\net45\Nest.dll" target="lib\net45"/>
39+
<file src="..\src\Nest\bin\Release\net45\Nest.XML" target="lib\net45"/>
4240

43-
<file src="output\v4.6\Nest\Nest.dll" target="lib\net46"/>
44-
<file src="output\v4.6\Nest\Nest.pdb" target="lib\net46"/>
45-
<file src="output\v4.6\Nest\Nest.pdb.srcsrv" target="lib\net46"/>
46-
<file src="output\v4.6\Nest\Nest.XML" target="lib\net46"/>
41+
<file src="..\src\Nest\bin\Release\net46\Nest.dll" target="lib\net46"/>
42+
<file src="..\src\Nest\bin\Release\net46\Nest.XML" target="lib\net46"/>
4743

48-
<file src="output\netstandard1.3\Nest\Nest.dll" target="lib\netstandard1.3"/>
49-
<file src="output\netstandard1.3\Nest\Nest.pdb" target="lib\netstandard1.3"/>
50-
<file src="output\netstandard1.3\Nest\Nest.pdb.srcsrv" target="lib\netstandard1.3"/>
51-
<file src="output\netstandard1.3\Nest\Nest.xml" target="lib\netstandard1.3"/>
44+
<file src="..\src\Nest\bin\Release\netstandard1.3\Nest.dll" target="lib\netstandard1.3"/>
45+
<file src="..\src\Nest\bin\Release\netstandard1.3\Nest.xml" target="lib\netstandard1.3"/>
5246
</files>
53-
</package>
47+
</package>

build/scripts/Benchmarking.fsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ module Benchmarker =
2727
})
2828

2929
DotNetCli.RunCommand(fun p ->
30-
{ p with
30+
{ p with
3131
WorkingDir = testsProjectDirectory
3232
}) "run Benchmark"
3333
finally
34-
let benchmarkOutputFiles =
34+
let benchmarkOutputFiles =
3535
let output = combinePaths testsProjectDirectory "BenchmarkDotNet.Artifacts"
36-
Directory.EnumerateFiles(output, "*.*", SearchOption.AllDirectories)
36+
Directory.EnumerateFiles(output, "*.*", SearchOption.AllDirectories)
3737
|> Seq.toList
38-
38+
3939
for file in benchmarkOutputFiles do copyToOutput file
4040
DeleteFiles benchmarkOutputFiles

0 commit comments

Comments
 (0)