Skip to content

Commit

Permalink
Release v4.9.1
Browse files Browse the repository at this point in the history
## Changes

### CLI

- Added support for versioning of custom commands during `css -new:cmd ...`
- Added custom command `-unlock`
  • Loading branch information
oleg-shilo committed Feb 9, 2025
1 parent c8ba925 commit 642d43d
Show file tree
Hide file tree
Showing 16 changed files with 175 additions and 85 deletions.
7 changes: 4 additions & 3 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.9.0.0.
C# Script execution engine (.NET Core). Version 4.9.1.0.
Copyright (C) 2004-2023 Oleg Shilo.

Usage: cscs <switch 1> <switch 2> <file> [params] [//x]
Expand Down Expand Up @@ -457,7 +457,7 @@ CS-Script specific syntax
Engine directives:
- //css_include <file>;
- //css_import <file>[, preserve_main][, rename_namespace(<oldName>, <newName>)];
- //css_nuget [-force] package0[,package1]..[,packageN];
- //css_nuget [-force] [-ver:<version>] package0[,package1]..[,packageN];
- //css_nuget [-noref] [-force[:delay]] [-ver:<version>] [-rt:<runtime>] [-ng:<nuget arguments>]
package0[,package1]..[,packageN];
- //css_args arg0[,arg1]..[,argN];
Expand Down Expand Up @@ -545,14 +545,15 @@ newName - new name of a namespace to be renamed during importing

------------------------------------

//css_nuget [-force] package0[,package1]..[,packageN];
//css_nuget [-force] [-ver:<version>] package0[,package1]..[,packageN];

Downloads/Installs the NuGet package. It also automatically references the downloaded package assemblies.
By default, the package is not downloaded again if it was already downloaded.
CS-Script uses dotnet.exe to manage NuGet packages. This makes the developer experience fully consistent with
traditional SW development of compiled .NET applications.

-force - switch to force individual packages downloading even when they were already downloaded.
-ver:<version> - switch to download/reference a specific package version.

Examples: //css_nuget cs-script;
//css_nuget -force NLog
Expand Down
22 changes: 5 additions & 17 deletions src/4.build-winget.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,14 @@ echo Sync the https://github.com/oleg-shilo/winget-pkgs fork with the MS upstrea

pause

git remote add upstream https://github.com/microsoft/winget-pkgs
git fetch upstream
git checkout master
git pull
git reset --hard upstream/master
git push origin master --force

rem rem # Add the remote, call it "upstream":
rem git remote add upstream https://github.com/microsoft/winget-pkgs.git

rem rem # Fetch all the branches of that remote into remote-tracking branches
rem git fetch upstream


rem rem # Make sure that you're on your master branch:
rem git checkout master

rem rem rem # then: (like "git pull" which is fetch + merge)
rem rem git merge upstream/master master

rem rem # Rewrite your master branch so that any commits of yours that
rem rem # aren't already in upstream/master are replayed on top of that
rem rem # other branch:
rem git rebase upstream/master
rem git pull


cd ..\cs-script\src
Expand Down
12 changes: 6 additions & 6 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.9.0.0</Version>
<Version>4.9.1</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,16 +30,16 @@

### CLI

- Added support fro versioning of custom commands
- Fixed potential infinite loop on SocketError in the build server
- Added support for versioning of custom commands during `css -new:cmd ...`
- Added custom command `-unlock`

### CSScriptLib

- no changes</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyVersion>4.9.0.0</AssemblyVersion>
<FileVersion>4.9.0.0</FileVersion>
<PackageVersion>4.9.0.0</PackageVersion>
<AssemblyVersion>4.9.1</AssemblyVersion>
<FileVersion>4.9.1</FileVersion>
<PackageVersion>4.9.1</PackageVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>css_logo.png</PackageIcon>
<SignAssembly>True</SignAssembly>
Expand Down
10 changes: 5 additions & 5 deletions src/CSScriptLib/src/CSScriptLib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

[assembly: Guid("7cea89c9-e906-4852-ba40-16be33bcc2d1")]
[assembly: InternalsVisibleTo("cscs.tests, PublicKey=" +
"002400000480000094000000060200000024000052534131000400000100010059555e4408890a" +
"8a4f5012fe2ea083aefe3f62ef0b9528137eb310621d838364a7ba3476e07f59c46f2457e2b3a9" +
"9cc7f53339791c0fcc2839f8e1a404b444fd24b6399ae57b249c8ed5ab6c9acfb62f689ba8432c" +
"f8fb1367847bea06458509dc092992673f84c65e976bd7f3ef25af421fdde578e53b87b97e91c6" +
"952584ef")]
"0024000004800000940000000602000000240000525341310004000001000100d17b106c0897f2" +
"962c69449792d3b89ce228b8413184d66934ead688f75e8526ba162c7e6d4a32a48abdccbc8863" +
"ec9ae6ca453f05d148a968e217a0e22805ce9b5138d3f4f7f004c8074fa7e001c2a3bb0b8c275a" +
"40967efff2aa574ca04339df8fdcdcb6eb01afa1b28f0ad1d6498d0e17ba555c8c2535c5d6e1e7" +
"121bd7a0")]
44 changes: 22 additions & 22 deletions src/Tests.CSScriptLib/Tests.CSScriptLib.csproj
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>

<IsPackable>false</IsPackable>
<IsPackable>false</IsPackable>

<AssemblyName>cscs.tests</AssemblyName>
<AssemblyName>cscs.tests</AssemblyName>

<RootNamespace />
<RootNamespace />

<SignAssembly>True</SignAssembly>
<SignAssembly>True</SignAssembly>

<AssemblyOriginatorKeyFile>sgKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<AssemblyOriginatorKeyFile>sgKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.BPerf.Dia2Lib" Version="1.0.2" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.17" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Mono.Reflection.Core" Version="1.1.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.BPerf.Dia2Lib" Version="1.0.2" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.17" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Mono.Reflection.Core" Version="1.1.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CSScriptLib\src\CSScriptLib\CSScriptLib.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CSScriptLib\src\CSScriptLib\CSScriptLib.csproj" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/chocolatey/cs-script.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>cs-script</id>
<version>4.9.0.0</version>
<version>4.9.1</version>
<title>CS-Script</title>
<authors>Oleg Shilo</authors>
<owners>Oleg Shilo</owners>
Expand Down Expand Up @@ -30,8 +30,8 @@

### CLI

- Added support for versioning of custom commands
- Fixed potential infinite loop on SocketError in the build server
- Added support for versioning of custom commands during `css -new:cmd ...`
- Added custom command `-unlock`

### CSScriptLib

Expand Down
31 changes: 19 additions & 12 deletions src/cscs/HelpProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -765,14 +765,15 @@ static AppArgs()
"``` ",
section_sep, //------------------------------------
" ",
"`//css_nuget [-force] package0[,package1]..[,packageN];`",
"`//css_nuget [-force] [-ver:<version>] package0[,package1]..[,packageN];`",
" ",
"Downloads/Installs the NuGet package. It also automatically references the downloaded package assemblies.",
"By default, the package is not downloaded again if it was already downloaded.",
"CS-Script uses dotnet.exe to manage NuGet packages. This makes the developer experience fully consistent with " +
"traditional SW development of compiled .NET applications.",
"```txt",
" -force - ${<==}switch to force individual packages downloading even when they were already downloaded.",
" -ver:<version> - ${<==}switch to download/reference a specific package version.",
"``` ",
" Examples: //css_nuget cs-script;",
" //css_nuget -force NLog",
Expand Down Expand Up @@ -1548,29 +1549,35 @@ internal static SampleInfo[] BuildSampleCode(string appType, string context)
static SampleInfo[] CSharp_command_Sample(string context)
{
var cs =
@$"using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@$"
//css_include global-usings
using System;
using System.Diagnostics;
using CSScripting;
using static dbg;
using static System.Console;
using static System.Environment;
var thisScript = GetEnvironmentVariable(""EntryScript"");
var help =
@""CS-Script custom command for...
cscs -{context} [args]
(e.g. `cscs -{context} script.cs`)"";
@$""CS-Script custom command for...
v{{thisScript.GetCommandScriptVersion()}} ({{thisScript}})
css -{context} [args]
(e.g. `css -{context} test.txt`)"";
if (""?,-?,-help,--help"".Split(',').Contains(args.FirstOrDefault()))
if (args.IsEmpty() || ""?,-?,-help,--help"".Split(',').Contains(args.FirstOrDefault()))
{{
WriteLine(help);
return;
}}
WriteLine($""Executing {context} for: [{{string.Join("","", args)}}]"");
";
// -----------------------------------------------
// Command implementation
// -----------------------------------------------
WriteLine($""Executing {context} for: [{{string.Join("","", args)}}]"");";

return [new SampleInfo(cs.NormalizeNewLines(), ".cs")];
}

Expand Down
10 changes: 10 additions & 0 deletions src/cscs/Utils/LinqExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ internal static List<T> AddIfNotThere<T>(this List<T> items, T item)
return items;
}

/// <summary>
/// Determines whether the specified contains any items from another collection.
/// </summary>
/// <param name="items1">The items1.</param>
/// <param name="items2">The items2.</param>
/// <returns>
/// <c>true</c> if the specified items2 contains any; otherwise, <c>false</c>.
/// </returns>
public static bool ContainsAny(this string[] items1, params string[] items2) => items1.Intersect(items2).Any();

/// <summary>
/// None of the items matches the specified predicate.
/// </summary>
Expand Down
10 changes: 5 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.9.0.0</Version>
<Version>4.9.1</Version>
<Authors>Oleg Shilo</Authors>
<Product>CS-Script</Product>
<Copyright>(C) 2004-2023 Oleg Shilo</Copyright>
Expand All @@ -16,16 +16,16 @@
<RepositoryUrl>https://github.com/oleg-shilo/cs-script</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>C# script dynamic</PackageTags>
<AssemblyVersion>4.9.0.0</AssemblyVersion>
<FileVersion>4.9.0.0</FileVersion>
<AssemblyVersion>4.9.1</AssemblyVersion>
<FileVersion>4.9.1</FileVersion>
<PackageReleaseNotes>---

## Changes

### CLI

- Added support fro versioning of custom commands
- Fixed potential infinite loop on SocketError in the build server
- Added support for versioning of custom commands during `css -new:cmd ...`
- Added custom command `-unlock`

### CSScriptLib

Expand Down
4 changes: 4 additions & 0 deletions src/cscs/csscript.cli.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ public void Sample(string appType, string outFile)

print?.Invoke($"Created: {Path.GetRelativePath(Environment.CurrentDirectory, file)}");
File.WriteAllText(file, sample.Code);

var fileDir = file.GetDirName();
if (Directory.GetFiles(fileDir, "*.version").IsEmpty())
File.WriteAllText(Path.Combine(fileDir, "1.0.0.version"), "");
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/css/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.9.0.0")]
[assembly: AssemblyFileVersion("4.9.0.0")]
[assembly: AssemblyVersion("4.9.1")]
[assembly: AssemblyFileVersion("4.9.1")]
10 changes: 5 additions & 5 deletions src/csws/csws.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<UseWindowsForms>true</UseWindowsForms>
<RootNamespace>CSScripting</RootNamespace>
<StartupObject />
<Version>4.9.0.0</Version>
<Version>4.9.1</Version>
<Authors>Oleg Shilo</Authors>
<Product>CS-Script</Product>
<Copyright>(C) 2004-2022 Oleg Shilo</Copyright>
Expand All @@ -19,16 +19,16 @@
<RepositoryUrl>https://github.com/oleg-shilo/cs-script</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>C# script dynamic</PackageTags>
<AssemblyVersion>4.9.0.0</AssemblyVersion>
<FileVersion>4.9.0.0</FileVersion>
<AssemblyVersion>4.9.1</AssemblyVersion>
<FileVersion>4.9.1</FileVersion>
<PackageReleaseNotes>---

## Changes

### CLI

- Added support fro versioning of custom commands
- Fixed potential infinite loop on SocketError in the build server
- Added support for versioning of custom commands during `css -new:cmd ...`
- Added custom command `-unlock`

### CSScriptLib

Expand Down
Loading

0 comments on commit 642d43d

Please sign in to comment.