Permalink
Browse files

(GH-69) Add .NET 3.5 and .NET 4.0 targets

* Added .NET 3.5 target
* Added .NET 4.0 target
* Added source link
* Added source to symbols package
* Added NuGet package description
* Added CLRF fix for AppVeyor
* Fixes #69
  • Loading branch information...
devlead committed Jan 7, 2018
1 parent 37dbc78 commit c98875112f1b0289de739569590021ec3e23f034
Showing with 46 additions and 10 deletions.
  1. +4 −1 appveyor.yml
  2. +20 −7 build.cake
  3. +1 −1 src/LitJson/JsonWriter.cs
  4. +21 −1 src/LitJson/LitJSON.csproj
View
@@ -6,4 +6,7 @@ build_script:
- ps: .\build.ps1 --target="AppVeyor" --verbosity=Verbose
# Tests
test: off
test: off
init:
- git config --global core.autocrlf true
View
@@ -83,7 +83,7 @@ Task("Clean")
"./test/bin",
"./src/obj",
"./test/obj",
"./artifacts/nuget"
"./artifacts/nuget"
}
);
});
@@ -102,7 +102,8 @@ Task("Build")
DotNetCoreBuild("./LitJSON.sln",
new DotNetCoreBuildSettings {
Configuration = configuration,
MSBuildSettings = msBuildSettings
MSBuildSettings = msBuildSettings,
ArgumentCustomization = args => args.Append("--no-restore")
}
);
});
@@ -114,7 +115,8 @@ Task("Test")
new DotNetCoreTestSettings {
Configuration = configuration,
Framework = "netcoreapp2.0",
NoBuild = true
NoBuild = true,
ArgumentCustomization = args => args.Append("--no-restore")
}
);
@@ -123,16 +125,28 @@ Task("Test")
});
});
Task("Test-SourceLink")
.IsDependentOn("Build")
.WithCriteria(IsRunningOnWindows())
.Does(() => {
foreach(var asssembly in GetFiles("./src/LitJSON/bin/" + configuration + "/**/*.dll"))
{
DotNetCoreTool("./src/LitJSON/LitJSON.csproj", "sourcelink", $"test {asssembly}");
}
});
Task("Package")
.IsDependentOn("Test")
.IsDependentOn("Test-SourceLink")
.Does(() => {
DotNetCorePack("./src/LitJSON/LitJSON.csproj",
new DotNetCorePackSettings {
Configuration = configuration,
NoBuild = true,
IncludeSymbols = true,
OutputDirectory = "./artifacts/nuget",
MSBuildSettings = msBuildSettings
MSBuildSettings = msBuildSettings,
ArgumentCustomization = args => args.Append("--no-restore")
}
);
});
@@ -141,7 +155,6 @@ Task("Upload-AppVeyor-Artifacts")
.IsDependentOn("Package")
.WithCriteria(AppVeyor.IsRunningOnAppVeyor)
.Does(() => {
foreach(var artifact in GetFiles("./artifacts/**/*.*"))
{
AppVeyor.UploadArtifact(artifact);
@@ -165,7 +178,7 @@ Task("Publish-MyGet")
if(string.IsNullOrEmpty(apiUrl)) {
throw new InvalidOperationException("Could not resolve MyGet API url.");
}
foreach(var package in (GetFiles("./artifacts/nuget/*.nupkg") - GetFiles("./artifacts/nuget/*.symbols.nupkg")))
{
DotNetCoreNuGetPush(package.FullPath,
@@ -194,7 +207,7 @@ Task("Publish-NuGet")
if(string.IsNullOrEmpty(apiUrl)) {
throw new InvalidOperationException("Could not resolve MyGet API url.");
}
foreach(var package in (GetFiles("./artifacts/nuget/*.nupkg") - GetFiles("./artifacts/nuget/*.symbols.nupkg")))
{
DotNetCoreNuGetPush(package.FullPath,
@@ -223,7 +223,7 @@ private void PutNewline (bool add_comma)
writer.Write (',');
if (pretty_print && ! context.ExpectingValue)
writer.Write ('\n');
writer.Write (Environment.NewLine);
}
private void PutString (string str)
View
@@ -1,15 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45;netstandard1.5</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net45;netstandard1.5;net40;net35</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DebugType>embedded</DebugType>
<SourceLinkCreate Condition="'$(OS)' == 'Windows_NT'">true</SourceLinkCreate>
</PropertyGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<PackageReference Include="SourceLink.Create.GitHub" Version="2.1.0" PrivateAssets="All" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.1.0" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.1.0" />
</ItemGroup>
<PropertyGroup>
<PackageId>LitJson</PackageId>
<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.
It's quick and lean, without external dependencies.</Description>
<Copyright>The authors disclaim copyright to this source code.</Copyright>
<Authors>Leonardo Boshell, Mattias Karlsson and contributors</Authors>
<Company>Leonardo Boshell, Mattias Karlsson and contributors</Company>
@@ -18,6 +28,16 @@
<RepositoryUrl>https://github.com/LitJSON/litjson</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>JSON;Serializer</PackageTags>
<IncludeSource>true</IncludeSource>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net35' ">
<DefineConstants>$(DefineConstants);LEGACY</DefineConstants>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35' and '$(OS)' == 'Windows_NT'">C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net40' ">
<DefineConstants>$(DefineConstants);LEGACY</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">

0 comments on commit c988751

Please sign in to comment.