An application has the following logic:
- client => created *.cpp => sent to the server => cl.exe + *.cpp =
*.exe - client => created *.cs => sent to the server => csc.exe + *.cs =
*.exe - client => created *.pas => sent to the server => PascalCompiler +
*.pas = *.exe - etc.
The language - C#. I hear that MSBUILD can help me, but I don't understand how to change compiler on server at runtime. Does anyone know of options other than Process class?
I'm trying to write an online system to test programs in programming contests. The programmer selects the compiler and sends the source code to the server for verification.
And I do not need to build the project, I just need to compile a single file.
-
5You've already asked this question twice on Stack Overflow, and it is still not really answerable. What are you trying to do? A build system? A custom application in C# to do this?Mat– Mat07/29/2012 08:34:04Commented Jul 29, 2012 at 8:34
3 Answers 3
It sounds like you are trying to automate a build process? A few more details of what you want to achieve would help.
MsBuild is Microsoft's build tool, not sure if it will help you with Pascal. Other tools that will include NAnt.
Have a look at Continuous integration, and CC.Net (CruiseControl.Net) There are other tools as well.
I'm sort of guessing what you want a bit, so please add a few more details.
-
1I'm trying to write an online system to test programs in programming contests. The programmer selects the compiler and sends the source code to the server for verification.mif– mif07/30/2012 08:16:45Commented Jul 30, 2012 at 8:16
-
1And I do not need to build the project, I just need to compile a single file.mif– mif07/30/2012 08:24:42Commented Jul 30, 2012 at 8:24
If all you have to compile is a single file, then why not simply require developers to adhere to a file suffix standard and drive the compiler choice from the file type? Just iterate through the directory, picking up every file in it and checking its suffix. If it's a "known" suffix, then fire off the appropriate compile command in a separate thread. When your loop ends, wait on all the children before scanning again. You'll need some way to move or flag files once they've been processed and a notification mechanism to inform the submitters whether their compile failed or not, but those are fairly trivial details.
-
When the program is checked suffix, HOW to run the right compiler.mif– mif07/30/2012 21:34:39Commented Jul 30, 2012 at 21:34
-
You are on a right track.
I would suggest to start with your MSBuild and continues integration process. Dealing with continues integration takes time and resource. I would advice to think twice on the goal that you are planning to achieve.
I have compiled a list of good resources that hopefully will help you to understand the build process itself:
Explore related questions
See similar questions with these tags.