Skip to content

Commit

Permalink
Feature/new new csproj 5x (#2717)
Browse files Browse the repository at this point in the history
* Feature/new new csproj (#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

Conflicts:
	src/CodeGeneration/ApiGenerator/ApiGenerator.csproj
	src/CodeGeneration/ApiGenerator/Properties/AssemblyInfo.cs
	src/CodeGeneration/DocGenerator/Properties/AssemblyInfo.cs
	src/Elasticsearch.Net/Properties/AssemblyInfo.cs
	src/Elasticsearch.Net/project.json
	src/Nest/Nest.csproj
	src/Nest/Properties/AssemblyInfo.cs
	src/Nest/project.json
	src/Tests/Framework/ManagedElasticsearch/Tasks/InstallationTasks/InstallPlugins.cs
	src/Tests/Properties/AssemblyInfo.cs
	src/Tests/Tests.csproj
	src/Tests/project.json

* update global version number to reflect this branch post merging new new csproj file changes in
  • Loading branch information
Mpdreamz authored Apr 12, 2017
1 parent 3a37576 commit 5f0037d
Show file tree
Hide file tree
Showing 60 changed files with 676 additions and 12,162 deletions.
2 changes: 0 additions & 2 deletions .deployment

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ build/tools/*
!build/*.ps1
!build/*.nuspec
!build/*.png
!build/*.targets
!build/scripts


Expand Down
108 changes: 108 additions & 0 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Mark that this target file has been loaded. -->
<IsPaketRestoreTargetsFileLoaded>true</IsPaketRestoreTargetsFileLoaded>
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
<MonoPath Condition="'$(MonoPath)' == '' And Exists('/Library/Frameworks/Mono.framework/Commands/mono')">/Library/Frameworks/Mono.framework/Commands/mono</MonoPath>
<MonoPath Condition="'$(MonoPath)' == ''">mono</MonoPath>
<!-- Paket command -->
<PaketExePath Condition=" '$(PaketExePath)' == '' AND Exists('$(PaketRootPath)paket.exe')">$(PaketRootPath)paket.exe</PaketExePath>
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)paket.exe</PaketExePath>
<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"</PaketCommand>
</PropertyGroup>

<Target Name="PaketRestore" BeforeTargets="_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreGraphWalkPerFramework;CollectPackageReferences" >

<Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" ' />

<PropertyGroup>
<PaketReferencesFilePath>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references</PaketReferencesFilePath>
</PropertyGroup>

<ReadLinesFromFile File="$(PaketReferencesFilePath)" >
<Output TaskParameter="Lines" ItemName="PaketReferencesFileLines"/>
</ReadLinesFromFile>

<ItemGroup Condition=" '@(PaketReferencesFileLines)' != '' " >
<PaketReferencesFileLinesInfo Include="@(PaketReferencesFileLines)" >
<PackageName>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0])</PackageName>
<PackageVersion>$([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1])</PackageVersion>
</PaketReferencesFileLinesInfo>
<PackageReference Include="%(PaketReferencesFileLinesInfo.PackageName)">
<Version>%(PaketReferencesFileLinesInfo.PackageVersion)</Version>
</PackageReference>
</ItemGroup>

<PropertyGroup>
<RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile>
</PropertyGroup>

</Target>

<Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" >
<PropertyGroup>
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
</PropertyGroup>
</Target>

<Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" >
<PropertyGroup>
<PaketReferencesFilePath>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references</PaketReferencesFilePath>
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
</PropertyGroup>

<ItemGroup>
<_NuspecFiles Include="$(BaseIntermediateOutputPath)*.nuspec"/>
</ItemGroup>

<Exec Command='$(PaketCommand) fix-nuspec file "@(_NuspecFiles)" references-file "$(PaketReferencesFilePath)" ' />

<ConvertToAbsolutePath Condition="@(_NuspecFiles) != ''" Paths="@(_NuspecFiles)">
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
</ConvertToAbsolutePath>

<!-- Call Pack -->
<PackTask PackItem="$(PackProjectInputFile)"
PackageFiles="@(_PackageFiles)"
PackageFilesToExclude="@(_PackageFilesToExclude)"
PackageVersion="$(PackageVersion)"
PackageId="$(PackageId)"
Title="$(Title)"
Authors="$(Authors)"
Description="$(Description)"
Copyright="$(Copyright)"
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
LicenseUrl="$(PackageLicenseUrl)"
ProjectUrl="$(PackageProjectUrl)"
IconUrl="$(PackageIconUrl)"
ReleaseNotes="$(PackageReleaseNotes)"
Tags="$(PackageTags)"
TargetPathsToAssemblies="@(_TargetPathsToAssemblies->'%(FinalOutputPath)')"
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
TargetFrameworks="@(_TargetFrameworks)"
AssemblyName="$(AssemblyName)"
PackageOutputPath="$(PackageOutputAbsolutePath)"
IncludeSymbols="$(IncludeSymbols)"
IncludeSource="$(IncludeSource)"
PackageTypes="$(PackageType)"
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
MinClientVersion="$(MinClientVersion)"
Serviceable="$(Serviceable)"
AssemblyReferences="@(_References)"
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
NuspecOutputPath="$(BaseIntermediateOutputPath)"
IncludeBuildOutput="$(IncludeBuildOutput)"
BuildOutputFolder="$(BuildOutputTargetFolder)"
ContentTargetFolders="$(ContentTargetFolders)"
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
NuspecFile="$(NuspecFileAbsolutePath)"
NuspecBasePath="$(NuspecBasePath)"
NuspecProperties="$(NuspecProperties)"/>
</Target>

</Project>
40 changes: 0 additions & 40 deletions .paket/paket.targets

This file was deleted.

8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
language: csharp
solution: src/Elasticsearch.sln
script: ./build.sh quick
script: ./build.sh inc
dist: trusty
mono: 4.6.2
dotnet: 1.0.1
env:
global:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
8 changes: 8 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 1.0.{build}
image: Visual Studio 2017
build_script:
- cmd: build.bat
test: off
environment:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
15 changes: 7 additions & 8 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,22 @@ IF /I "%1"=="skiptests" (
IF NOT [%1]==[] (set TARGET=%1)

SET SKIPPAKET=0
IF /I "%TARGET%"=="quick" SET SKIPPAKET=1
IF /I "%TARGET%"=="forever" SET SKIPPAKET=1
IF /I "%TARGET%"=="inc" SET SKIPPAKET=1
IF /I "%TARGET%"=="canary" SET SKIPTESTS=1

IF "%SKIPPAKET%" neq "1" (
.paket\paket.bootstrapper.exe
.paket\paket.exe restore
IF EXIST paket.lock (.paket\paket.exe restore)
IF NOT EXIST paket.lock (.paket\paket.exe install)
)

REM if `build quick` is called on a fresh checkout force a restore anyway
IF "%SKIPPAKET%"=="1" (
IF NOT EXIST .paket\paket.exe (
.paket\paket.bootstrapper.exe
.paket\paket.exe restore
)
IF EXIST paket.lock (.paket\paket.exe restore)
IF NOT EXIST paket.lock (.paket\paket.exe install)
)

IF /I "%TARGET%"=="version" (
Expand All @@ -64,10 +66,7 @@ IF /I "%TARGET%"=="release" (
EXIT /B 1
)
)
IF /I "%TARGET%"=="quick" (
IF NOT [%2]==[] (set NEST_TEST_FILTER="%2")
)
IF /I "%TARGET%"=="forever" (
IF /I "%TARGET%"=="inc" (
IF NOT [%2]==[] (set NEST_TEST_FILTER="%2")
)
IF /I "%TARGET%"=="integrate" (
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [[ "${1,,}" == "skiptests" ]]; then SKIPTESTS=1; shift; fi

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

if [[ "${TARGET,,}" == "quick" ]]; then SKIPPAKET=1; fi
if [[ "${TARGET,,}" == "inc" ]]; then SKIPPAKET=1; fi
if [[ "${TARGET,,}" == "forever" ]]; then SKIPPAKET=1; fi

if [[ $SKIPPAKET -ne 1 ]]; then
Expand All @@ -28,7 +28,7 @@ if [[ $SKIPPAKET -eq 1 && ! -f .paket/paket.exe ]]; then
mono .paket/paket.bootstrapper.exe
mono .paket/paket.exe restore
fi
if [[ "${TARGET,,}" == "quick" ]] || [[ "${TARGET,,}" == "forever" ]]; then
if [[ "${TARGET,,}" == "inc" ]] || [[ "${TARGET,,}" == "forever" ]]; then
if [[ ! -z "$2" ]]; then NEST_TEST_FILTER=$2; fi
fi

Expand Down
44 changes: 44 additions & 0 deletions build/Clients.Common.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Default Version numbers -->
<CurrentVersion>0.0.0-bad</CurrentVersion>
<CurrentAssemblyVersion>0.0.0</CurrentAssemblyVersion>
<CurrentAssemblyFileVersion>0.0.0.0</CurrentAssemblyFileVersion>

<!-- Version and Informational reflect actual version -->
<Version>$(CurrentVersion)</Version>
<InformationalVersion>$(CurrentVersion)</InformationalVersion>
<!-- Assembly version is sticky to MAJOR.0.0.0 to avoid binding redirects because we strong name our assemblies -->
<AssemblyVersion>$(CurrentAssemblyVersion)</AssemblyVersion>
<!-- File version reflects actual version number without prelease since that not allowed in its struct -->
<FileVersion>$(CurrentAssemblyFileVersion)</FileVersion>

<Authors></Authors>
<Company></Company>
<NeutralLanguage></NeutralLanguage>
<AssemblyTitle></AssemblyTitle>
<Description></Description>
<Copyright></Copyright>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile Condition="'$(DotNetCoreOnly)'==''">..\..\build\keys\keypair.snk</AssemblyOriginatorKeyFile>
<GenerateDocumentationFile Condition="'$(DotNetCoreOnly)'==''">true</GenerateDocumentationFile>
<NoWarn>1591,1572,1571,1573,1587,1570</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
<DefineConstants Condition="'$(TargetFramework)'=='netstandard1.3' OR '$(DotNetCoreOnly)'=='1'">$(DefineConstants);DOTNETCORE</DefineConstants>
<DebugType Condition="'$(DotNetCoreOnly)'==''">embedded</DebugType>
<SourceLink Condition="'$(DoSourceLink)'!=''">$(BaseIntermediateOutputPath)\sl-$(MsBuildProjectName)-$(TargetFramework).json</SourceLink>
<RepoUri>https://raw.githubusercontent.com/elastic/elasticsearch-net</RepoUri>
</PropertyGroup>

<Target Name="GenerateSourceLink" BeforeTargets="CoreCompile" Condition="'$(DoSourceLink)'!=''">
<Delete Files="$(SourceLink)" Condition="Exists('$(SourceLink)')" />
<Exec Command="git rev-parse HEAD" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="LatestCommit" />
</Exec>
<Exec Command="git rev-parse --show-toplevel" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GitRootFolder" />
</Exec>
<WriteLinesToFile File="$(SourceLink)" Lines="{&quot;documents&quot;: { &quot;$([System.IO.Path]::GetFullPath('$(GitRootFolder)/').Replace('\','\\'))*&quot; : &quot;$(RepoUri)/$(LatestCommit)/*&quot; }}" />
</Target>
</Project>
18 changes: 6 additions & 12 deletions build/Elasticsearch.Net.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,13 @@
</dependencies>
</metadata>
<files>
<file src="output\v4.5\Elasticsearch.Net\Elasticsearch.Net.dll" target="lib\net45"/>
<file src="output\v4.5\Elasticsearch.Net\Elasticsearch.Net.pdb" target="lib\net45"/>
<file src="output\v4.5\Elasticsearch.Net\Elasticsearch.Net.pdb.srcsrv" target="lib\net45"/>
<file src="output\v4.5\Elasticsearch.Net\Elasticsearch.Net.XML" target="lib\net45"/>
<file src="..\src\Elasticsearch.Net\bin\Release\net45\Elasticsearch.Net.dll" target="lib\net45"/>
<file src="..\src\Elasticsearch.Net\bin\Release\net45\Elasticsearch.Net.XML" target="lib\net45"/>

<file src="output\v4.6\Elasticsearch.Net\Elasticsearch.Net.dll" target="lib\net46"/>
<file src="output\v4.6\Elasticsearch.Net\Elasticsearch.Net.pdb" target="lib\net46"/>
<file src="output\v4.6\Elasticsearch.Net\Elasticsearch.Net.pdb.srcsrv" target="lib\net46"/>
<file src="output\v4.6\Elasticsearch.Net\Elasticsearch.Net.XML" target="lib\net46"/>
<file src="..\src\Elasticsearch.Net\bin\Release\net46\Elasticsearch.Net.dll" target="lib\net46"/>
<file src="..\src\Elasticsearch.Net\bin\Release\net46\Elasticsearch.Net.XML" target="lib\net46"/>

<file src="output\netstandard1.3\Elasticsearch.Net\Elasticsearch.Net.dll" target="lib\netstandard1.3"/>
<file src="output\netstandard1.3\Elasticsearch.Net\Elasticsearch.Net.pdb" target="lib\netstandard1.3"/>
<file src="output\netstandard1.3\Elasticsearch.Net\Elasticsearch.Net.pdb.srcsrv" target="lib\netstandard1.3"/>
<file src="output\netstandard1.3\Elasticsearch.Net\Elasticsearch.Net.xml" target="lib\netstandard1.3"/>
<file src="..\src\Elasticsearch.Net\bin\Release\netstandard1.3\Elasticsearch.Net.dll" target="lib\netstandard1.3"/>
<file src="..\src\Elasticsearch.Net\bin\Release\netstandard1.3\Elasticsearch.Net.xml" target="lib\netstandard1.3"/>
</files>
</package>
22 changes: 8 additions & 14 deletions build/NEST.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<iconUrl>https://raw.githubusercontent.com/elastic/elasticsearch-net/master/build/nuget-icon.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Strongly typed interface to Elasticsearch. Fluent and classic object initializer mappings of requests and responses. Uses and exposes Elasticsearch.Net</description>
<summary>Strongly typed interface to Elasticsearch. Fluent and classic object initializer mappings of requests and responses. Uses and exposes Elasticsearch.Net</summary>
<summary>Strongly typed interface to Elasticsearch. Fluent and classic object initializer mappings of requests and responses. Uses and exposes Elasticsearch.Net</summary>
<releaseNotes>See https://github.com/elastic/elasticsearch-net/releases/tag/$version$</releaseNotes>
<copyright>2014-$year$ Elasticsearch BV</copyright>
<tags>elasticsearch,elastic,search,lucene,nest</tags>
Expand All @@ -35,19 +35,13 @@
</dependencies>
</metadata>
<files>
<file src="output\v4.5\Nest\Nest.dll" target="lib\net45"/>
<file src="output\v4.5\Nest\Nest.pdb" target="lib\net45"/>
<file src="output\v4.5\Nest\Nest.pdb.srcsrv" target="lib\net45"/>
<file src="output\v4.5\Nest\Nest.XML" target="lib\net45"/>
<file src="..\src\Nest\bin\Release\net45\Nest.dll" target="lib\net45"/>
<file src="..\src\Nest\bin\Release\net45\Nest.XML" target="lib\net45"/>

<file src="output\v4.6\Nest\Nest.dll" target="lib\net46"/>
<file src="output\v4.6\Nest\Nest.pdb" target="lib\net46"/>
<file src="output\v4.6\Nest\Nest.pdb.srcsrv" target="lib\net46"/>
<file src="output\v4.6\Nest\Nest.XML" target="lib\net46"/>
<file src="..\src\Nest\bin\Release\net46\Nest.dll" target="lib\net46"/>
<file src="..\src\Nest\bin\Release\net46\Nest.XML" target="lib\net46"/>

<file src="output\netstandard1.3\Nest\Nest.dll" target="lib\netstandard1.3"/>
<file src="output\netstandard1.3\Nest\Nest.pdb" target="lib\netstandard1.3"/>
<file src="output\netstandard1.3\Nest\Nest.pdb.srcsrv" target="lib\netstandard1.3"/>
<file src="output\netstandard1.3\Nest\Nest.xml" target="lib\netstandard1.3"/>
<file src="..\src\Nest\bin\Release\netstandard1.3\Nest.dll" target="lib\netstandard1.3"/>
<file src="..\src\Nest\bin\Release\netstandard1.3\Nest.xml" target="lib\netstandard1.3"/>
</files>
</package>
</package>
8 changes: 4 additions & 4 deletions build/scripts/Benchmarking.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ module Benchmarker =
})

DotNetCli.RunCommand(fun p ->
{ p with
{ p with
WorkingDir = testsProjectDirectory
}) "run Benchmark"
finally
let benchmarkOutputFiles =
let benchmarkOutputFiles =
let output = combinePaths testsProjectDirectory "BenchmarkDotNet.Artifacts"
Directory.EnumerateFiles(output, "*.*", SearchOption.AllDirectories)
Directory.EnumerateFiles(output, "*.*", SearchOption.AllDirectories)
|> Seq.toList

for file in benchmarkOutputFiles do copyToOutput file
DeleteFiles benchmarkOutputFiles
Loading

0 comments on commit 5f0037d

Please sign in to comment.