Skip to content

Commit 7929086

Browse files
committed
Merge branch 'devlead-feature/GH-69' into develop
2 parents 37dbc78 + c988751 commit 7929086

4 files changed

Lines changed: 46 additions & 10 deletions

File tree

appveyor.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ build_script:
66
- ps: .\build.ps1 --target="AppVeyor" --verbosity=Verbose
77

88
# Tests
9-
test: off
9+
test: off
10+
11+
init:
12+
- git config --global core.autocrlf true

build.cake

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Task("Clean")
8383
"./test/bin",
8484
"./src/obj",
8585
"./test/obj",
86-
"./artifacts/nuget"
86+
"./artifacts/nuget"
8787
}
8888
);
8989
});
@@ -102,7 +102,8 @@ Task("Build")
102102
DotNetCoreBuild("./LitJSON.sln",
103103
new DotNetCoreBuildSettings {
104104
Configuration = configuration,
105-
MSBuildSettings = msBuildSettings
105+
MSBuildSettings = msBuildSettings,
106+
ArgumentCustomization = args => args.Append("--no-restore")
106107
}
107108
);
108109
});
@@ -114,7 +115,8 @@ Task("Test")
114115
new DotNetCoreTestSettings {
115116
Configuration = configuration,
116117
Framework = "netcoreapp2.0",
117-
NoBuild = true
118+
NoBuild = true,
119+
ArgumentCustomization = args => args.Append("--no-restore")
118120
}
119121
);
120122

@@ -123,16 +125,28 @@ Task("Test")
123125
});
124126
});
125127

128+
Task("Test-SourceLink")
129+
.IsDependentOn("Build")
130+
.WithCriteria(IsRunningOnWindows())
131+
.Does(() => {
132+
foreach(var asssembly in GetFiles("./src/LitJSON/bin/" + configuration + "/**/*.dll"))
133+
{
134+
DotNetCoreTool("./src/LitJSON/LitJSON.csproj", "sourcelink", $"test {asssembly}");
135+
}
136+
});
137+
126138
Task("Package")
127139
.IsDependentOn("Test")
140+
.IsDependentOn("Test-SourceLink")
128141
.Does(() => {
129142
DotNetCorePack("./src/LitJSON/LitJSON.csproj",
130143
new DotNetCorePackSettings {
131144
Configuration = configuration,
132145
NoBuild = true,
133146
IncludeSymbols = true,
134147
OutputDirectory = "./artifacts/nuget",
135-
MSBuildSettings = msBuildSettings
148+
MSBuildSettings = msBuildSettings,
149+
ArgumentCustomization = args => args.Append("--no-restore")
136150
}
137151
);
138152
});
@@ -141,7 +155,6 @@ Task("Upload-AppVeyor-Artifacts")
141155
.IsDependentOn("Package")
142156
.WithCriteria(AppVeyor.IsRunningOnAppVeyor)
143157
.Does(() => {
144-
145158
foreach(var artifact in GetFiles("./artifacts/**/*.*"))
146159
{
147160
AppVeyor.UploadArtifact(artifact);
@@ -165,7 +178,7 @@ Task("Publish-MyGet")
165178
if(string.IsNullOrEmpty(apiUrl)) {
166179
throw new InvalidOperationException("Could not resolve MyGet API url.");
167180
}
168-
181+
169182
foreach(var package in (GetFiles("./artifacts/nuget/*.nupkg") - GetFiles("./artifacts/nuget/*.symbols.nupkg")))
170183
{
171184
DotNetCoreNuGetPush(package.FullPath,
@@ -194,7 +207,7 @@ Task("Publish-NuGet")
194207
if(string.IsNullOrEmpty(apiUrl)) {
195208
throw new InvalidOperationException("Could not resolve MyGet API url.");
196209
}
197-
210+
198211
foreach(var package in (GetFiles("./artifacts/nuget/*.nupkg") - GetFiles("./artifacts/nuget/*.symbols.nupkg")))
199212
{
200213
DotNetCoreNuGetPush(package.FullPath,

src/LitJson/JsonWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private void PutNewline (bool add_comma)
223223
writer.Write (',');
224224

225225
if (pretty_print && ! context.ExpectingValue)
226-
writer.Write ('\n');
226+
writer.Write (Environment.NewLine);
227227
}
228228

229229
private void PutString (string str)

src/LitJson/LitJSON.csproj

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net45;netstandard1.5</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net45;netstandard1.5;net40;net35</TargetFrameworks>
55
</PropertyGroup>
66

77
<PropertyGroup>
88
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
9+
<DebugType>embedded</DebugType>
10+
<SourceLinkCreate Condition="'$(OS)' == 'Windows_NT'">true</SourceLinkCreate>
911
</PropertyGroup>
1012

13+
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
14+
<PackageReference Include="SourceLink.Create.GitHub" Version="2.1.0" PrivateAssets="All" />
15+
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.1.0" />
16+
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.1.0" />
17+
</ItemGroup>
18+
1119
<PropertyGroup>
1220
<PackageId>LitJson</PackageId>
21+
<Description>A .Net library to handle conversions from and to JSON (JavaScript Object Notation) strings. Written in C#, and it’s intended to be small, fast and easy to use.
22+
It's quick and lean, without external dependencies.</Description>
1323
<Copyright>The authors disclaim copyright to this source code.</Copyright>
1424
<Authors>Leonardo Boshell, Mattias Karlsson and contributors</Authors>
1525
<Company>Leonardo Boshell, Mattias Karlsson and contributors</Company>
@@ -18,6 +28,16 @@
1828
<RepositoryUrl>https://github.com/LitJSON/litjson</RepositoryUrl>
1929
<RepositoryType>git</RepositoryType>
2030
<PackageTags>JSON;Serializer</PackageTags>
31+
<IncludeSource>true</IncludeSource>
32+
</PropertyGroup>
33+
34+
<PropertyGroup Condition="'$(TargetFramework)' == 'net35' ">
35+
<DefineConstants>$(DefineConstants);LEGACY</DefineConstants>
36+
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35' and '$(OS)' == 'Windows_NT'">C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
37+
</PropertyGroup>
38+
39+
<PropertyGroup Condition="'$(TargetFramework)' == 'net40' ">
40+
<DefineConstants>$(DefineConstants);LEGACY</DefineConstants>
2141
</PropertyGroup>
2242

2343
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">

0 commit comments

Comments
 (0)