-
Notifications
You must be signed in to change notification settings - Fork 257
Script merger for hosted scripts #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Came across @JayBeAl's issue by accident and would like to express the same need. My hosting application is used in a testing environment with almost a thousand test script files. They are available in a Visual Studio solution. Each top-level script has its own namespace. The largest scope consists of approx. 500 files. The top-level Another scope consists of approx. 100 files. Each file implements a specific test of a compliance regulation. 6 top-level scripts sequentially run the tests, depending on regulation variant. In both cases, a single blob or not using namespaces would be totally unmaintainable. |
It's a difficult one. Roslyn has quite a few critical limitations so I made the decision not to overinvest as the value would be very limited. There is no workaround for these limitations:
But, if your hosting scenario is not impacted by these limitations then indeed multi-scripting can be achieved. I am actually working on it :) |
Done. var dependencyScript ="calc.cs";
File.WriteAllText(dependencyScript, @"using System;
public class Calc
{
static public int Sum(int a, int b)
{
return a+b;
}
}");
dynamic script = new_evaluator.LoadCode($@"//css_inc {dependencyScript}
using System;
public class Script
{{
public int Sum(int a, int b) => Calc.Sum(a ,b);
}}");
var result = script.Sum(7, 3); |
Prerelease package v4.1.3.0-pre has been just published |
Good to see the And as stated at the top of the above link, the content is yet partial only. If you like, I would be available for reviewing the content and giving suggestions on the missing pieces of information, especially regarding hosting, where currently nothing is stated about |
@maettu-this sorry for getting back to you with such a delay. You are right I will need to update that article with the new support for Yes, it would be great if you can scan the document for obvious gaps. The original documentation was for .NET Framework editions of both CS-Script CLI and hosted library. Since CS-Script has switched to the .NET5 edition the documentation needs to be reviewed and updated where required (e.g. gaps). All wiki docs that are not reviewed yet are marked as partial. Finding time is very challenging for me :( |
Easy, no need to hurry, I fully understand the time constraints such OSS projects mean. Not seeing Just let me know once content is ready to be reviewed. I will then look at it thoroughly and report my findings. |
Done. All documentation is updated now. |
Very good! I have just started reviewing the content. |
I thought to propose changes directly in
Maybe you can give me a hint, or I will try finding a solution tomorrow. If it is not possible, I will just zip to files and attach them here, but not really ideal... |
According to e.g. https://stackoverflow.com/questions/10642928/how-to-pull-request-a-wiki-page-on-github, PR are not supported on the wiki and would require some sort of workaround. Let me know which way you perfer: zip/attach here, share via dropbox or the like, grant access to the wiki's git (branches only) and you can merge, have me clone the wiki to my account and you can merge from there,... Somewhat strange, that GitHub doesn't support an easy collaboration model on the wiki... |
There is a simpler way :) |
Alright, you should now see branches/maettu_this_review_1. It's just a first shot to try the process. The changes yet only involve spell check and whitespace. Please review and merge as you agree. When ready again, I will carefully read through the content of all pages and check for semantics. PS on trailing whitespace: I am aware that markdown supports |
- Updated `-speed` and `-code` with the complete support `-ng:*` switches - Added `IEvaluator.IsCachingEnabled`. Ite as always available from the conctrete types implementing `IEvaluator` and now it is moved directly to the interface. - Added `-servers:start` and `-servers:stop` command to control both Roslyn and csc build servers at the same time - CSScriptLib: Native API `CacheEnabled` marked as obsolete - Issue #258: Can not run scripts after installing VS2022 - Issue #257: Ability to catch AppDomain.UnhandledException in a not-hosted script (cscs) - Issue #255: Relative path for cscs.exe -out option results in wrong output folder - Issue #254: Script merger for hosted scripts - Issue #253: Supports both .Net Framework and .Net 5 - Issue #252: System.NullReferenceException: Object reference not set to an instance of an object. (updated API doc) - Added auto-generation of the CLI MD documentation with `-help cli:md`. To be used to generate GitHub wiki page during the build - Fixed Debian packaging problem (`/n/r` needed replacement with `\n`)
### Misc - Added auto-generation of the CLI MD documentation with -help cli:md. To be used to generate GitHub wiki page during the build - Fixed Debian packaging problem (/n/r needed replacement with \n) - Issue #253: Supports both .Net Framework and .Net 5 ### CLI - Updated -speed and -code with the complete support -ng:* switches - Added -servers:start and -servers:stop command to control both Roslyn and csc build servers at the same time - Issue #258: Can not run scripts after installing VS2022 - Issue #257: Ability to catch AppDomain.UnhandledException in a not-hosted script (cscs) - Issue #255: Relative path for cscs.exe -out option results in wrong output folder - Issue #254: Script merger for hosted scripts - Issue #252: System.NullReferenceException: Object reference not set to an instance of an object. (updated API doc) ### CSScriptLib - Native API CacheEnabled marked as obsolete - Added IEvaluator.IsCachingEnabled. It is always available from the concrete types implementing IEvaluator and now it is moved directly to the interface.
Hello Oleg,
first of: thank you for your continued work on the cs-script project, I am using it to host scripts in a desktop application to provide a scripting interface for users. I am going with the Roslyn compiler so that users won't need an additional SDK.
For ease of mantainance I´d like to deploy scripts with multiple files, which is not natively possible with the Roslyn compiler according to your documentation.
However, I have seen that you have included script merging in the CLI version of CS-Script. Is there any reason why this feature is only available in the CLI version?
Do you plan to include this script merger in the hosting version as well?
The text was updated successfully, but these errors were encountered: