Skip to content

Commit cc2eea7

Browse files
committed
chg sample for .NET Core
1 parent c623d80 commit cc2eea7

11 files changed

Lines changed: 81 additions & 23 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
bin
33
obj
44
packages
5+
.vs
56
*.suo
67
*.user
78
project.lock.json

Hjson/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"supports": {},
77
"dependencies": {
88
"Microsoft.NETCore.Portable.Compatibility": "1.0.1",
9-
"NETStandard.Library": "1.6.0"
9+
"NETStandard.Library": "1.6.1"
1010
},
1111
"frameworks": {
1212
"netstandard1.3": {}

legacy/HjsonSample.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HjsonSample", "sample\HjsonSample.csproj", "{9F5BC310-5CBB-4B03-B7A4-9AD81F95DDC0}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{9F5BC310-5CBB-4B03-B7A4-9AD81F95DDC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{9F5BC310-5CBB-4B03-B7A4-9AD81F95DDC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{9F5BC310-5CBB-4B03-B7A4-9AD81F95DDC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{9F5BC310-5CBB-4B03-B7A4-9AD81F95DDC0}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</PropertyGroup>
3535
<ItemGroup>
3636
<Reference Include="Hjson, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
37-
<HintPath>packages\Hjson.2.1.1\lib\net40\Hjson.dll</HintPath>
37+
<HintPath>..\packages\Hjson.2.1.2\lib\net40\Hjson.dll</HintPath>
3838
<Private>True</Private>
3939
</Reference>
4040
<Reference Include="System" />
@@ -46,14 +46,13 @@
4646
<Reference Include="System.Xml" />
4747
</ItemGroup>
4848
<ItemGroup>
49-
<Compile Include="Program.cs" />
49+
<Compile Include="..\..\sample\Program.cs" />
5050
</ItemGroup>
5151
<ItemGroup>
52-
<None Include="App.config" />
53-
<None Include="packages.config" />
54-
<None Include="test.hjson">
52+
<None Include="..\..\sample\test.hjson">
5553
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5654
</None>
55+
<None Include="packages.config" />
5756
</ItemGroup>
5857
<ItemGroup>
5958
<Folder Include="Properties\" />
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Hjson" version="2.1.1" targetFramework="net46" />
3+
<package id="Hjson" version="2.1.2" targetFramework="net46" />
44
</packages>

sample/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test-out.*

sample/App.config

Lines changed: 0 additions & 6 deletions
This file was deleted.

sample/HjsonSample.sln

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
44
VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HjsonSample", "HjsonSample.csproj", "{9F5BC310-5CBB-4B03-B7A4-9AD81F95DDC0}"
6+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HjsonSample", "HjsonSample.xproj", "{FEDD354F-316F-4B07-B622-D788808AB8C2}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{9F5BC310-5CBB-4B03-B7A4-9AD81F95DDC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{9F5BC310-5CBB-4B03-B7A4-9AD81F95DDC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{9F5BC310-5CBB-4B03-B7A4-9AD81F95DDC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{9F5BC310-5CBB-4B03-B7A4-9AD81F95DDC0}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{FEDD354F-316F-4B07-B622-D788808AB8C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{FEDD354F-316F-4B07-B622-D788808AB8C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{FEDD354F-316F-4B07-B622-D788808AB8C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{FEDD354F-316F-4B07-B622-D788808AB8C2}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE

sample/HjsonSample.xproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>FEDD354F-316F-4B07-B622-D788808AB8C2</ProjectGuid>
10+
<RootNamespace>HjsonSample</RootNamespace>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
13+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
14+
</PropertyGroup>
15+
<PropertyGroup>
16+
<SchemaVersion>2.0</SchemaVersion>
17+
</PropertyGroup>
18+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
19+
</Project>

sample/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ static void Main(string[] args)
1818
var data=HjsonValue.Load("test.hjson").Qo();
1919
Console.WriteLine(data.Qs("hello"));
2020

21-
Console.WriteLine("Saving as json...");
22-
HjsonValue.Save(data, "test.json");
21+
Console.WriteLine("Saving as test-out.json...");
22+
HjsonValue.Save(data, "test-out.json");
2323

24-
Console.WriteLine("Saving as hjson...");
25-
HjsonValue.Save(data, "test2.hjson");
24+
Console.WriteLine("Saving as test-out.hjson...");
25+
HjsonValue.Save(data, "test-out.hjson");
2626

2727
// edit (preserve whitespace and comments)
28-
var wdata=(WscJsonObject)HjsonValue.Load(new StreamReader("test.hjson"), new HjsonOptions { KeepWsc=true }).Qo();
28+
var wdata=(WscJsonObject)HjsonValue.Load("test.hjson", new HjsonOptions { KeepWsc=true }).Qo();
2929

3030
// edit like you normally would
3131
wdata["hugo"]="value";

0 commit comments

Comments
 (0)