Skip to content

Commit 7f336cb

Browse files
authored
2.0.4 Release
2.0.4 Release
2 parents 9ff5adc + dfbe363 commit 7f336cb

Some content is hidden

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

45 files changed

+685
-216
lines changed

.github/dependabot.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: nuget
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
ignore:
9+
- dependency-name: Microsoft.NET.Test.Sdk
10+
versions:
11+
- 16.8.3
12+
- 16.9.1
13+
- dependency-name: Microsoft.Extensions.Primitives
14+
versions:
15+
- 5.0.0

Hocon.sln

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Global
130130
{1437D06E-EA95-4599-A6D0-80C1EC774A5A} = {C3695FA9-B189-4881-864A-8377EE987B74}
131131
{7A497666-0799-4165-88A4-1DB37DB65A8D} = {C3695FA9-B189-4881-864A-8377EE987B74}
132132
{181D6251-3B11-4F2D-92E5-631C99D9F791} = {C3695FA9-B189-4881-864A-8377EE987B74}
133+
{6D1D4813-7AB6-4268-A9DF-627A60E08FB1} = {C3695FA9-B189-4881-864A-8377EE987B74}
133134
EndGlobalSection
134135
GlobalSection(ExtensibilityGlobals) = postSolution
135136
SolutionGuid = {557DB117-9178-4935-B327-3017C53186FE}

RELEASE_NOTES.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
### 2.0.4 October 14 2021 ####
2+
* [Change config file load priority](https://github.com/akkadotnet/HOCON/issues/260)
3+
* [Bugfix: Performance issue reported in #276](https://github.com/akkadotnet/HOCON/issues/277)
4+
* [Bugfix: Quoted string should be closed by the same starting token](https://github.com/akkadotnet/HOCON/issues/278)
5+
* [Bugfix: Flatten did not flatten all the way down](https://github.com/akkadotnet/HOCON/issues/280)
6+
* [Bugfix: Escape backslash when serializing](https://github.com/akkadotnet/HOCON/issues/351)
7+
8+
- `HoconConfigurationFactory.Default()` will try and load HOCON configuration from default named files based on this priority:
9+
1. application.conf
10+
2. application.hocon
11+
3. application.properties
12+
4. app.conf
13+
5. app.hocon
14+
6. app.properties
15+
16+
- If `HoconConfigurationFactory.FromFile()` is called without any file extensions, it will try to load the file using these extensions: .conf, .hocon, and finally .properties
17+
118
### 2.0.3 February 28 2020 ####
219
Bugfixes and improvements made to HOCON 2.0.0
320

build-system/azure-pipeline.template.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ jobs:
1515
pool:
1616
vmImage: ${{ parameters.vmImage }}
1717
steps:
18+
- task: UseDotNet@2
19+
displayName: 'Use .NET 5 SDK 5.0'
20+
inputs:
21+
version: 5.0.x
22+
- task: UseDotNet@2
23+
displayName: 'Use .NET Core Runtime 3.1'
24+
inputs:
25+
packageType: runtime
26+
version: 3.1.x
27+
- task: UseDotNet@2
28+
displayName: 'Use .NET Core Runtime 2.1'
29+
inputs:
30+
packageType: runtime
31+
version: 2.1.x
1832
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
1933
clean: false # whether to fetch clean each time
2034
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules

build-system/pr-validation.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
parameters:
1919
name: 'nuget_pack'
2020
displayName: 'NuGet Pack'
21-
vmImage: 'vs2017-win2016'
21+
vmImage: 'windows-2019'
2222
scriptFileName: ./build.cmd
2323
scriptArgs: nuget
2424
outputDirectory: 'bin/nuget'
@@ -27,7 +27,7 @@ jobs:
2727
parameters:
2828
name: 'windows_tests'
2929
displayName: 'Windows Tests'
30-
vmImage: 'vs2017-win2016'
30+
vmImage: 'windows-2019'
3131
scriptFileName: build.cmd
3232
scriptArgs: runtests
3333
outputDirectory: 'TestResults'
@@ -36,7 +36,7 @@ jobs:
3636
parameters:
3737
name: 'windows_perf_tests'
3838
displayName: 'Windows Performance Tests'
39-
vmImage: 'vs2017-win2016'
39+
vmImage: 'windows-2019'
4040
scriptFileName: build.cmd
4141
scriptArgs: nbench
4242
outputDirectory: 'PerfResults'
@@ -45,7 +45,7 @@ jobs:
4545
parameters:
4646
name: 'linux_tests'
4747
displayName: 'Linux Tests'
48-
vmImage: 'ubuntu-16.04'
48+
vmImage: 'ubuntu-20.04'
4949
scriptFileName: build.sh
5050
scriptArgs: runtests
5151
outputDirectory: 'TestResults'
@@ -54,7 +54,7 @@ jobs:
5454
parameters:
5555
name: 'linux_perf_tests'
5656
displayName: 'Linux Performance Tests'
57-
vmImage: 'ubuntu-16.04'
57+
vmImage: 'ubuntu-20.04'
5858
scriptFileName: build.sh
5959
scriptArgs: nbench
6060
outputDirectory: 'PerfResults'

build-system/windows-release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for reference
33

44
pool:
5-
vmImage: vs2017-win2016
5+
vmImage: windows-2019
66
demands: Cmd
77

88
trigger:

build.fsx

+16
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ let overrideVersionSuffix (project:string) =
202202
| _ -> versionSuffix // add additional matches to publish different versions for different projects in solution
203203
Target "CreateNuget" (fun _ ->
204204
let projects = !! "src/**/*.csproj"
205+
-- "src/examples/**/*" // Don't publish any examples
205206
-- "src/**/*Tests.csproj" // Don't publish unit tests
206207
-- "src/**/*Tests*.csproj"
207208

@@ -236,6 +237,19 @@ Target "PublishNuget" (fun _ ->
236237
projects |> Seq.iter (runSingleProject)
237238
)
238239

240+
Target "PublishLocalNuget" (fun _ ->
241+
let projects = !! "./bin/nuget/*.nupkg"
242+
let source = getBuildParamOrDefault "nugetpublishurl" ""
243+
244+
if (not (source = "")) then
245+
let runSingleProject project =
246+
Shell.Exec
247+
(toolsDir @@ "nuget", sprintf "add %s -source %s" project source)
248+
|> ignore
249+
250+
projects |> Seq.iter (runSingleProject)
251+
)
252+
239253
//--------------------------------------------------------------------------------
240254
// Documentation
241255
//--------------------------------------------------------------------------------
@@ -293,6 +307,7 @@ Target "Help" <| fun _ ->
293307
Target "BuildRelease" DoNothing
294308
Target "All" DoNothing
295309
Target "Nuget" DoNothing
310+
Target "LocalNuget" DoNothing
296311

297312
// build dependencies
298313
"Clean" ==> "AssemblyInfo" ==> "Build" ==> "BuildRelease"
@@ -304,6 +319,7 @@ Target "Nuget" DoNothing
304319
// nuget dependencies
305320
"Clean" ==> "Build" ==> "CreateNuget"
306321
"CreateNuget" ==> "SignPackages" ==> "PublishNuget" ==> "Nuget"
322+
"CreateNuget" ==> "PublishLocalNuget" ==> "LocalNuget"
307323

308324
// docs
309325
"Clean" ==> "BuildRelease" ==> "Docfx"

build.ps1

+2-45
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Param(
3131

3232
$FakeVersion = "4.61.2"
3333
$DotNetChannel = "LTS";
34-
$DotNetVersion = "2.1.504";
35-
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/v$DotNetVersion/scripts/obtain/dotnet-install.ps1";
34+
$DotNetVersion = "3.1.201";
35+
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
3636
$NugetVersion = "4.1.0";
3737
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe"
3838
$ProtobufVersion = "3.4.0"
@@ -46,49 +46,6 @@ if (!(Test-Path $ToolPath)) {
4646
New-Item -Path $ToolPath -Type directory | out-null
4747
}
4848

49-
###########################################################################
50-
# INSTALL .NET CORE CLI
51-
###########################################################################
52-
53-
Function Remove-PathVariable([string]$VariableToRemove)
54-
{
55-
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
56-
if ($path -ne $null)
57-
{
58-
$newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove }
59-
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User")
60-
}
61-
62-
$path = [Environment]::GetEnvironmentVariable("PATH", "Process")
63-
if ($path -ne $null)
64-
{
65-
$newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove }
66-
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process")
67-
}
68-
}
69-
70-
# Get .NET Core CLI path if installed.
71-
$FoundDotNetCliVersion = $null;
72-
if (Get-Command dotnet -ErrorAction SilentlyContinue) {
73-
$FoundDotNetCliVersion = dotnet --version;
74-
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
75-
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
76-
}
77-
78-
if($FoundDotNetCliVersion -ne $DotNetVersion) {
79-
$InstallPath = Join-Path $PSScriptRoot ".dotnet"
80-
if (!(Test-Path $InstallPath)) {
81-
mkdir -Force $InstallPath | Out-Null;
82-
}
83-
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1");
84-
& $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath -Architecture x64;
85-
86-
Remove-PathVariable "$InstallPath"
87-
$env:PATH = "$InstallPath;$env:PATH"
88-
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
89-
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
90-
}
91-
9249
###########################################################################
9350
# INSTALL NUGET
9451
###########################################################################

build.sh

+2-18
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ NUGET_EXE=$TOOLS_DIR/nuget.exe
1111
NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe
1212
FAKE_VERSION=4.61.2
1313
FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe
14-
DOTNET_VERSION=2.1.500
14+
DOTNET_VERSION=3.1.201
15+
DOTNET_VERSION2=2.1.500
1516
DOTNET_INSTALLER_URL=https://raw.githubusercontent.com/dotnet/cli/v$DOTNET_VERSION/scripts/obtain/dotnet-install.sh
1617
DOTNET_CHANNEL=LTS;
1718
DOCFX_VERSION=2.40.5
@@ -42,23 +43,6 @@ if [ ! -d "$TOOLS_DIR" ]; then
4243
mkdir "$TOOLS_DIR"
4344
fi
4445

45-
###########################################################################
46-
# INSTALL .NET CORE CLI
47-
###########################################################################
48-
49-
echo "Installing .NET CLI..."
50-
if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
51-
mkdir "$SCRIPT_DIR/.dotnet"
52-
fi
53-
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" $DOTNET_INSTALLER_URL
54-
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --channel $DOTNET_CHANNEL --install-dir .dotnet --no-path
55-
export PATH="$SCRIPT_DIR/.dotnet":$PATH
56-
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
57-
export DOTNET_CLI_TELEMETRY_OPTOUT=1
58-
chmod -R 0755 ".dotnet"
59-
"$SCRIPT_DIR/.dotnet/dotnet" --info
60-
61-
6246
###########################################################################
6347
# INSTALL NUGET
6448
###########################################################################

src/HOCON.Tests/QuotedString.cs

+16
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,21 @@ public void Bugfix_190_should_unquote_quotedstrings_on_parse()
3232
unwrapped["gremlin"].Should().Be("Akka.Remote.Transport.FailureInjectorProvider,Akka.Remote");
3333
unwrapped["trttl"].Should().Be("Akka.Remote.Transport.ThrottlerProvider,Akka.Remote");
3434
}
35+
36+
[Fact]
37+
public void Should_terminate_string_tokenize_with_the_same_quote_type()
38+
{
39+
var hocon = @"
40+
quote1 = ""The 'string' should be tokenized as one string""
41+
quote2 = 'The ""string"" should be tokenized as one string'
42+
quote3 = """"""The '''string''' should be tokenized as one string""""""
43+
quote4 = '''The """"""string"""""" should be tokenized as one string'''
44+
";
45+
var parsed = HoconParser.Parse(hocon);
46+
parsed.GetString("quote1").Should().Be("The 'string' should be tokenized as one string");
47+
parsed.GetString("quote2").Should().Be("The \"string\" should be tokenized as one string");
48+
parsed.GetString("quote3").Should().Be("The '''string''' should be tokenized as one string");
49+
parsed.GetString("quote4").Should().Be("The \"\"\"string\"\"\" should be tokenized as one string");
50+
}
3551
}
3652
}

src/Hocon.API.Tests/Hocon.API.Tests.csproj

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\common.props" />
23

34
<PropertyGroup>
4-
<TargetFramework>net461</TargetFramework>
5-
5+
<TargetFramework>$(NetFrameworkTestVersion)</TargetFramework>
66
<IsPackable>false</IsPackable>
7-
8-
<RootNamespace>Hocon.API.Tests</RootNamespace>
9-
10-
<AssemblyName>Hocon.API.Tests</AssemblyName>
117
</PropertyGroup>
128

139
<ItemGroup>
@@ -33,10 +29,11 @@
3329
</ItemGroup>
3430

3531
<ItemGroup>
32+
<PackageReference Include="DiffPlex" Version="1.7.0" />
3633
<PackageReference Include="ApiApprover" Version="9.3.0" />
37-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
38-
<PackageReference Include="xunit" Version="2.4.1" />
39-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
34+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
35+
<PackageReference Include="xunit" Version="$(XunitVersion)" />
36+
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)">
4037
<PrivateAssets>all</PrivateAssets>
4138
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4239
</PackageReference>

0 commit comments

Comments
 (0)