Skip to content
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

Add support for C# #498

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add support for C# #498

wants to merge 6 commits into from

Conversation

XezolesS
Copy link

Add support for C#, both .NET and Mono version of it.

Compiling C# is somewhat different than others, so I have to cook it little different.
I don't really want to break a codebase, but some methods are added to only handle C#.

The way it works is:

for .NET C#

  1. Create a .NET project under the workspace folder. The project name will be .cphcsrun
  2. Copy the C# source code to Program.cs in project folder.
  3. Run dotnet build to compile code.
  4. Run binary where located at <source_name>_bin/.cphcsrun.

for Mono C#

  1. Compile the code with mcs command.
  2. Run binary with mono command.

It is little bit wanky, but it works.

Also, I fixed an error that failed to delete binary after execution if there's a whitespace in the path in Windows.

I've tested every language but Haskell on Windows 10 and C, C++, C#, Python on Ubuntu 20.04 to make sure I didn't break other compilers.

Also some refactorings done.

Tested every language but haskell on Windows 10.
C, C++, C#, Java, Python has been tested on WSL Ubuntu 20.04.
Also wrapPathWhitespace is removed. Just replace by wrapping with double quotes seems okay.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant