Skip to content

Commit

Permalink
[Breaking Changes] Migraton to NEST v5.3.0
Browse files Browse the repository at this point in the history
* Drops support for Elasticsearch < 5
* Drops supports for NEST < 5
* Maintains support for .net452, .net46
* Adds support for netstandard1.6
* Updates Cake build to support msbuild v15 semantics for restore, build, pack
* Uses `dotnet test` to execute unit tests
* Marks functionality expected to be removed later with Obsolete flags
* Minor updates to docs and readme
* ElasticsearchServerException no longer exists, on exception queries will throw an ElasticClientQueryObjectException
* IElasticsearchRepository methods accepting string Id's or document
objects now consolidated into the new DocumentPath object, old methods are marked obsolete.
* Base Queries using string Ids or object document objects now expect a DocumentPath, old signatures are marked obsolete
* Removed queries with no equivalent in Elasticsearch 5 (MoreLikeQuery)
Philo committed Apr 20, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent c8fb9e7 commit 2eedaf4
Showing 65 changed files with 583 additions and 784 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@

# Build related
/tools/
!/tools/packages.config

/VersionAssemblyInfo.cs
/artifacts/

22 changes: 15 additions & 7 deletions Nest.Queryify.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
# Visual Studio 15
VisualStudioVersion = 15.0.26228.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nest.Queryify", "src\Nest.Queryify\Nest.Queryify.csproj", "{70F41783-BD20-4C56-941A-E370ED41D397}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nest.Queryify.Tests", "tests\Nest.Queryify.Tests\Nest.Queryify.Tests.csproj", "{DCBCA41B-24D5-4D12-98ED-5DA29D4D15FB}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4F70AD04-ACBB-45A8-9361-B240FDAA6154}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{B851DD22-E4FB-4F42-9579-21FEDBAD11BD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nest.Queryify.Tests", "tests\Nest.Queryify.Tests\Nest.Queryify.Tests.csproj", "{641A95FD-C70B-4925-AD19-EC410E52BF6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -17,12 +21,16 @@ Global
{70F41783-BD20-4C56-941A-E370ED41D397}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70F41783-BD20-4C56-941A-E370ED41D397}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70F41783-BD20-4C56-941A-E370ED41D397}.Release|Any CPU.Build.0 = Release|Any CPU
{DCBCA41B-24D5-4D12-98ED-5DA29D4D15FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DCBCA41B-24D5-4D12-98ED-5DA29D4D15FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DCBCA41B-24D5-4D12-98ED-5DA29D4D15FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DCBCA41B-24D5-4D12-98ED-5DA29D4D15FB}.Release|Any CPU.Build.0 = Release|Any CPU
{641A95FD-C70B-4925-AD19-EC410E52BF6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{641A95FD-C70B-4925-AD19-EC410E52BF6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{641A95FD-C70B-4925-AD19-EC410E52BF6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{641A95FD-C70B-4925-AD19-EC410E52BF6F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{70F41783-BD20-4C56-941A-E370ED41D397} = {4F70AD04-ACBB-45A8-9361-B240FDAA6154}
{641A95FD-C70B-4925-AD19-EC410E52BF6F} = {B851DD22-E4FB-4F42-9579-21FEDBAD11BD}
EndGlobalSection
EndGlobal
Binary file removed Nest.Queryify.v2.ncrunchsolution
Binary file not shown.
14 changes: 7 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: '{build}'
os: Visual Studio 2015
os: Visual Studio 2017
init:
- cmd: git config --global core.autocrlf true
cache:
- packages -> src\**\packages.config
- tools -> tools\packages.config
build_script:
- ps: .\build.ps1 -Target "Default" -Verbosity "Normal" -Configuration "Release"
- ps: .\build.ps1 -Target "CI" -Verbosity "Normal" -Configuration "Release"
test: off
artifacts:
- path: artifacts\*.nupkg
deploy:
- provider: Environment
name: MyGet (ES Snapback)
on:
branch: /release\/.+/
228 changes: 132 additions & 96 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
#tool "xunit.runner.console"
#tool "GitVersion.CommandLine"

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");
var target = Argument("target", AppVeyor.IsRunningOnAppVeyor ? "CI" : "Default");
var configuration = Argument("configuration", "Release");
var solutionPath = MakeAbsolute(File(Argument("solutionPath", "./Nest.Queryify.sln")));
var nugetProjects = Argument("nugetProjects", "Nest.Queryify");


//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////

var testAssemblies = "./tests/**/bin/" +configuration +"/*.Tests.dll";
var testAssemblies = "./tests/**/bin/" +configuration +"/*.Tests.dll";
var coverageReportXmlFilePath = "";

var artifacts = MakeAbsolute(Directory(Argument("artifactPath", "./artifacts")));
var buildOutput = MakeAbsolute(Directory(artifacts +"/build/"));
var testResultsPath = MakeAbsolute(Directory(artifacts + "./test-results"));
var versionAssemblyInfo = MakeAbsolute(File(Argument("versionAssemblyInfo", "VersionAssemblyInfo.cs")));

IEnumerable<FilePath> nugetProjectPaths = null;
@@ -30,36 +26,23 @@ GitVersion versionInfo = null;
// TASKS
//////////////////////////////////////////////////////////////////////

Setup(() => {
Setup(ctx => {
if(!FileExists(solutionPath)) throw new Exception(string.Format("Solution file not found - {0}", solutionPath.ToString()));
solution = ParseSolution(solutionPath.ToString());

var projects = solution.Projects.Where(x => nugetProjects.Contains(x.Name));
if(projects == null || !projects.Any()) throw new Exception(string.Format("Unable to find projects '{0}' in solution '{1}'", nugetProjects, solutionPath.GetFilenameWithoutExtension()));
nugetProjectPaths = projects.Select(p => p.Path);

// if(!FileExists(nugetProjectPath)) throw new Exception("project path not found");
Information("[Setup] Using Solution '{0}'", solutionPath.ToString());
});

Task("Clean")
.Does(() =>
{
CleanDirectories(artifacts.ToString());
CreateDirectory(artifacts);
CreateDirectory(buildOutput);
if(DirectoryExists(artifacts))
{
DeleteDirectory(artifacts, true);
}

EnsureDirectoryExists(artifacts);

var binDirs = GetDirectories(solutionPath.GetDirectory() +@"\src\**\bin");
var objDirs = GetDirectories(solutionPath.GetDirectory() +@"\src\**\obj");
CleanDirectories(binDirs);
CleanDirectories(objDirs);
});

Task("Restore-NuGet-Packages")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(solutionPath, new NuGetRestoreSettings());
DeleteDirectories(binDirs, true);
DeleteDirectories(objDirs, true);
});

Task("Update-Version-Info")
@@ -90,102 +73,155 @@ Task("CreateVersionAssemblyInfo")
});
});

Task("Build")
.IsDependentOn("Restore-NuGet-Packages")
Task("DotNet-MsBuild-Restore")
.IsDependentOn("Update-Version-Info")
.Does(() =>
{
MSBuild(solutionPath, settings => settings
.WithProperty("TreatWarningsAsErrors","true")
.WithProperty("UseSharedCompilation", "false")
.WithProperty("AutoParameterizationWebConfigConnectionStrings", "false")
.SetVerbosity(Verbosity.Quiet)
.SetConfiguration(configuration)
.WithTarget("Rebuild")
);
.Does(() => {

MSBuild(solutionPath, c => c
.SetConfiguration(configuration)
.SetVerbosity(Verbosity.Minimal)
.UseToolVersion(MSBuildToolVersion.VS2017)
.WithTarget("Restore")
);
});

Task("Copy-Files")
Task("DotNet-MsBuild")
.IsDependentOn("Restore")
.Does(() => {

MSBuild(solutionPath, c => c
.SetConfiguration(configuration)
.SetVerbosity(Verbosity.Minimal)
.UseToolVersion(MSBuildToolVersion.VS2017)
.WithProperty("TreatWarningsAsErrors", "true")
.WithTarget("Build")
);

});

Task("DotNet-MsBuild-Pack")
.IsDependentOn("Build")
.Does(() =>
{
EnsureDirectoryExists(buildOutput);
CopyFile("./src/Nest.Queryify/bin/" +configuration +"/Nest.Queryify.dll", buildOutput +"/Nest.Queryify.dll");
CopyFile("./src/Nest.Queryify/bin/" +configuration +"/Nest.Queryify.pdb", buildOutput +"/Nest.Queryify.pdb");
.Does(() => {

MSBuild("src/Nest.Queryify/Nest.Queryify.csproj", c => c
.SetConfiguration(configuration)
.SetVerbosity(Verbosity.Normal)
.UseToolVersion(MSBuildToolVersion.VS2017)
.WithProperty("PackageVersion", versionInfo.NuGetVersionV2)
.WithProperty("NoBuild", "true")
.WithTarget("Pack")
);
});

Task("DotNet-MsBuild-CopyToArtifacts")
.IsDependentOn("DotNet-MsBuild-Pack")
.Does(() => {

Task("Build-NuGet-Package")
.IsDependentOn("Build")
.IsDependentOn("Copy-Files")
.Does(() =>
{
var settings = new NuGetPackSettings {
BasePath = buildOutput,
Id = "Nest.Queryify",
Authors = new [] { "Phil Oyston" },
Owners = new [] {"Phil Oyston", "Storm ID" },
Description = "Provides a mechanism to interact with Elasticsearch via a query object pattern",
LicenseUrl = new Uri("https://raw.githubusercontent.com/stormid/nest-queryify/master/LICENSE"),
ProjectUrl = new Uri("https://github.com/stormid/nest-queryify"),
IconUrl = new Uri("http://stormid.com/_/images/icons/apple-touch-icon.png"),
RequireLicenseAcceptance = false,
Properties = new Dictionary<string, string> { { "Configuration", configuration }},
Symbols = false,
NoPackageAnalysis = true,
Version = versionInfo.NuGetVersionV2,
OutputDirectory = artifacts,
Tags = new[] { "Elasticsearch", "Nest", "Storm" },
Files = new[] {
new NuSpecContent { Source = "Nest.Queryify.dll", Target = "lib/net45" },
new NuSpecContent { Source = "Nest.Queryify.pdb", Target = "lib/net45" },
},
Dependencies = new [] {
new NuSpecDependency { Id = "Nest", Version = "[1.6,2]" },
}
};
NuGetPack("./src/Nest.Queryify/Nest.Queryify.nuspec", settings);
EnsureDirectoryExists(artifacts);
CopyFiles("src/Nest.Queryify/bin/" +configuration +"/*.nupkg", artifacts);
});

Task("Package")
Task("DotNet-Test")
.IsDependentOn("Build")
.IsDependentOn("Build-NuGet-Package")
.Does(() => { });
.Does(() => {

Task("Run-Unit-Tests")
.IsDependentOn("Build")
var settings = new DotNetCoreTestSettings
{
Configuration = configuration,
NoBuild = true
};

DotNetCoreTest("tests/Nest.Queryify.Tests/Nest.Queryify.Tests.csproj", settings);
});

Task("Print-AppVeyor-Environment-Variables")
.WithCriteria(AppVeyor.IsRunningOnAppVeyor)
.Does(() =>
{
CreateDirectory(testResultsPath);
Information("CI: {0}", EnvironmentVariable("CI"));
Information("APPVEYOR_API_URL: {0}", EnvironmentVariable("APPVEYOR_API_URL"));
Information("APPVEYOR_PROJECT_ID: {0}", EnvironmentVariable("APPVEYOR_PROJECT_ID"));
Information("APPVEYOR_PROJECT_NAME: {0}", EnvironmentVariable("APPVEYOR_PROJECT_NAME"));
Information("APPVEYOR_PROJECT_SLUG: {0}", EnvironmentVariable("APPVEYOR_PROJECT_SLUG"));
Information("APPVEYOR_BUILD_FOLDER: {0}", EnvironmentVariable("APPVEYOR_BUILD_FOLDER"));
Information("APPVEYOR_BUILD_ID: {0}", EnvironmentVariable("APPVEYOR_BUILD_ID"));
Information("APPVEYOR_BUILD_NUMBER: {0}", EnvironmentVariable("APPVEYOR_BUILD_NUMBER"));
Information("APPVEYOR_BUILD_VERSION: {0}", EnvironmentVariable("APPVEYOR_BUILD_VERSION"));
Information("APPVEYOR_PULL_REQUEST_NUMBER: {0}", EnvironmentVariable("APPVEYOR_PULL_REQUEST_NUMBER"));
Information("APPVEYOR_PULL_REQUEST_TITLE: {0}", EnvironmentVariable("APPVEYOR_PULL_REQUEST_TITLE"));
Information("APPVEYOR_JOB_ID: {0}", EnvironmentVariable("APPVEYOR_JOB_ID"));
Information("APPVEYOR_REPO_PROVIDER: {0}", EnvironmentVariable("APPVEYOR_REPO_PROVIDER"));
Information("APPVEYOR_REPO_SCM: {0}", EnvironmentVariable("APPVEYOR_REPO_SCM"));
Information("APPVEYOR_REPO_NAME: {0}", EnvironmentVariable("APPVEYOR_REPO_NAME"));
Information("APPVEYOR_REPO_BRANCH: {0}", EnvironmentVariable("APPVEYOR_REPO_BRANCH"));
Information("APPVEYOR_REPO_TAG: {0}", EnvironmentVariable("APPVEYOR_REPO_TAG"));
Information("APPVEYOR_REPO_TAG_NAME: {0}", EnvironmentVariable("APPVEYOR_REPO_TAG_NAME"));
Information("APPVEYOR_REPO_COMMIT: {0}", EnvironmentVariable("APPVEYOR_REPO_COMMIT"));
Information("APPVEYOR_REPO_COMMIT_AUTHOR: {0}", EnvironmentVariable("APPVEYOR_REPO_COMMIT_AUTHOR"));
Information("APPVEYOR_REPO_COMMIT_TIMESTAMP: {0}", EnvironmentVariable("APPVEYOR_REPO_COMMIT_TIMESTAMP"));
Information("APPVEYOR_SCHEDULED_BUILD: {0}", EnvironmentVariable("APPVEYOR_SCHEDULED_BUILD"));
Information("APPVEYOR_FORCED_BUILD: {0}", EnvironmentVariable("APPVEYOR_FORCED_BUILD"));
Information("APPVEYOR_RE_BUILD: {0}", EnvironmentVariable("APPVEYOR_RE_BUILD"));
Information("PLATFORM: {0}", EnvironmentVariable("PLATFORM"));
Information("CONFIGURATION: {0}", EnvironmentVariable("CONFIGURATION"));

var settings = new XUnit2Settings {
XmlReportV1 = true,
NoAppDomain = true,
OutputDirectory = testResultsPath,
};

XUnit2(testAssemblies, settings);
});

Task("Update-AppVeyor-Build-Number")
Task("AppVeyor-Update-Build-Number")
.IsDependentOn("Update-Version-Info")
.WithCriteria(() => AppVeyor.IsRunningOnAppVeyor)
.Does(() =>
{
AppVeyor.UpdateBuildVersion(versionInfo.FullSemVer +"|" +AppVeyor.Environment.Build.Number);
});

Task("Appveyor-Upload-Artifacts")
.IsDependentOn("Package")
.WithCriteria(() => AppVeyor.IsRunningOnAppVeyor)
.Does(() =>
{
foreach(var nupkg in GetFiles(artifacts +"/*.nupkg")) {
AppVeyor.UploadArtifact(nupkg);
}
});

Task("Appveyor")
.WithCriteria(() => AppVeyor.IsRunningOnAppVeyor)
.IsDependentOn("Print-AppVeyor-Environment-Variables")
.IsDependentOn("AppVeyor-Update-Build-Number")
.IsDependentOn("AppVeyor-Upload-Artifacts");

// ************************** //

Task("Restore")
.IsDependentOn("DotNet-MsBuild-Restore");

Task("Build")
.IsDependentOn("Restore")
.IsDependentOn("DotNet-MsBuild");

Task("Test")
.IsDependentOn("Build")
.IsDependentOn("DotNet-Test");

Task("Package")
.IsDependentOn("Build")
.IsDependentOn("DotNet-MsBuild-CopyToArtifacts")
.IsDependentOn("DotNet-MsBuild-Pack");

Task("CI")
.IsDependentOn("AppVeyor")
.IsDependentOn("Default");

//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

Task("Default")
.IsDependentOn("Update-Version-Info")
.IsDependentOn("Update-AppVeyor-Build-Number")
.IsDependentOn("Restore")
.IsDependentOn("Build")
.IsDependentOn("Run-Unit-Tests")
.IsDependentOn("Package")
;
.IsDependentOn("Test")
.IsDependentOn("Package");

//////////////////////////////////////////////////////////////////////
// EXECUTION
Loading

0 comments on commit 2eedaf4

Please sign in to comment.