Skip to content

Commit

Permalink
Release v4.8.7.0
Browse files Browse the repository at this point in the history
### CLI

- Fixed accidental ignoring of CLI arguments: `-v`, `-ver`, `-version`
- Improved CLI help formatting
- Improved build script

### CSScriptLib

- no changes
  • Loading branch information
oleg-shilo committed Nov 7, 2023
1 parent 17993fc commit b9114ba
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 139 deletions.
6 changes: 3 additions & 3 deletions help.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
C# Script execution engine (.NET Core). Version 4.8.6.0.
Copyright (C) 2004-2020 Oleg Shilo.
C# Script execution engine (.NET Core). Version 4.8.7.0.
Copyright (C) 2004-2023 Oleg Shilo.


<switch 1>
Expand Down Expand Up @@ -263,7 +263,7 @@ Copyright (C) 2004-2020 Oleg Shilo.
It is a convenient way of testing performance of the .NET distribution.

-install/-uninstall
Sets/unsets CSSCRIPT_ROOT environment variable to the location of the script enginebeing executed.
Sets/unsets CSSCRIPT_ROOT environment variable to the location of the script engine being executed.
This environment variable is required for integration of CS-Script with Notepad++,Sublime Text and some other
editors, which require CS-Script installed on the host OS.
This command is only supported on Windows
Expand Down
1 change: 0 additions & 1 deletion src/1.build-binaries.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ echo Building csws.dll from %cd%
echo ----------------
dotnet publish -c Release -f %target%-windows -o "..\out\Windows\win"


cd ..\CSScriptLib\src\CSScriptLib
echo ----------------
echo Building CSScriptLib.dll from %cd%
Expand Down
24 changes: 12 additions & 12 deletions src/3.build-documentation.cmd
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
echo off

.\src\out\Windows\css.exe -server_r:stop
.\src\out\Windows\css.exe -server:stop

set vs_edition=Community
if exist "C:\Program Files\Microsoft Visual Studio\2022\%vs_edition%" (
echo Visual Studio 2022 (Community)
) else (
set vs_edition=Professional
echo Visual Studio 2022 (PRO)
)

rd /Q /S .\CSScriptLib.Doc\help
.\out\Windows\css.exe -server_r:stop
.\out\Windows\css.exe -server:stop

set vs_edition=undefined
if exist "C:\Program Files\Microsoft Visual Studio\2022\Community" set vs_edition=Community
if exist "C:\Program Files\Microsoft Visual Studio\2022\Professional" set vs_edition=Professional

echo Visual Studio 2022 (%vs_edition%)

if exist .\CSScriptLib.Doc\help rd /Q /S .\CSScriptLib.Doc\help

set msbuild="C:\Program Files\Microsoft Visual Studio\2022\%vs_edition%\MSBuild\Current\Bin\MSBuild.exe"
%msbuild% ".\CSScriptLib.Doc\CSScriptLib.Doc.shfbproj" -p:Configuration=Release -t:rebuild /p:WarningLevel=0

Expand All @@ -21,3 +20,4 @@ cd ".\out\Windows"
cd ..\..\

explorer .\out

4 changes: 3 additions & 1 deletion src/CSScriptLib/src/CSScriptLib/CSScript.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Ignore Spelling: Dirs

using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down Expand Up @@ -485,7 +487,7 @@ static internal string TypeNameForScript(Type type)
string typeName = type.Name;
//remove generic type suffix from name.
typeName = typeName.Substring(0, typeName.IndexOf('`'));
return $"{type.Namespace}.{typeName}<{string.Join(", ",type.GenericTypeArguments.Select(TypeNameForScript))}>";
return $"{type.Namespace}.{typeName}<{string.Join(", ", type.GenericTypeArguments.Select(TypeNameForScript))}>";
}
}
}
11 changes: 6 additions & 5 deletions src/CSScriptLib/src/CSScriptLib/CSScriptLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.8.6.0</Version>
<Version>4.8.7.0</Version>
<Authors>Oleg Shilo</Authors>
<Description>CS-Script engine Class Library for .NET 5 (and higher)</Description>
<Copyright>(C) 2018-2023 Oleg Shilo</Copyright>
Expand All @@ -30,15 +30,16 @@

### CLI

- Issue #345: cs-script 4.8.5 does not see cache directory on Linux
- Issue #346: cs-script 4.8.5 doesn't show information about server on Linux
- Fixed accidental ignoring of CLI arguments: `-v`, `-ver`, `-version`
- Improved CLI help formatting
- Improved build script

### CSScriptLib

- no changes</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyVersion>4.8.6.0</AssemblyVersion>
<FileVersion>4.8.6.0</FileVersion>
<AssemblyVersion>4.8.7.0</AssemblyVersion>
<FileVersion>4.8.7.0</FileVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>css_logo.png</PackageIcon>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApp1")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApp2")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
41 changes: 9 additions & 32 deletions src/Tests.CSScriptLib/Evaluator.Roslyn.Tests.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using csscript;
using CSScripting;
using CSScriptLib;
using Microsoft.CodeAnalysis.Scripting;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Loader;
using Microsoft.CodeAnalysis.Scripting;
using csscript;
using CSScripting;
using CSScriptLib;
using Testing;
using Xunit;

Expand Down Expand Up @@ -61,7 +61,7 @@ public void call_SuccessfulUnloadAssembly()
script.GetType().Assembly.Unload();
}

private void call_FailingUnloadAssembly()
void call_FailingUnloadAssembly()
{
// dynamic will trigger an accidental referencing the assembly under the hood of CLR and
// it will not be collected.
Expand Down Expand Up @@ -116,29 +116,6 @@ public void use_ScriptCaching()
[Fact]
public void call_LoadMethod()
{
var info = new CompileInfo
{
AssemblyFile = @"D:\out\asm.dll"
};

var asm1 = CSScript.Evaluator
.With(e => e.IsCachingEnabled = true)
.LoadFile(@"D:\out\test.cs");

Assembly asm2 = CSScript.Evaluator
.CompileCode(@"using System;
public class Script
{
public int Sum(int a, int b)
{
return a+b;
}
}",
info);

// dynamic script = asm.CreateObject("*");
// var result = script.Sum(7, 3);

dynamic script = CSScript.RoslynEvaluator
.LoadMethod(@"public object func()
{
Expand Down Expand Up @@ -335,16 +312,16 @@ public void Issue_337()
};

var accounting_assm2 = CSScript.Evaluator
.With(e => e.IsCachingEnabled = false)
.CompileCode(@"public class TXBase
.With(e => e.IsCachingEnabled = false)
.CompileCode(@"public class TXBase
{
public string TranId { get; set; }
public string HashKey { get; set; }
}", info);

dynamic script1 = CSScript.Evaluator
.ReferenceAssembly(accounting_assm2)
.LoadCode(@"public class TXPayment
.ReferenceAssembly(accounting_assm2)
.LoadCode(@"public class TXPayment
{
public string Reason { get; set; }
public string Test()
Expand Down
6 changes: 3 additions & 3 deletions src/cscs/CSExecutionClient.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using System.Diagnostics;
using static System.Environment;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using CSScripting;
using System.Text;
using static System.Environment;
using CSScripting;

[assembly: InternalsVisibleTo("cscs.tests")]
/*
Expand Down Expand Up @@ -131,7 +131,7 @@ class AppInfo

public static string appLogo =>
$"C# Script execution engine (.NET Core). Version {Assembly.GetExecutingAssembly().GetName().Version}.{NewLine}" +
"Copyright (C) 2004-2020 Oleg Shilo." + NewLine;
"Copyright (C) 2004-2023 Oleg Shilo." + NewLine;

public static string appLogoShort =>
$"C# Script execution engine (.NET Core). Version{Assembly.GetExecutingAssembly().GetName().Version}.{NewLine}";
Expand Down
28 changes: 14 additions & 14 deletions src/cscs/HelpProvider.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using CSScripting;
using Microsoft.CodeAnalysis.Scripting;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using static System.Environment;
using System.IO;
using System.Linq;
using static System.Net.Mime.MediaTypeNames;
using System.Reflection;
using System.Runtime.ConstrainedExecution;
using System.Runtime.Intrinsics.X86;
using System.Text;
using static System.Environment;
using static System.Net.Mime.MediaTypeNames;
using Microsoft.CodeAnalysis.Scripting;
using CSScripting;

namespace csscript
{
Expand All @@ -26,7 +26,6 @@ internal static class AppArgs
public const string help3 = "--help";
public const string question = "?";
public const string question2 = "-?";
public const string ver = "ver";
public const string wpf = "wpf";
public const string cmd = "cmd";
public const string syntax = "syntax";
Expand All @@ -41,8 +40,9 @@ internal static class AppArgs
public const string verbose = "verbose";
public const string verbose2 = "verbose2";
public const string profile = "profile";
public const string v = "v";
public const string version = "version";
public const string ver = "ver";
public const string v = "v";
public const string version2 = "-version";
public const string c = "c";
public const string cd = "cd";
Expand Down Expand Up @@ -445,7 +445,7 @@ static AppArgs()
{
switch2Help[uninstall] =
switch2Help[install] = new ArgInfo("-install/-uninstall",
"Sets/unsets CSSCRIPT_ROOT environment variable to the location of the script engine" +
"Sets/unsets CSSCRIPT_ROOT environment variable to the location of the script engine " +
"being executed.",
"This environment variable is required for integration of CS-Script with Notepad++," +
"Sublime Text and some other editors, which require CS-Script installed on the host OS.",
Expand Down Expand Up @@ -1141,13 +1141,13 @@ public static string ShowHelp(string helpType, params object[] context)
{
string capturedArg = map[description];

if (capturedArg.Length > arg.Length)
map[description] = capturedArg + "|" + arg;
else
map[description] = arg + "|" + capturedArg;
// if (capturedArg.Length > arg.Length)
map[description] = capturedArg + "|" + $"-{arg}";
// else
// map[description] = $"-{arg}" + "|" + capturedArg;
}
else
map[description] = arg;
map[description] = $"-{arg}";

longestArg = Math.Max(map[description].Length, longestArg);
}
Expand Down Expand Up @@ -1865,7 +1865,7 @@ public static string BuildVersionInfo(string arg)

string dotNetVer = null;

if (arg == "--version")
if (arg is not null)
{
builder.Append($"{Assembly.GetExecutingAssembly().GetName().Version}");
}
Expand Down Expand Up @@ -1945,7 +1945,7 @@ public static string BuildVersionInfo(string arg)

builder.AppendLine(" NuGet manager: " + NuGet.NuGetExeView)
.AppendLine(" NuGet cache: " + NuGet.NuGetCacheView)
.AppendLine(" Script cache: " + Runtime.CacheDir)
.AppendLine(" Script cache: " + Runtime.CacheDir)
.AppendLine(" Custom commands: " + Runtime.CustomCommandsDir)
.AppendLine(" Global includes: " + Runtime.GlobalIncludsDir);
}
Expand Down
30 changes: 5 additions & 25 deletions src/cscs/Program.cs
Original file line number Diff line number Diff line change
@@ -1,35 +1,15 @@
using csscript;
using CSScripting;
using CSScripting.CodeDom;
using System;
using System;
using System.Diagnostics;
using static System.Environment;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Xml.Linq;
using static System.Environment;

/*
TODO:
csc_builder
- add configurable exit on idle
cscs
- code cleanup
- VB support
- Unify namespaces
- Migrate app settings to json
- remove old not used settings
- clean help content from unused stuff
- implement config for port number
CSSCriptLib
- VB support
- implement config for port number
*/
using csscript;
using CSScripting;
using CSScripting.CodeDom;

namespace cscs
{
Expand Down
11 changes: 6 additions & 5 deletions src/cscs/cscs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>cscs</AssemblyName>
<RootNamespace>CSScripting</RootNamespace>
<StartupObject />
<Version>4.8.6.0</Version>
<Version>4.8.7.0</Version>
<Authors>Oleg Shilo</Authors>
<Product>CS-Script</Product>
<Copyright>(C) 2004-2023 Oleg Shilo</Copyright>
Expand All @@ -17,16 +17,17 @@
<RepositoryUrl>https://github.com/oleg-shilo/cs-script</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>C# script dynamic</PackageTags>
<AssemblyVersion>4.8.6.0</AssemblyVersion>
<FileVersion>4.8.6.0</FileVersion>
<AssemblyVersion>4.8.7.0</AssemblyVersion>
<FileVersion>4.8.7.0</FileVersion>
<PackageReleaseNotes>---

## Changes

### CLI

- Issue #345: cs-script 4.8.5 does not see cache directory on Linux
- Issue #346: cs-script 4.8.5 doesn't show information about server on Linux
- Fixed accidental ignoring of CLI arguments: `-v`, `-ver`, `-version`
- Improved CLI help formatting
- Improved build script

### CSScriptLib

Expand Down
Loading

0 comments on commit b9114ba

Please sign in to comment.