Skip to content

WaDelma/tmc-langs

 
 

Repository files navigation

tmc-langs

Build Status Build status Coverage Status

Framework for supporting different programming languages in TMC.

TMC-langs provides an Java interface that encapsulates everything needed to support a new language in TMC. The framework provides CLI wrappers so that it's fairly convenient to call from other languages like Ruby.

Build

Note that all the mvn commands should be ran in the projects root directory.

Build the project with mvn clean package. Install the dependency to your local Maven repository with mvn clean install -U.

Test

Test the project with mvn test. For the tmc-langs-java maven tests to pass it either needs to be invoked with mvn exec magic, like NetBeans does it. However, when executed from commandline M3_HOME must be configured. Either via $M3_HOME or from mavens configuration files.

Running tests for:

  • tmc-langs-python: python executable must be accessible from your $PATH
  • tmc-langs-rust: rust and rust-package-manager executables must be accessible from your $PATH.
  • tmc-langs-qmake: a valid Qt install with qmake executable must be accessible from your $PATH and $QT_QPA_PLATFORM set to minimal

Usage

Add the dependencies to your project’s pom.xml.

<dependency>
  <groupId>fi.helsinki.cs.tmc</groupId>
  <artifactId>tmc-langs-framework</artifactId>
  <version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
  <groupId>fi.helsinki.cs.tmc</groupId>
  <artifactId>tmc-langs-util</artifactId>
  <version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
  <groupId>fi.helsinki.cs.tmc</groupId>
  <artifactId>tmc-langs-ant</artifactId>
  <version>1.0-SNAPSHOT</version>
</dependency>

TMC-langs can be invoked programmatically or by running the software from the command-line.

Programmatically

Create a TaskExecutorImpl and call the required task of TaskExecutor. TaskExecutor will take care of detecting the provided projects language, if TMC-langs cannot recognize the project as a supported language NoLanguagePluginFound exception will be thrown.

TaskExecutor taskExecutor = new TaskExecutorImpl();
RunResult runResult = taskExecutor.runTests(projectInfo.getProjectDirAsPath());

Supported tasks and their return types and parameters can be read from TaskExecutor

CLI

Running tasks from the command-line can be accomplished by passing the required task with projects directory path and in some tasks the output file path. After building the tmc-langs-cli commandline interface you can find the jar to use under tmc-langs-cli/target/

java -jar tmc-langs-cli/target/tmc-langs-cli-1.0-SNAPSHOT.jar run-tests --exercisePath test_projects/arith_funcs --outputPath results.txt

For all options run java -jar tmc-langs-cli/target/tmc-langs-cli-1.0-SNAPSHOT.jar help

Credits

Original draft of the framework structure mpartel.

The project is part of Software Lab project at the University of Helsinki CS Dept..

Developers

Instructor

Leo Leppänen loezi

Clients

The project is currently maintained by the Agile Education Research group.

About

TMC language support framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 72.5%
  • C 14.4%
  • Python 4.3%
  • C++ 3.1%
  • QMake 2.1%
  • Makefile 1.9%
  • Other 1.7%