Skip to content

Commit 4df8ec7

Browse files
authored
Merge pull request #139 from devlead/feature/sourcepkg
Add LitJson.Source package
2 parents 6abedbb + 122a20a commit 4df8ec7

9 files changed

Lines changed: 95 additions & 35 deletions

File tree

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"cake.tool": {
6-
"version": "2.1.0",
6+
"version": "2.2.0",
77
"commands": [
88
"dotnet-cake"
99
]

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
os: [windows-2019, ubuntu-latest, macos-latest]
17+
os: [windows-2022, ubuntu-latest, macos-latest]
1818
steps:
1919
- name: Get the sources
2020
uses: actions/checkout@v3

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
[Tt]ools/*
88
![Tt]ools/packages.config
99
[Aa]rtifacts/
10-
.[Dd]otnet/
10+
.[Dd]otnet/
11+
.vs/*

LitJSON.sln

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.26124.0
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LitJSON", "src\LitJson\LitJ
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LitJSON.Tests", "test\LitJSON.Tests.csproj", "{E031C1B4-CD87-475E-9283-4571435C65DB}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LitJson.Source", "src\LitJson.Source\LitJSON.Source.csproj", "{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|Any CPU = Debug|Any CPU
@@ -44,5 +46,17 @@ Global
4446
{E031C1B4-CD87-475E-9283-4571435C65DB}.Release|x64.Build.0 = Release|x64
4547
{E031C1B4-CD87-475E-9283-4571435C65DB}.Release|x86.ActiveCfg = Release|x86
4648
{E031C1B4-CD87-475E-9283-4571435C65DB}.Release|x86.Build.0 = Release|x86
49+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Debug|Any CPU.Build.0 = Debug|Any CPU
51+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Debug|x64.ActiveCfg = Debug|Any CPU
52+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Debug|x64.Build.0 = Debug|Any CPU
53+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Debug|x86.ActiveCfg = Debug|Any CPU
54+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Debug|x86.Build.0 = Debug|Any CPU
55+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Release|Any CPU.ActiveCfg = Release|Any CPU
56+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Release|Any CPU.Build.0 = Release|Any CPU
57+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Release|x64.ActiveCfg = Release|Any CPU
58+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Release|x64.Build.0 = Release|Any CPU
59+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Release|x86.ActiveCfg = Release|Any CPU
60+
{F982E34E-F80C-4C9F-AF9B-0E5A34D69A35}.Release|x86.Build.0 = Release|Any CPU
4761
EndGlobalSection
4862
EndGlobal

azure-pipelines.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ strategy:
55
mac:
66
imageName: 'macos-10.15'
77
windows:
8-
imageName: 'windows-2019'
8+
imageName: 'windows-2022'
99

1010
pool:
1111
vmImage: $(imageName)

build.cake

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ string version = null,
2020
semVersion = null,
2121
milestone = null;
2222

23-
FilePath litjsonProjectPath = "./src/LitJson/LitJSON.csproj";
23+
FilePath litjsonProjectPath = "./src/LitJson/LitJSON.csproj",
24+
litjsonSourceProjectPath = "./src/LitJson.Source/LitJSON.Source.csproj";
2425

2526
///////////////////////////////////////////////////////////////////////////////
2627
// SETUP / TEARDOWN
@@ -57,25 +58,6 @@ Setup(ctx =>
5758
.WithProperty("FileVersion", version)
5859
.WithProperty("ContinuousIntegrationBuild", BuildSystem.IsLocalBuild ? bool.FalseString : bool.TrueString);
5960

60-
61-
if(!IsRunningOnWindows())
62-
{
63-
var frameworkPathOverride = ctx.Environment.Runtime.IsCoreClr
64-
? new []{
65-
new DirectoryPath("/Library/Frameworks/Mono.framework/Versions/Current/lib/mono"),
66-
new DirectoryPath("/usr/lib/mono"),
67-
new DirectoryPath("/usr/local/lib/mono")
68-
}
69-
.Select(directory =>directory.Combine("4.5"))
70-
.FirstOrDefault(directory => ctx.DirectoryExists(directory))
71-
?.FullPath + "/"
72-
: new FilePath(typeof(object).Assembly.Location).GetDirectory().FullPath + "/";
73-
74-
// Use FrameworkPathOverride when not running on Windows.
75-
Information("Build will use FrameworkPathOverride={0} since not building on Windows.", frameworkPathOverride);
76-
msBuildSettings.WithProperty("FrameworkPathOverride", frameworkPathOverride);
77-
}
78-
7961
// Executed BEFORE the first task.
8062
Information("Running tasks...");
8163
});
@@ -157,11 +139,20 @@ Task("Package")
157139
DotNetPack(litjsonProjectPath.FullPath,
158140
new DotNetPackSettings {
159141
Configuration = configuration,
142+
NoRestore = true,
160143
NoBuild = true,
161144
IncludeSymbols = true,
162145
OutputDirectory = "./artifacts/nuget",
163-
MSBuildSettings = msBuildSettings,
164-
ArgumentCustomization = args => args.Append("--no-restore")
146+
MSBuildSettings = msBuildSettings
147+
}
148+
);
149+
DotNetPack(litjsonSourceProjectPath.FullPath,
150+
new DotNetPackSettings {
151+
Configuration = configuration,
152+
NoBuild = true,
153+
NoRestore = true,
154+
OutputDirectory = "./artifacts/nuget",
155+
MSBuildSettings = msBuildSettings
165156
}
166157
);
167158
});

global.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
2-
"projects": [
3-
"src"
4-
],
52
"sdk": {
6-
"version": "6.0.201",
3+
"version": "6.0.401",
74
"allowPrerelease": false,
85
"rollForward": "feature"
96
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>net6.0</TargetFrameworks>
4+
<IsPackable>true</IsPackable>
5+
<PackBuildOutput>false</PackBuildOutput>
6+
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
7+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
8+
<ContentTargetFolders>contentFiles</ContentTargetFolders>
9+
<NoWarn>$(NoWarn);CS2008</NoWarn>
10+
<PackageId>LitJson.Source</PackageId>
11+
<Description>A .NET source package 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.
12+
It's quick and lean, without external dependencies.</Description>
13+
<Copyright>The authors disclaim copyright to this source code.</Copyright>
14+
<Authors>Leonardo Boshell, Mattias Karlsson and contributors</Authors>
15+
<Company>Leonardo Boshell, Mattias Karlsson and contributors</Company>
16+
<PackageLicenseExpression>Unlicense</PackageLicenseExpression>
17+
<PackageIcon>litjson.png</PackageIcon>
18+
<RepositoryUrl>https://github.com/LitJSON/litjson</RepositoryUrl>
19+
<RepositoryType>git</RepositoryType>
20+
<PackageTags>JSON;Serializer</PackageTags>
21+
</PropertyGroup>
22+
23+
<ItemGroup>
24+
<PackageFile Include="../LitJson/**/*.cs" Exclude="../LitJson/obj/**;../LitJson/bin/**;../LitJson/AssemblyInfo.cs" PackagePath="$(ContentTargetFolders)\cs\any\LitJson\%(RelativeDir)%(Filename).g%(Extension)" />
25+
<None Include="../LitJson/litjson.png" Pack="true" PackagePath="" />
26+
</ItemGroup>
27+
28+
<ItemGroup>
29+
<PackageReference Include="NuGetizer" Version="0.7.5" PrivateAssets="All" />
30+
</ItemGroup>
31+
32+
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
33+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
34+
</ItemGroup>
35+
36+
</Project>

src/LitJson/LitJSON.csproj

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

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

77
<PropertyGroup>
@@ -20,7 +20,7 @@
2020

2121
<PropertyGroup>
2222
<PackageId>LitJson</PackageId>
23-
<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.
23+
<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.
2424
It's quick and lean, without external dependencies.</Description>
2525
<Copyright>The authors disclaim copyright to this source code.</Copyright>
2626
<Authors>Leonardo Boshell, Mattias Karlsson and contributors</Authors>
@@ -39,12 +39,10 @@ It's quick and lean, without external dependencies.</Description>
3939

4040
<PropertyGroup Condition="'$(TargetFramework)' == 'net20' ">
4141
<DefineConstants>$(DefineConstants);LEGACY</DefineConstants>
42-
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net20' and '$(OS)' == 'Windows_NT'">C:\Windows\Microsoft.NET\Framework\v2.0.50727</FrameworkPathOverride>
4342
</PropertyGroup>
4443

4544
<PropertyGroup Condition="'$(TargetFramework)' == 'net35' ">
4645
<DefineConstants>$(DefineConstants);LEGACY</DefineConstants>
47-
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35' and '$(OS)' == 'Windows_NT'">C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
4846
</PropertyGroup>
4947

5048
<PropertyGroup Condition="'$(TargetFramework)' == 'net40' ">
@@ -58,4 +56,27 @@ It's quick and lean, without external dependencies.</Description>
5856
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.1.0" />
5957
</ItemGroup>
6058

59+
<ItemGroup>
60+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net20" Version="1.0.3" Condition="'$(TargetFramework)' == 'net20' ">
61+
<PrivateAssets>all</PrivateAssets>
62+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
63+
</PackageReference>
64+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net35" Version="1.0.3" Condition="'$(TargetFramework)' == 'net35' ">
65+
<PrivateAssets>all</PrivateAssets>
66+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
67+
</PackageReference>
68+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net40" Version="1.0.3" Condition="'$(TargetFramework)' == 'net40' ">
69+
<PrivateAssets>all</PrivateAssets>
70+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
71+
</PackageReference>
72+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net45" Version="1.0.3" Condition="'$(TargetFramework)' == 'net45' ">
73+
<PrivateAssets>all</PrivateAssets>
74+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
75+
</PackageReference>
76+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net48" Version="1.0.3" Condition="'$(TargetFramework)' == 'net48' ">
77+
<PrivateAssets>all</PrivateAssets>
78+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
79+
</PackageReference>
80+
</ItemGroup>
81+
6182
</Project>

0 commit comments

Comments
 (0)