trampgeek / jobe

jobe is a server that runs small programming jobs in a variety of programming languages
MIT License
112 stars 80 forks source link

Add main_class param to Java task. #64

Closed gigamonkey closed 1 year ago

gigamonkey commented 1 year ago

Hello, I don't know if this will be something of interest to you but I needed it for a thing I'm building.

This change adds a new parameter to Java tasks, main_class that can be used to specify a different class to run with java than the one whose source just came in. The incoming source is still compiled but this allows me to, for instance, run a test runner class that takes the name of the incoming class as an argument (which I pass via runargs) and then exercises the code submitted rather than running it directly.

Since this parameter only has any affect if it is set this should be completely backwards compatible.

If you want this, I'm happy to add some docs wherever is appropriate to make it a first class thing.

gigamonkey commented 1 year ago

Apologies. That first change was not right; mixed up my PHP and my Javascript and apparently did not test as carefully as I thought I had. Shame on me.

trampgeek commented 1 year ago

Belated thanks, Peter. Merged now.