Skip to content

Commit 778a8f9

Browse files
committed
Include license.txt in nuget packages
This commit includes the license.txt file within each nuget package, since licenseUrl is deprecated. Dependent nuget packages from Json.NET within NEST.nuspec are removed. Lowercase properties in SdkVersion and GlobalJson record types, to align with global.json file conventions
1 parent 9ede040 commit 778a8f9

File tree

5 files changed

+35
-47
lines changed

5 files changed

+35
-47
lines changed

build/Elasticsearch.Net.nuspec

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>Elasticsearch.Net - Elasticsearch .NET low level client</title>
77
<authors>Elastic and contributors</authors>
88
<owners>Elastic</owners>
9-
<licenseUrl>https://github.com/elastic/elasticsearch-net/blob/master/license.txt</licenseUrl>
9+
<license type="file">license.txt</license>
1010
<projectUrl>https://github.com/elastic/elasticsearch-net</projectUrl>
1111
<iconUrl>https://raw.githubusercontent.com/elastic/elasticsearch-net/master/build/nuget-icon.png</iconUrl>
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
@@ -17,15 +17,16 @@
1717
<tags>elasticsearch,elastic,search,lucene,nest</tags>
1818
<dependencies>
1919
<group targetFramework=".NETStandard2.0">
20-
<dependency id="System.Buffers" version="[4.5.0, )"/>
21-
<dependency id="System.Reflection.Emit" version="[4.3.0, )"/>
22-
<dependency id="System.Reflection.Emit.Lightweight" version="[4.3.0, )"/>
23-
<dependency id="System.Threading.Tasks.Extensions" version="[4.4.0, )"/>
24-
<dependency id="System.ValueTuple" version="[4.4.0, )"/>
20+
<dependency id="System.Buffers" version="[4.5.0,)"/>
21+
<dependency id="System.Reflection.Emit" version="[4.3.0,)"/>
22+
<dependency id="System.Reflection.Emit.Lightweight" version="[4.3.0,)"/>
23+
<dependency id="System.Threading.Tasks.Extensions" version="[4.4.0,)"/>
24+
<dependency id="System.ValueTuple" version="[4.4.0,)"/>
2525
</group>
2626
</dependencies>
2727
</metadata>
2828
<files>
29+
<file src="..\license.txt" target="" />
2930
<file src="output\Elasticsearch.Net\netstandard2.0\Elasticsearch.Net.dll" target="lib\netstandard2.0"/>
3031
<file src="output\Elasticsearch.Net\netstandard2.0\Elasticsearch.Net.xml" target="lib\netstandard2.0"/>
3132
</files>

build/NEST.JsonNetSerializer.nuspec

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@
66
<title>NEST.JsonNetSerializer - Elasticsearch .NET custom Json.NET serializer</title>
77
<authors>Elastic and contributors</authors>
88
<owners>Elastic</owners>
9-
<licenseUrl>https://github.com/elastic/elasticsearch-net/blob/master/license.txt</licenseUrl>
9+
<license type="file">license.txt</license>
1010
<projectUrl>https://github.com/elastic/elasticsearch-net</projectUrl>
1111
<iconUrl>https://raw.githubusercontent.com/elastic/elasticsearch-net/master/build/nuget-icon.png</iconUrl>
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13-
<description>NEST 6.x uses an internalized Json.NET serializer. This package enables serialization using your own custom Json.NET serializer</description>
14-
<summary>NEST 6.x uses an internalized Json.NET serializer. This package enables serialization using your own custom Json.NET serializer</summary>
13+
<description>NEST uses an internal serializer. This package enables serialization for your documents using your own custom Json.NET serializer</description>
14+
<summary>NEST uses an internal serializer. This package enables serialization for your documents using your own custom Json.NET serializer</summary>
1515
<releaseNotes>See https://github.com/elastic/elasticsearch-net/releases/tag/$version$</releaseNotes>
1616
<copyright>2017-$year$ Elasticsearch BV</copyright>
1717
<tags>elasticsearch,elastic,search,lucene,nest,serializer,json</tags>
1818
<dependencies>
1919
<group targetFramework=".NETStandard2.0">
20-
<dependency id="NEST" version="[$version$, $nextMajorVersion$)" />
20+
<dependency id="NEST" version="$version$" />
2121
<dependency id="Newtonsoft.Json" version="$jsonDotNetCurrentVersion$" />
2222
</group>
2323
</dependencies>
2424
</metadata>
2525
<files>
26+
<file src="..\license.txt" target="" />
2627
<file src="output\Nest.JsonNetSerializer\netstandard2.0\Nest.JsonNetSerializer.dll" target="lib\netstandard2.0"/>
2728
<file src="output\Nest.JsonNetSerializer\netstandard2.0\Nest.JsonNetSerializer.xml" target="lib\netstandard2.0"/>
2829
</files>

build/NEST.nuspec

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,25 @@
44
<id>NEST</id>
55
<version>$version$</version>
66
<title>NEST - Elasticsearch .NET high level client</title>
7-
87
<authors>Elastic and contributors</authors>
98
<owners>Elastic</owners>
109
<copyright>2014-$year$ Elasticsearch BV</copyright>
11-
1210
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13-
<licenseUrl>https://github.com/elastic/elasticsearch-net/blob/master/license.txt</licenseUrl>
11+
<license type="file">license.txt</license>
1412
<projectUrl>https://github.com/elastic/elasticsearch-net</projectUrl>
1513
<iconUrl>https://raw.githubusercontent.com/elastic/elasticsearch-net/master/build/nuget-icon.png</iconUrl>
16-
1714
<description>Strongly typed interface to Elasticsearch. Fluent and classic object initializer mappings of requests and responses. Uses and exposes Elasticsearch.Net</description>
1815
<summary>Strongly typed interface to Elasticsearch. Fluent and classic object initializer mappings of requests and responses. Uses and exposes Elasticsearch.Net</summary>
1916
<releaseNotes>https://github.com/elastic/elasticsearch-net/releases/tag/$version$</releaseNotes>
2017
<tags>elasticsearch,elastic,search,lucene,nest</tags>
21-
2218
<dependencies>
2319
<group targetFramework=".NETStandard2.0">
24-
<dependency id="Elasticsearch.Net" version="[$version$, $nextMajorVersion$)" />
25-
26-
<!-- since we no longer reference JSON.NET (internalized) we do need to ship with its System references -->
27-
<dependency id="System.ComponentModel.TypeConverter" version="[4.3.0, )"/>
28-
<dependency id="System.Runtime.Serialization.Primitives" version="[4.3.0, )"/>
20+
<dependency id="Elasticsearch.Net" version="$version$" />
2921
</group>
3022
</dependencies>
3123
</metadata>
3224
<files>
25+
<file src="..\license.txt" target="" />
3326
<file src="output\Nest\netstandard2.0\Nest.dll" target="lib\netstandard2.0"/>
3427
<file src="output\Nest\netstandard2.0\Nest.xml" target="lib\netstandard2.0"/>
3528
</files>

build/scripts/Releasing.fs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ open System.Text
77
open System.Xml
88
open System.Xml.Linq
99
open System.Xml.XPath
10+
open Fake.Core;
1011
open Microsoft.FSharp.Quotations
1112
open Microsoft.FSharp.Quotations.Patterns
1213

@@ -34,28 +35,20 @@ module Release =
3435
let semanticVersion = parse version
3536
sprintf "%i" (semanticVersion.Major + 1u)
3637

37-
let private addKeyValue (e:Expr<string>) (builder:StringBuilder) =
38-
// the binding for this tuple looks like key/value should
39-
// be round the other way (but it's correct as is)...
40-
let (value,key) =
41-
match e with
42-
| PropertyGet (eo, pi, li) -> (pi.Name, (pi.GetValue(e) |> string))
43-
| ValueWithName (obj,ty,nm) -> ((obj |> string), nm)
44-
| _ -> failwith (sprintf "%A is not a let-bound value. %A" e (e.GetType()))
45-
38+
let private addKeyValue key value (builder:StringBuilder) =
4639
if (not (String.IsNullOrEmpty value)) then builder.AppendFormat("{0}=\"{1}\";", key, value)
4740
else builder
48-
41+
4942
let private currentMajorVersion version = sprintf "%i" <| version.Full.Major
5043
let private nextMajorVersion version = sprintf "%i" <| version.Full.Major + 1u
5144

5245
let private props version =
5346
let currentMajorVersion = currentMajorVersion version
5447
let nextMajorVersion = nextMajorVersion version
5548
new StringBuilder()
56-
|> addKeyValue <@currentMajorVersion@>
57-
|> addKeyValue <@nextMajorVersion@>
58-
|> addKeyValue <@year@>
49+
|> addKeyValue "currentMajorVersion" currentMajorVersion
50+
|> addKeyValue "nextMajorVersion" nextMajorVersion
51+
|> addKeyValue "year" year
5952

6053
let pack file n properties version =
6154
Tooling.Nuget.Exec [ "pack"; file;
@@ -140,9 +133,9 @@ module Release =
140133

141134
let properties =
142135
props version
143-
|> addKeyValue <@jsonDotNetCurrentVersion@>
144-
|> addKeyValue <@jsonDotNetNextVersion@>
145-
let properties = properties.ToString()
136+
|> addKeyValue "jsonDotNetCurrentVersion" jsonDotNetCurrentVersion
137+
|> addKeyValue "jsonDotNetNextVersion" jsonDotNetNextVersion
138+
|> StringBuilder.toText
146139

147140
let nugetId = p.NugetId
148141
let nuspec = (sprintf @"build/%s.nuspec" nugetId)

build/scripts/Versioning.fs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ module Versioning =
1919
let parse (v:string) = SemVer.parse(v)
2020

2121
//Versions in form of e.g 6.1.0 is inferred as datetime so we bake the json shape into the provider like this
22-
type SdkVersion = { Version:string; }
23-
type GlobalJson = { Sdk: SdkVersion; Version:string; }
22+
type SdkVersion = { version:string; }
23+
type GlobalJson = { sdk: SdkVersion; version:string; }
2424

2525
let private globalJson () =
2626
let jsonString = File.ReadAllText "global.json"
2727
JsonConvert.DeserializeObject<GlobalJson>(jsonString)
2828

2929
let writeVersionIntoGlobalJson version =
3030
let globalJson = globalJson ()
31-
let newGlobalJson = { globalJson with Version = version.ToString(); }
32-
File.WriteAllText("global.json", JsonConvert.SerializeObject(newGlobalJson))
31+
let newGlobalJson = { globalJson with version = version.ToString(); }
32+
File.WriteAllText("global.json", JsonConvert.SerializeObject(newGlobalJson, Formatting.Indented))
3333
printfn "Written (%s) to global.json as the current version will use this version from now on as current in the build" (version.ToString())
3434

35-
let GlobalJsonVersion = parse <| globalJson().Version
35+
let GlobalJsonVersion = parse <| globalJson().version
3636

3737
let private getVersion (args:Commandline.PassedArguments) =
3838
match (args.Target, args.CommandArguments) with
@@ -73,9 +73,9 @@ module Versioning =
7373
match version with
7474
| NoChange _ -> failwithf "cannot run release because no explicit version number was passed on the command line"
7575
| Update (newVersion, currentVersion) ->
76-
// fail if current is greater or equal to the new version
77-
if (currentVersion >= newVersion) then
78-
failwithf "Can not release %O its lower then current %O" newVersion.Full currentVersion.Full
76+
// fail if current is greater than the new version
77+
if (currentVersion > newVersion) then
78+
failwithf "Can not release %O as it's lower then current %O" newVersion.Full currentVersion.Full
7979
writeVersionIntoGlobalJson newVersion.Full
8080
| _ -> ignore()
8181

@@ -103,7 +103,7 @@ module Versioning =
103103
| Some sn -> sn
104104
| None -> failwithf "Could not locate sn.exe"
105105

106-
let private oficialToken = "96c599bbe3e70f5d"
106+
let private officialToken = "96c599bbe3e70f5d"
107107

108108
let private validate dll name =
109109
let sn = sn ()
@@ -122,8 +122,8 @@ module Versioning =
122122

123123
let valid = (out.ExitCode, token)
124124
match valid with
125-
| (Some 0, t) when t = oficialToken -> printfn "%s was signed with official key token %s" name t
126-
| (_, t) -> printfn "%s was not signed with the official token: %s but %s" name oficialToken t
125+
| (Some 0, t) when t = officialToken -> printfn "%s was signed with official key token %s" name t
126+
| (_, t) -> printfn "%s was not signed with the official token: %s but %s" name officialToken t
127127

128128
let private validateDllStrongName dll name =
129129
match File.Exists dll with

0 commit comments

Comments
 (0)