From 3804c9637da6a709b31bd6c8561959c8d92a01ba Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 12:14:25 +0200 Subject: [PATCH 01/12] updated Roslyn to 3.2.1 --- .paket/Paket.Restore.targets | 277 +++++++++++++++++++++++++++-------- Directory.Build.targets | 4 +- 2 files changed, 221 insertions(+), 60 deletions(-) diff --git a/.paket/Paket.Restore.targets b/.paket/Paket.Restore.targets index 305e736c..aed3c3fd 100644 --- a/.paket/Paket.Restore.targets +++ b/.paket/Paket.Restore.targets @@ -5,29 +5,60 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + $(MSBuildVersion) + 15.0.0 + false + true true $(MSBuildThisFileDirectory) $(MSBuildThisFileDirectory)..\ $(PaketRootPath)paket-files\paket.restore.cached $(PaketRootPath)paket.lock + classic + proj + assembly + native /Library/Frameworks/Mono.framework/Commands/mono mono - - $(PaketRootPath)paket.exe - $(PaketToolsPath)paket.exe - "$(PaketExePath)" - $(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)" - + + $(PaketRootPath)paket.bootstrapper.exe + $(PaketToolsPath)paket.bootstrapper.exe + $([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\ + + + + + $(PaketRootPath)paket.exe + $(PaketToolsPath)paket.exe + $(PaketToolsPath)paket.exe + $(_PaketBootStrapperExeDir)paket.exe + paket.exe + + + $(PaketRootPath)paket + $(PaketToolsPath)paket + $(PaketToolsPath)paket + + + $(PaketRootPath)paket.exe + $(PaketToolsPath)paket.exe + + + $(PaketBootStrapperExeDir)paket.exe + + + paket + + <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)")) - dotnet "$(PaketExePath)" + dotnet "$(PaketExePath)" + $(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)" + "$(PaketExePath)" - - "$(PaketExePath)" - $(PaketRootPath)paket.bootstrapper.exe - $(PaketToolsPath)paket.bootstrapper.exe "$(PaketBootStrapperExePath)" $(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)" @@ -36,60 +67,86 @@ true true + + + True + + $(BaseIntermediateOutputPath.TrimEnd('\').TrimEnd('\/')) - + + + + + + + + - + true $(NoWarn);NU1603;NU1604;NU1605;NU1608 + false + true - - - /usr/bin/shasum "$(PaketRestoreCacheFile)" | /usr/bin/awk '{ print $1 }' - /usr/bin/shasum "$(PaketLockFilePath)" | /usr/bin/awk '{ print $1 }' + + + + + + + $([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)')) + + + + + + + $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[0].Replace(`"`, ``).Replace(` `, ``)) + $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[1].Replace(`"`, ``).Replace(` `, ``)) + + + + + %(PaketRestoreCachedKeyValue.Value) + %(PaketRestoreCachedKeyValue.Value) - - - - - - - - - - - - - - $([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)')) - $([System.IO.File]::ReadAllText('$(PaketLockFilePath)')) + + true - false + false true - + + true - - - + + + + + + - + - + - $(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached + $(PaketIntermediateOutputPath)\$(MSBuildProjectFile).paket.references.cached $(MSBuildProjectFullPath).paket.references @@ -124,8 +181,9 @@ - - + + + @@ -141,21 +199,24 @@ + $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length) $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0]) $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1]) $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4]) - $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5]) + $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5]) %(PaketReferencesFileLinesInfo.PackageVersion) All - runtime + runtime + runtime true + true - $(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).paket.clitools + $(PaketIntermediateOutputPath)/$(MSBuildProjectFile).paket.clitools @@ -174,44 +235,144 @@ - + false - + - <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/> + <_NuspecFilesNewLocation Include="$(PaketIntermediateOutputPath)\$(Configuration)\*.nuspec"/> + + $(MSBuildProjectDirectory)/$(MSBuildProjectFile) true - false - true - $(BaseIntermediateOutputPath)$(Configuration) - $(BaseIntermediateOutputPath) + false + true + false + true + false + true + false + true + $(PaketIntermediateOutputPath)\$(Configuration) + $(PaketIntermediateOutputPath) - <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.nuspec"/> + <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.$(PackageVersion.Split(`+`)[0]).nuspec"/> - + + + - - + + + + - - + - + From 82500455ffd0babdf6f0e63013ab4c4580b68e05 Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 12:14:52 +0200 Subject: [PATCH 02/12] use PackageLicenseExpression --- src/ScriptCs.Contracts/ScriptCs.Contracts.csproj | 2 +- src/ScriptCs.Core/ScriptCs.Core.csproj | 2 +- src/ScriptCs.Engine.Roslyn/ScriptCs.Engine.Roslyn.csproj | 2 +- src/ScriptCs.Hosting/ScriptCs.Hosting.csproj | 2 +- src/ScriptCs/ScriptCs.csproj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ScriptCs.Contracts/ScriptCs.Contracts.csproj b/src/ScriptCs.Contracts/ScriptCs.Contracts.csproj index 8d7c12e5..312e1920 100644 --- a/src/ScriptCs.Contracts/ScriptCs.Contracts.csproj +++ b/src/ScriptCs.Contracts/ScriptCs.Contracts.csproj @@ -4,7 +4,7 @@ netstandard2.0 ScriptCs.Contracts Glenn Block, Filip Wojcieszyn, Justin Rusbatch - https://github.com/scriptcs/scriptcs/blob/master/LICENSE.md + Apache-2.0 http://scriptcs.net http://www.gravatar.com/avatar/5c754f646971d8bc800b9d4057931938.png?s=120 ScriptCs.Contracts diff --git a/src/ScriptCs.Core/ScriptCs.Core.csproj b/src/ScriptCs.Core/ScriptCs.Core.csproj index a83e1dc5..9b8b29cb 100644 --- a/src/ScriptCs.Core/ScriptCs.Core.csproj +++ b/src/ScriptCs.Core/ScriptCs.Core.csproj @@ -4,7 +4,7 @@ netstandard2.0 ScriptCs.Core Glenn Block, Filip Wojcieszyn, Justin Rusbatch - https://github.com/scriptcs/scriptcs/blob/master/LICENSE.md + Apache-2.0 http://scriptcs.net http://www.gravatar.com/avatar/5c754f646971d8bc800b9d4057931938.png?s=120 ScriptCs.Core diff --git a/src/ScriptCs.Engine.Roslyn/ScriptCs.Engine.Roslyn.csproj b/src/ScriptCs.Engine.Roslyn/ScriptCs.Engine.Roslyn.csproj index e88e280a..d1a43e48 100644 --- a/src/ScriptCs.Engine.Roslyn/ScriptCs.Engine.Roslyn.csproj +++ b/src/ScriptCs.Engine.Roslyn/ScriptCs.Engine.Roslyn.csproj @@ -4,7 +4,7 @@ netstandard2.0 ScriptCs.Engine.Roslyn Glenn Block, Filip Wojcieszyn, Justin Rusbatch - https://github.com/scriptcs/scriptcs/blob/master/LICENSE.md + Apache-2.0 http://scriptcs.net http://www.gravatar.com/avatar/5c754f646971d8bc800b9d4057931938.png?s=120 ScriptCs.Engine.Roslyn diff --git a/src/ScriptCs.Hosting/ScriptCs.Hosting.csproj b/src/ScriptCs.Hosting/ScriptCs.Hosting.csproj index 3a164047..f818d811 100644 --- a/src/ScriptCs.Hosting/ScriptCs.Hosting.csproj +++ b/src/ScriptCs.Hosting/ScriptCs.Hosting.csproj @@ -4,7 +4,7 @@ net461 ScriptCs.Hosting Glenn Block, Filip Wojcieszyn, Justin Rusbatch - https://github.com/scriptcs/scriptcs/blob/master/LICENSE.md + Apache-2.0 http://scriptcs.net http://www.gravatar.com/avatar/5c754f646971d8bc800b9d4057931938.png?s=120 ScriptCs.Hosting diff --git a/src/ScriptCs/ScriptCs.csproj b/src/ScriptCs/ScriptCs.csproj index 20e9f2dc..2d7f57bd 100644 --- a/src/ScriptCs/ScriptCs.csproj +++ b/src/ScriptCs/ScriptCs.csproj @@ -5,7 +5,7 @@ net461 scriptcs Glenn Block, Filip Wojcieszyn, Justin Rusbatch - https://github.com/scriptcs/scriptcs/blob/master/LICENSE.md + Apache-2.0 http://scriptcs.net http://www.gravatar.com/avatar/5c754f646971d8bc800b9d4057931938.png?s=120 scriptcs From bafc614987186e761d11c83aa331632045a9b913 Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 12:21:17 +0200 Subject: [PATCH 03/12] update CI/CD --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f77655f..c069e2be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: csharp -dotnet: 2.0.0 +dotnet: 2.2.105 sudo: required dist: trusty env: diff --git a/appveyor.yml b/appveyor.yml index 55cad9e8..59c9e073 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ version: 1.0.{build} -image: Visual Studio 2017 +image: Visual Studio 2019 environment: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true From e62c64bfd46ccb6e9d848ef38c183f789ab5516a Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 12:38:49 +0200 Subject: [PATCH 04/12] use .net sdk 2.2.401 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c069e2be..207fef64 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: csharp -dotnet: 2.2.105 +dotnet: 2.2.401 sudo: required dist: trusty env: From 8295c4c7bc2f3686d9bb493c99fae0020500d4d2 Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 12:51:20 +0200 Subject: [PATCH 05/12] 2.2.205? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 207fef64..f7c068ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: csharp -dotnet: 2.2.401 +dotnet: 2.2.205 sudo: required dist: trusty env: From 2bf6d285e4286a95515d35fb7a01f28f9fb1b97b Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 12:52:54 +0200 Subject: [PATCH 06/12] still use image 2017 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 59c9e073..55cad9e8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ version: 1.0.{build} -image: Visual Studio 2019 +image: Visual Studio 2017 environment: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true From 7e5e034b526c7475fb92445a4a6e0c6742cde044 Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 13:05:17 +0200 Subject: [PATCH 07/12] use 2.2 short + xenial --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f7c068ef..312f82ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: csharp -dotnet: 2.2.205 sudo: required -dist: trusty +dist: xenial +dotnet: 2.2 env: global: - secure: m2PtYwYOhaK0uFMZ19ZxApZwWZeAIq1dS//jx/5I3txpIWD+TfycQMAWYxycFJ/GJkeVF29P4Zz1uyS2XKKjPJpp2Pds98FNQyDv3OftpLAVa0drsjfhurVlBmSdrV7GH6ncKfvhd+h7KVK5vbZc+NeR4dH7eNvN/jraS//AMJg= From 947a649eda38aa348c0ff415ff4362fc306e93c7 Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 13:07:28 +0200 Subject: [PATCH 08/12] use preview language version (remove the hack) --- .../CSharpScriptEngine.cs | 2 +- .../CommonScriptEngine.cs | 20 ++----------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/ScriptCs.Engine.Roslyn/CSharpScriptEngine.cs b/src/ScriptCs.Engine.Roslyn/CSharpScriptEngine.cs index ad99e9b9..51555d2b 100644 --- a/src/ScriptCs.Engine.Roslyn/CSharpScriptEngine.cs +++ b/src/ScriptCs.Engine.Roslyn/CSharpScriptEngine.cs @@ -26,7 +26,7 @@ protected bool IsCompleteSubmission(string code) return true; } - var options = new CSharpParseOptions(LanguageVersion.Latest, DocumentationMode.Parse, SourceCodeKind.Script); + var options = new CSharpParseOptions(LanguageVersion.Preview, DocumentationMode.Parse, SourceCodeKind.Script); var syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: options); return SyntaxFactory.IsCompleteSubmission(syntaxTree); diff --git a/src/ScriptCs.Engine.Roslyn/CommonScriptEngine.cs b/src/ScriptCs.Engine.Roslyn/CommonScriptEngine.cs index 5c482533..743503c3 100644 --- a/src/ScriptCs.Engine.Roslyn/CommonScriptEngine.cs +++ b/src/ScriptCs.Engine.Roslyn/CommonScriptEngine.cs @@ -29,10 +29,10 @@ protected CommonScriptEngine(IScriptHostFactory scriptHostFactory, ILogProvider ScriptMetadataResolver = ScriptMetadataResolver.Default; ScriptOptions = ScriptOptions.Default. WithReferences(typeof(object).Assembly, typeof(TupleElementNamesAttribute).Assembly). // System.ValueTuple - WithMetadataResolver(ScriptMetadataResolver); + WithMetadataResolver(ScriptMetadataResolver). + WithLanguageVersion(LanguageVersion.Preview); _scriptHostFactory = scriptHostFactory; Log = logProvider.ForCurrentType(); - SetCSharpVersionToLatest(); } public string BaseDirectory @@ -186,21 +186,5 @@ protected virtual ScriptResult Execute(string code, object globals, SessionState } protected abstract ScriptState GetScriptState(string code, object globals); - - private void SetCSharpVersionToLatest() - { - try - { - // reset default scripting mode to latest language version to enable C# 7.1 features - // this is not needed once https://github.com/dotnet/roslyn/pull/21331 ships - var csharpScriptCompilerType = typeof(CSharpScript).GetTypeInfo().Assembly.GetType("Microsoft.CodeAnalysis.CSharp.Scripting.CSharpScriptCompiler"); - var parseOptionsField = csharpScriptCompilerType?.GetField("s_defaultOptions", BindingFlags.Static | BindingFlags.NonPublic); - parseOptionsField?.SetValue(null, new CSharpParseOptions(LanguageVersion.Latest, kind: SourceCodeKind.Script)); - } - catch (Exception) - { - Log.Warn("Unable to set C# language version to latest, will use the default version."); - } - } } } \ No newline at end of file From b123e7a59e87a9fd9f91bedd4f76dcffbe4c8197 Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 13:31:42 +0200 Subject: [PATCH 09/12] use absolute version on osx --- .travis.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 312f82ff..4249bc78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ language: csharp sudo: required -dist: xenial dotnet: 2.2 + +git: + depth: 10 + env: global: - secure: m2PtYwYOhaK0uFMZ19ZxApZwWZeAIq1dS//jx/5I3txpIWD+TfycQMAWYxycFJ/GJkeVF29P4Zz1uyS2XKKjPJpp2Pds98FNQyDv3OftpLAVa0drsjfhurVlBmSdrV7GH6ncKfvhd+h7KVK5vbZc+NeR4dH7eNvN/jraS//AMJg= @@ -17,4 +20,11 @@ os: script: - ulimit -n8192 - chmod +x build.sh - - ./build.sh \ No newline at end of file + - ./build.sh + +matrix: + - os: linux + dist: xenial + dotnet: 2.2 + - os: osx + dotnet: 2.2.401 # For OSX, we need absolute dotnet version \ No newline at end of file From 04aeab5d90d2738c330e1081a51a7bf82d38e0dc Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 13:38:58 +0200 Subject: [PATCH 10/12] missing include --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4249bc78..50b4faef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,9 @@ script: - ./build.sh matrix: - - os: linux - dist: xenial - dotnet: 2.2 - - os: osx - dotnet: 2.2.401 # For OSX, we need absolute dotnet version \ No newline at end of file + include: + - os: linux + dist: xenial + dotnet: 2.2 + - os: osx + dotnet: 2.2.401 # For OSX, we need absolute dotnet version \ No newline at end of file From cb49703d9e90e89bf37dadc39f43bd1f078e2ab7 Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 14:13:26 +0200 Subject: [PATCH 11/12] remove os node --- .travis.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 50b4faef..afe61ce8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,6 @@ language: csharp sudo: required dotnet: 2.2 -git: - depth: 10 - env: global: - secure: m2PtYwYOhaK0uFMZ19ZxApZwWZeAIq1dS//jx/5I3txpIWD+TfycQMAWYxycFJ/GJkeVF29P4Zz1uyS2XKKjPJpp2Pds98FNQyDv3OftpLAVa0drsjfhurVlBmSdrV7GH6ncKfvhd+h7KVK5vbZc+NeR4dH7eNvN/jraS//AMJg= @@ -12,10 +9,6 @@ env: - DOTNET_CLI_TELEMETRY_OPTOUT=true mono: - 5.8.0 - -os: - - linux - - osx script: - ulimit -n8192 From a387c71b33b5255d59165e5622251e8333f3c017 Mon Sep 17 00:00:00 2001 From: filipw Date: Tue, 20 Aug 2019 14:49:14 +0200 Subject: [PATCH 12/12] tweaks --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index afe61ce8..36f3797b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: csharp sudo: required -dotnet: 2.2 env: global: @@ -8,12 +7,7 @@ env: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true - DOTNET_CLI_TELEMETRY_OPTOUT=true mono: - - 5.8.0 - -script: - - ulimit -n8192 - - chmod +x build.sh - - ./build.sh + - 5.18.1 matrix: include: @@ -21,4 +15,10 @@ matrix: dist: xenial dotnet: 2.2 - os: osx - dotnet: 2.2.401 # For OSX, we need absolute dotnet version \ No newline at end of file + osx_image: xcode11 + dotnet: 2.2.401 + +script: + - ulimit -n8192 + - chmod +x build.sh + - ./build.sh \ No newline at end of file