Skip to content

Commit

Permalink
# Release v4.6.5.2 (RC-2)
Browse files Browse the repository at this point in the history
---

## Changes

### CLI

- Issue oleg-shilo#327:  CS-Script file with async calls suddenly terminates
- Implemented new NuGet support (https://github.com/oleg-shilo/cs-script/wiki/NuGet-Support)
  - Issue oleg-shilo#326: Types from .NET 7 NuGet package are not found
  - Issue oleg-shilo#328: Using CS-Script inside a GitLab CI/CD Docker Runner

- Issue oleg-shilo#327: CS-Script file with async calls suddenly terminates
- Updated Linux distro with `css` executable replaced with Linux `alias` functionality.

### CSScriptLib

- <no changes>
  • Loading branch information
oleg-shilo committed Mar 26, 2023
1 parent 371dc98 commit 1e6cbc7
Show file tree
Hide file tree
Showing 10 changed files with 293 additions and 242 deletions.
33 changes: 26 additions & 7 deletions help.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C# Script execution engine (.NET Core). Version 4.6.5.0.
C# Script execution engine (.NET Core). Version 4.6.5.2.
Copyright (C) 2004-2020 Oleg Shilo.


Expand Down Expand Up @@ -362,23 +362,33 @@ Copyright (C) 2004-2020 Oleg Shilo.
engine is. Automatic CSSRoslynProvider.dll loading can be disabled with a special 'none' argument: -pvdr:none.
(see https://www.cs-script.net/cs-script/help-legacy/help/non_cs_compilers.html)

-nuget[:<package|purge>]
Installs new or updates existing NuGet package.
-nuget[:<package|restore>]
Note: A new NuGet support available from version 4.7.0 will obsolete some of the options of this command
New NuGet support can be enabled by setting `LegacyNugetSupport` option to false with `css
-config:set:LegacyNugetSupport=false`)
Read more: https://github.com/oleg-shilo/cs-script/wiki/NuGet-Support

Imports new or updates existing NuGet package.
This command allows light management of the NuGet packages in the CS-Script local package repository
(%PROGRAMDATA%\CS-Script\nuget).
The tasks are limited to installing, updating and listing the local packages.


-nuget - prints the list of all root packages in the repository
(Not available with new NuGet support)
-nuget:<package> - downloads and installs the latest version of the package(s).
Wild cards can be used to update multiple packages. For example '-nuget:ServiceStack*' will
update all already installed ServiceStack packages.
You can also use the index of the package instead of its full name.
(Not available with new NuGet support)


Installing packages this way is an alternative to having '//css_nuget -force ...' directive in the script code as
it may be more convenient for the user to update packages manually instead of having them updated on every script
execution/recompilation.

-nuget:restore - downloads and installs all packages specified in the script without executing the script.
Available only with new NuGet support.

-syntax
Prints documentation for CS-Script specific C# syntax.
Expand Down Expand Up @@ -480,6 +490,10 @@ package0[,package1]..[,packageN];

Downloads/Installs the NuGet package. It also automatically references the downloaded package assemblies.
Note: The directive switches need to be in the order as above.
A new NuGet support available from version 4.7.0 will obsolete some of the options of this directive
New NuGet support can be enabled by setting `LegacyNugetSupport` option to false with `css
-config:set:LegacyNugetSupport=false`)
Read more: https://github.com/oleg-shilo/cs-script/wiki/NuGet-Support

By default the package is not downloaded again if it was already downloaded.
If no version is specified then the highest downloaded version (if any) will be used.
Expand All @@ -488,21 +502,26 @@ be referenced.
You should use '-noref' switch and reference assemblies manually for all other cases. For example multiple assemblies
with the same file name that target different CLRs (e.g. v3.5 vs v4.0) in the same package.
Switches:
-noref - switch for individual packages if automatic referencing isn't desired.
-noref - switch for individual packages if automatic referencing isn't desired.
You can use 'css_nuget' environment variable for further referencing package content (e.g. //css_dir
%css_nuget%\WixSharp\**)
(Not available with new NuGet support)
-force[:delay] - switch to force individual packages downloading even when they were already downloaded.
You can optionally specify delay for the next forced downloading by number of seconds since last
download.
'-force:3600' will delay it for one hour. This option is useful for preventing frequent download
interruptions during active script development.
(Not available with new NuGet support)
-ver:<version> - switch to download/reference a specific package version.
-rt:<runtime> - switch to use specific runtime binaries (e.g. '-rt:netstandard1.3').
-ng:<args> - switch to pass NuGet arguments for every individual package.
(Not available with new NuGet support)
-ng:<args> - switch to pass `nuget.exe`/`dotnet restore` arguments for every individual package.
(`-restore:` as an alias of this switch)

Example: //css_nuget cs-script;
//css_nuget -ver:4.1.2 NLog
//css_nuget -ver:"4.1.1-rc1" -rt:netstandard2.0 -ng:"-Pre -NoCache" NLog
//css_nuget -restore:"-v minimal" -ver:4.1.2 NLog
//css_nuget -ver:4.1.2 -restore:"-f --no-cache" NLog
//css_nuget -ver:"4.1.1-rc1" -rt:netstandard2.0 -ng:"-f --no-cache" NLog

This directive will install CS-Script NuGet package.
(see http://www.csscript.net/help/script_nugets.html)
Expand Down
3 changes: 3 additions & 0 deletions src/BuildServer/out/build.runtimeconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"framework": {
"name": "Microsoft.NETCore.App",
"version": "7.0.0"
},
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
}
}
}
229 changes: 118 additions & 111 deletions src/CSScriptLib/src/CSScriptLib/CSScriptLib.csproj
Original file line number Diff line number Diff line change
@@ -1,119 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>CSScriptLib</AssemblyName>
<PackageId>CS-Script</PackageId>
<!--<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>-->
<!--<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>-->
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.6.5</Version>
<Authors>Oleg Shilo</Authors>
<Description>CS-Script engine Class Library for .NET 5 (and higher)</Description>
<Copyright>(C) 2018-2022 Oleg Shilo</Copyright>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageProjectUrl>https://github.com/oleg-shilo/cs-script</PackageProjectUrl>
<PackageIconUrl></PackageIconUrl>
<RepositoryUrl>https://github.com/oleg-shilo/cs-script.git</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>C#, scripting, script, dynamic, .NET. .NET Core</PackageTags>
<PackageReleaseNotes>---
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>CSScriptLib</AssemblyName>
<PackageId>CS-Script</PackageId>
<!--<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>-->
<!--<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>-->
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.6.5.2</Version>
<Authors>Oleg Shilo</Authors>
<Description>CS-Script engine Class Library for .NET 5 (and higher)</Description>
<Copyright>(C) 2018-2022 Oleg Shilo</Copyright>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageProjectUrl>https://github.com/oleg-shilo/cs-script</PackageProjectUrl>
<PackageIconUrl></PackageIconUrl>
<RepositoryUrl>https://github.com/oleg-shilo/cs-script.git</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>C#, scripting, script, dynamic, .NET. .NET Core</PackageTags>
<PackageReleaseNotes>
---

## Changes
## Changes

### CLI
### CLI

- Issue #327: CS-Script file with async calls suddenly terminates
- Updated Linux distro with `css` executable replaced with Linux `alias` functionality.
- Issue #327: CS-Script file with async calls suddenly terminates
- Implemented new NuGet support (https://github.com/oleg-shilo/cs-script/wiki/NuGet-Support)
- Issue #326: Types from .NET 7 NuGet package are not found
- Issue #328: Using CS-Script inside a GitLab CI/CD Docker Runner

### CSScriptLib
- Issue #327: CS-Script file with async calls suddenly terminates
- Updated Linux distro with `css` executable replaced with Linux `alias` functionality.

- Added `CodeDomEvaluator.CscTimeout` to allow auto-termination of the `csc.exe` when it hangs. Triggered by #318</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyVersion>4.6.5</AssemblyVersion>
<FileVersion>4.6.5</FileVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>css_logo.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>CSScriptLib.xml</DocumentationFile>
<PlatformTarget>AnyCPU</PlatformTarget>
<DefineConstants>TRACE;class_lib</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>CSScriptLib.xml</DocumentationFile>
<DefineConstants>TRACE;class_lib</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Remove="CSScriptLib.Eval.CodeDom.cs" />
<Compile Remove="output\aggregate.cs" />
<Compile Remove="output\Test.cs" />
<Compile Remove="sample.cs" />
<Compile Remove="samples.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="nuget-samples.cmd" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\cscs\CodeDom\CompilerResults.cs" Link="CodeDom\CompilerResults.cs" />
<Compile Include="..\..\..\cscs\CodeDom\CompilerError.cs" Link="CodeDom\CompilerError.cs" />
<Compile Include="..\..\..\cscs\fileparser.cs" Link="fileparser.cs" />
<Compile Include="..\..\..\cscs\Project.cs" Link="Project.cs" />
<Compile Include="..\..\..\cscs\ScriptParser.cs" Link="ScriptParser.cs" />
<Compile Include="..\..\..\cscs\ScriptParsingResult.cs" Link="ScriptParsingResult.cs" />
<Compile Include="..\..\..\cscs\Utils\CoreExtensions.cs" Link="Utils\CoreExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\CurrentDirGuard.cs" Link="Utils\CurrentDirGuard.cs" />
<Compile Include="..\..\..\cscs\Utils\LinqExtensions.cs" Link="Utils\LinqExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\PathExtensions.cs" Link="Utils\PathExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\Globals.cs" Link="Utils\Globals.cs" />
<Compile Include="..\..\..\cscs\Utils\Profiler.cs" Link="Profiler.cs" />
<Compile Include="..\..\..\cscs\Utils\ReflectionExtensions.cs" Link="Utils\ReflectionExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\Runtime.cs" Link="Utils\Runtime.cs" />
<Compile Include="..\..\..\cscs\Utils\SimpleAsmProbing.cs" Link="SimpleAsmProbing.cs" />
<Compile Include="..\..\..\cscs\Utils\SocketExtensions.cs" Link="SocketExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\StringExtensions.cs" Link="Utils\StringExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\WildCardExtensions.cs" Link="Utils\WildCardExtensions.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Scripting.Common" Version="4.1.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\logo\css_logo.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="samples.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="CodeDom\" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<Generator>ResXFileCodeGenerator</Generator>
<CustomToolNamespace>CSScripting</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="IF exist &quot;$(ProjectDir)out&quot; ( echo . ) ELSE ( md &quot;$(ProjectDir)out&quot;)&#xD;&#xA;&#xD;&#xA;copy &quot;$(TargetDir)$(TargetFileName)&quot; &quot;$(ProjectDir)output\$(TargetFileName)&quot;&#xD;&#xA;copy &quot;$(TargetDir)$(ProjectName).xml&quot; &quot;$(ProjectDir)output\$(ProjectName).xml&quot;&#xD;&#xA;rem copy &quot;$(ProjectDir)..\..\src\CSScriptLib.Client\Test.cs&quot; &quot;$(ProjectDir)output\Test.cs&quot;&#xD;&#xA;rem copy &quot;$(ProjectDir)..\..\src\CSScriptLib.Client\Test.cs&quot; &quot;$(ProjectDir)bin\$(ConfigurationName)\Test.cs&quot;&#xD;&#xA;&#xD;&#xA;" />
</Target>
### CSScriptLib

- &lt;no changes&gt;
</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyVersion>4.6.5.2</AssemblyVersion>
<FileVersion>4.6.5.2</FileVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>css_logo.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>CSScriptLib.xml</DocumentationFile>
<PlatformTarget>AnyCPU</PlatformTarget>
<DefineConstants>TRACE;class_lib</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>CSScriptLib.xml</DocumentationFile>
<DefineConstants>TRACE;class_lib</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Remove="CSScriptLib.Eval.CodeDom.cs" />
<Compile Remove="output\aggregate.cs" />
<Compile Remove="output\Test.cs" />
<Compile Remove="sample.cs" />
<Compile Remove="samples.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="nuget-samples.cmd" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\cscs\CodeDom\CompilerResults.cs" Link="CodeDom\CompilerResults.cs" />
<Compile Include="..\..\..\cscs\CodeDom\CompilerError.cs" Link="CodeDom\CompilerError.cs" />
<Compile Include="..\..\..\cscs\fileparser.cs" Link="fileparser.cs" />
<Compile Include="..\..\..\cscs\Project.cs" Link="Project.cs" />
<Compile Include="..\..\..\cscs\ScriptParser.cs" Link="ScriptParser.cs" />
<Compile Include="..\..\..\cscs\ScriptParsingResult.cs" Link="ScriptParsingResult.cs" />
<Compile Include="..\..\..\cscs\Utils\CoreExtensions.cs" Link="Utils\CoreExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\CurrentDirGuard.cs" Link="Utils\CurrentDirGuard.cs" />
<Compile Include="..\..\..\cscs\Utils\LinqExtensions.cs" Link="Utils\LinqExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\PathExtensions.cs" Link="Utils\PathExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\Globals.cs" Link="Utils\Globals.cs" />
<Compile Include="..\..\..\cscs\Utils\Profiler.cs" Link="Profiler.cs" />
<Compile Include="..\..\..\cscs\Utils\ReflectionExtensions.cs" Link="Utils\ReflectionExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\Runtime.cs" Link="Utils\Runtime.cs" />
<Compile Include="..\..\..\cscs\Utils\SimpleAsmProbing.cs" Link="SimpleAsmProbing.cs" />
<Compile Include="..\..\..\cscs\Utils\SocketExtensions.cs" Link="SocketExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\StringExtensions.cs" Link="Utils\StringExtensions.cs" />
<Compile Include="..\..\..\cscs\Utils\WildCardExtensions.cs" Link="Utils\WildCardExtensions.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Scripting.Common" Version="4.1.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\logo\css_logo.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="samples.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="CodeDom\" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<Generator>ResXFileCodeGenerator</Generator>
<CustomToolNamespace>CSScripting</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="IF exist &quot;$(ProjectDir)out&quot; ( echo . ) ELSE ( md &quot;$(ProjectDir)out&quot;)&#xD;&#xA;&#xD;&#xA;copy &quot;$(TargetDir)$(TargetFileName)&quot; &quot;$(ProjectDir)output\$(TargetFileName)&quot;&#xD;&#xA;copy &quot;$(TargetDir)$(ProjectName).xml&quot; &quot;$(ProjectDir)output\$(ProjectName).xml&quot;&#xD;&#xA;rem copy &quot;$(ProjectDir)..\..\src\CSScriptLib.Client\Test.cs&quot; &quot;$(ProjectDir)output\Test.cs&quot;&#xD;&#xA;rem copy &quot;$(ProjectDir)..\..\src\CSScriptLib.Client\Test.cs&quot; &quot;$(ProjectDir)bin\$(ConfigurationName)\Test.cs&quot;&#xD;&#xA;&#xD;&#xA;" />
</Target>
</Project>
6 changes: 5 additions & 1 deletion src/cscs/NuGet.Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ static string[] GetPackagesFromConfigFileOfScript(string scriptFile)

public static string[] FindAssembliesOf(string[] packages, bool suppressDownloading, string script)
{
if (packages.IsEmpty())
return new string[0];

var allPackages = packages.Concat(GetPackagesFromConfigFileOfScript(script));

var forceRestore = Environment.GetEnvironmentVariable("CSS_RESTORE_NUGET_PACKAGES") != null;
Expand Down Expand Up @@ -587,7 +590,8 @@ bool isSameData(byte[] a, byte[] b)

// Console.WriteLine(" " + sw.Elapsed.ToString());
sw.Restart();
Console.WriteLine("Mapping packages to assemblies...");
Console.WriteLine("Mapping packages to assemblies1111...");
// Debug.Assert(false);

foreach (var x in allRefAssemblies)
{
Expand Down
Loading

0 comments on commit 1e6cbc7

Please sign in to comment.