Skip to content

Commit 9a8a026

Browse files
committed
Merge branch 'release/0.12.0'
* release/0.12.0: Added Bitrise badge to readme Updated to Cake 0.25.0 * PowerShell core bootstrapper support Updated README with the latest supported .NET targets Added .NET 2.0 target Added GitVersion config
2 parents 52d96c7 + a9bbc1c commit 9a8a026

5 files changed

Lines changed: 93 additions & 41 deletions

File tree

GitVersion.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
branches:
2+
master:
3+
mode: ContinuousDelivery
4+
tag:
5+
increment: Patch
6+
prevent-increment-of-merged-branch-version: true
7+
track-merge-target: false
8+
dev(elop)?(ment)?$:
9+
mode: ContinuousDeployment
10+
tag: alpha
11+
increment: Minor
12+
prevent-increment-of-merged-branch-version: false
13+
track-merge-target: true

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ Notation) strings.
1313

1414
## Continuous integration
1515

16-
| Build server | Platform | Build status |
17-
|-----------------------------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
18-
| AppVeyor | Windows | [![AppVeyor branch](https://img.shields.io/appveyor/ci/litjson/litjson/develop.svg)](https://ci.appveyor.com/project/litjson/litjson/branch/develop) |
19-
| Travis | Linux / OS X | [![Travis build status](https://travis-ci.org/LitJSON/litjson.svg?branch=develop)](https://travis-ci.org/LitJSON/litjson) |
16+
| Build server | Platform | Build status |
17+
|-----------------------------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
18+
| AppVeyor | Windows | [![AppVeyor branch](https://img.shields.io/appveyor/ci/litjson/litjson/develop.svg)](https://ci.appveyor.com/project/litjson/litjson/branch/develop) |
19+
| Bitrise | MacOS | [![Build Status](https://www.bitrise.io/app/5975a00ca2666fb1/status.svg?token=OZnv4YWRw71IVax38Wi50Q&branch=develop)](https://www.bitrise.io/app/5975a00ca2666fb1) |
20+
| Bitrise | Linux | [![Build Status](https://www.bitrise.io/app/4c9ee62c6ba13630/status.svg?token=RBH8UKw-68lQYjageT8VoQ&branch=develop)](https://www.bitrise.io/app/4c9ee62c6ba13630) |
21+
| Travis | Linux / MacOS | [![Travis build status](https://travis-ci.org/LitJSON/litjson.svg?branch=develop)](https://travis-ci.org/LitJSON/litjson) |
2022

2123

2224
## Compiling
@@ -82,10 +84,11 @@ LitJSON currently targets and supports
8284
* .NET Standard 2.0
8385
* .NET Standard 1.5
8486
* .NET Framework 4.5 and above
87+
* .NET Framework 4.0
88+
* .NET Framework 3.5 (including SQLCLR, for which [WCOMAB/SqlServerSlackAPI](https://github.com/WCOMAB/SqlServerSlackAPI) is an example of)
89+
* .NET Framework 2.0
8590
* Mono 4.4.2 and above
8691

87-
But the code is very portable and can even be compiled under SQLCLR, which [WCOMAB/SqlServerSlackAPI](https://github.com/WCOMAB/SqlServerSlackAPI) is an example of.
88-
8992
#### Prereleases
9093

9194
Each merge to develop is published to our NuGet feed on [MyGet](mygetgallery).

build.ps1

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
$CakeVersion = "0.24.0"
1+
$CakeVersion = "0.25.0"
22
$DotNetChannel = "LTS";
3-
$DotNetVersion = "2.1.3";
4-
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/v2.1.3/scripts/obtain/dotnet-install.ps1";
5-
$ENV:CAKE_NUGET_USEINPROCESSCLIENT='true'
3+
$DotNetVersion = "2.1.4";
4+
$IsRunningOnUnix = [System.Environment]::OSVersion.Platform -eq [System.PlatformID]::Unix
65

76
# Make sure tools folder exists
87
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
@@ -34,23 +33,44 @@ Function Remove-PathVariable([string]$VariableToRemove)
3433
}
3534

3635
# Get .NET Core CLI path if installed.
37-
$FoundDotNetCliVersion = $null;
36+
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
37+
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
38+
$FoundDotNetCliVersion = $null
39+
40+
3841
if (Get-Command dotnet -ErrorAction SilentlyContinue) {
39-
$FoundDotNetCliVersion = dotnet --version;
42+
$FoundDotNetCliVersion = dotnet --version
4043
}
4144

42-
if($FoundDotNetCliVersion -ne $DotNetVersion) {
45+
if($FoundDotNetCliVersion -ne $DotNetVersion)
46+
{
4347
$InstallPath = Join-Path $PSScriptRoot ".dotnet"
48+
Remove-PathVariable "$InstallPath"
49+
$env:PATH = "$InstallPath;$env:PATH"
50+
4451
if (!(Test-Path $InstallPath)) {
45-
mkdir -Force $InstallPath | Out-Null;
52+
New-Item -ItemType Directory -Force $InstallPath | Out-Null;
4653
}
47-
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1");
48-
& $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath;
4954

50-
Remove-PathVariable "$InstallPath"
51-
$env:PATH = "$InstallPath;$env:PATH"
52-
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
53-
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
55+
[string] $InstalledDotNetVersion = Get-ChildItem -Path ./.dotnet -File `
56+
| Where-Object { $_.Name -eq 'dotnet' -or $_.Name -eq 'dotnet.exe' } `
57+
| ForEach-Object { &$_.FullName --version }
58+
59+
if ($InstalledDotNetVersion -eq $DotNetVersion)
60+
{
61+
}
62+
elseif ($IsRunningOnUnix)
63+
{
64+
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/v2.1.4/scripts/obtain/dotnet-install.sh";
65+
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath/dotnet-install.sh");
66+
sudo bash "$InstallPath/dotnet-install.sh" --version $DotNetVersion --install-dir "$InstallPath" --no-path
67+
}
68+
else
69+
{
70+
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/v2.1.4/scripts/obtain/dotnet-install.ps1";
71+
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1");
72+
& $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath;
73+
}
5474
}
5575

5676
###########################################################################
@@ -67,17 +87,34 @@ Function Unzip
6787

6888

6989
# Make sure Cake has been installed.
70-
$CakePath = Join-Path $ToolPath "Cake.$CakeVersion/Cake.exe"
71-
if (!(Test-Path $CakePath)) {
90+
$CakePath = Join-Path $ToolPath "Cake.$CakeVersion"
91+
$CakeExePath = Join-Path $CakePath "Cake.exe"
92+
$CakeZipPath = Join-Path $ToolPath "Cake.zip"
93+
if (!(Test-Path $CakeExePath)) {
7294
Write-Host "Installing Cake $CakeVersion..."
73-
(New-Object System.Net.WebClient).DownloadFile("https://www.nuget.org/api/v2/package/Cake/$CakeVersion", "$ToolPath\Cake.zip")
74-
Unzip "$ToolPath\Cake.zip" "$ToolPath/Cake.$CakeVersion"
75-
Remove-Item "$ToolPath\Cake.zip"
95+
(New-Object System.Net.WebClient).DownloadFile("https://www.nuget.org/api/v2/package/Cake/$CakeVersion", $CakeZipPath)
96+
Unzip $CakeZipPath $CakePath
97+
Remove-Item $CakeZipPath
7698
}
7799

78100
###########################################################################
79101
# RUN BUILD SCRIPT
80102
###########################################################################
81-
82-
& "$CakePath" $args
83-
exit $LASTEXITCODE
103+
if ($IsRunningOnUnix)
104+
{
105+
& mono "$CakeExePath" --bootstrap
106+
if ($LASTEXITCODE -eq 0)
107+
{
108+
& mono "$CakeExePath" $args
109+
}
110+
exit $LASTEXITCODE
111+
}
112+
else
113+
{
114+
& "$CakeExePath" --bootstrap
115+
if ($LASTEXITCODE -eq 0)
116+
{
117+
& "$CakeExePath" $args
118+
}
119+
exit $LASTEXITCODE
120+
}

build.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
#!/usr/bin/env bash
2-
##########################################################################
3-
# This is the Cake bootstrapper script for Linux and OS X.
4-
# This file was downloaded from https://github.com/cake-build/resources
5-
# Feel free to change this file to fit your needs.
6-
##########################################################################
7-
8-
# Define directories.
2+
# Define varibles
3+
CAKE_VERSION=0.25.0
4+
DOTNET_SDK_VERSION=2.1.4
95
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
106
TOOLS_DIR=$SCRIPT_DIR/tools
11-
CAKE_VERSION=0.24.0
127
CAKE_EXE=$TOOLS_DIR/Cake.$CAKE_VERSION/Cake.exe
13-
export CAKE_NUGET_USEINPROCESSCLIENT="true"
148

159
# Make sure the tools folder exist.
1610
if [ ! -d "$TOOLS_DIR" ]; then
@@ -25,8 +19,8 @@ echo "Installing .NET CLI..."
2519
if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
2620
mkdir "$SCRIPT_DIR/.dotnet"
2721
fi
28-
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://raw.githubusercontent.com/dotnet/cli/v2.1.3/scripts/obtain/dotnet-install.sh
29-
sudo bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 2.1.3 --install-dir .dotnet --no-path
22+
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://raw.githubusercontent.com/dotnet/cli/v$DOTNET_SDK_VERSION/scripts/obtain/dotnet-install.sh
23+
sudo bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_SDK_VERSION --install-dir .dotnet --no-path
3024
export PATH="$SCRIPT_DIR/.dotnet":$PATH
3125
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
3226
export DOTNET_CLI_TELEMETRY_OPTOUT=1
@@ -57,4 +51,4 @@ fi
5751
###########################################################################
5852

5953
# Start Cake
60-
exec mono "$CAKE_EXE" "$@"
54+
(exec mono "$CAKE_EXE" --bootstrap) && (exec mono "$CAKE_EXE" "$@")

src/LitJson/LitJSON.csproj

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

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

77
<PropertyGroup>
@@ -31,6 +31,11 @@ It's quick and lean, without external dependencies.</Description>
3131
<IncludeSource>true</IncludeSource>
3232
</PropertyGroup>
3333

34+
<PropertyGroup Condition="'$(TargetFramework)' == 'net20' ">
35+
<DefineConstants>$(DefineConstants);LEGACY</DefineConstants>
36+
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net20' and '$(OS)' == 'Windows_NT'">C:\Windows\Microsoft.NET\Framework\v2.0.50727</FrameworkPathOverride>
37+
</PropertyGroup>
38+
3439
<PropertyGroup Condition="'$(TargetFramework)' == 'net35' ">
3540
<DefineConstants>$(DefineConstants);LEGACY</DefineConstants>
3641
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35' and '$(OS)' == 'Windows_NT'">C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>

0 commit comments

Comments
 (0)