Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/new new csproj 5x #2717

Merged
merged 2 commits into from
Apr 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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