Firstly I made java a supported language by editing Config.py
# src/Config/Config.py
class Config():
supported_lang = ['cpp', 'python', 'java']
...
I then wrote the code for creating the code file in ProblemManager.py. Had to do this separately since I wanted to capitalise the first letter to follow convention
# src/Problem/ProblemManager.py
...
if lang == 'java':
code_file_path = Path(dir, 'Code.java')
else:
code_file_path = Path(dir, f'code.{ext_map[lang]}')
...
I wrote run_java_code function in runner.py. Tbh I just copied run_cpp_code 😋
I also wrote JavaRunner class in JavaRunner.py. This too is very similar too CppRunner.py 😋😋. However I did add a compile error check to JavaRunner (I think we should do this for CppRunner as well)
Fixes #1
Firstly I made java a supported language by editing
Config.py
I then wrote the code for creating the code file in
ProblemManager.py
. Had to do this separately since I wanted to capitalise the first letter to follow conventionAdded mappers for java in
mapper.py
I wrote
run_java_code
function inrunner.py
. Tbh I just copiedrun_cpp_code
😋I also wrote
JavaRunner
class inJavaRunner.py
. This too is very similar tooCppRunner.py
😋😋. However I did add a compile error check to JavaRunner (I think we should do this for CppRunner as well)