You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install Rust according to https://www.rust-lang.org/tools/install
4
+
5
+
Install [zstd](https://github.com/facebook/zstd). For example, on Ubuntu you need the package `libzstd1`. For Windows, download the appropriate archive from the [releases](https://github.com/facebook/zstd/releases), extract it and add the extracted directory to your PATH.
6
+
7
+
```bash
8
+
git clone git@github.com:rage/tmc-langs-rust.git
9
+
cd tmc-langs-rust
10
+
cargo build
11
+
```
12
+
13
+
If you have any troubles building the project, please do make an issue!
14
+
15
+
## Testing
16
+
17
+
```bash
18
+
cargo test
19
+
```
20
+
21
+
## Formatting and linting
22
+
23
+
Use `cargo fmt` and `cargo clippy` for formatting and linting. All crates should have the clippy lints `print_stdout` and `print_stderr` set to deny to allow the CLI to have total control over stdout and stderr. The CLI has one function where writing to stdout is allowed.
24
+
25
+
## Updating dependencies
26
+
27
+
For convenience, a tool called [cargo-outdated](https://crates.io/crates/cargo-outdated) can be installed to automatically check all the crates in the workspace for outdated dependencies. You may want to call `cargo update` first to update dependencies to the latest semver-compatible version.
28
+
29
+
In addition to the dependencies listed in each crate's `Cargo.toml`, the project bundles a few external dependencies such as `tmc-checkstyle-runner`, `tmc-junit-runner` and so on. When updating dependencies, you may want to check whether these projects have been updated.
30
+
31
+
## Versioning
32
+
33
+
tmc-langs-rust follows Rust-style semantic versioning, but only for the `tmc-langs-cli` and `tmc-langs` crates. Other crates are considered internal and may go through breaking changes in any release as long as the public API is unaffected.
34
+
35
+
## Licensing
36
+
37
+
Unless you explicitly state otherwise, any contribution intentionally submitted
38
+
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Framework for supporting different programming languages in TMC.
2
2
3
-
TMC-langs provides an 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.
3
+
TMC-langs provides an interface that encapsulates everything needed to support a new language in TMC by providing functionality such as downloading exercises, running tests and submitting them. A CLI wrapper is provided so that it's fairly convenient to call from other languages like Ruby.
4
4
5
5
## Documentation
6
6
7
7
Documentation for the latest release is available at https://rage.github.io/tmc-langs-rust
8
8
9
-
The specifications for various configuration files are included in the spec directory.
10
-
11
-
The student file policy of each plugin is explained in a `README.md` file in the plugin's subdirectory.
12
-
13
-
## Building
14
-
15
-
Install Rust according to https://www.rust-lang.org/tools/install
16
-
17
-
Install [zstd](https://github.com/facebook/zstd). For example, on Ubuntu you need the package `libzstd1`. For Windows, download the appropriate archive from the [releases](https://github.com/facebook/zstd/releases), extract it and add the extracted directory to your PATH.
18
-
19
-
```bash
20
-
git clone git@github.com:rage/tmc-langs-rust.git
21
-
cd tmc-langs-rust
22
-
cargo build
23
-
```
24
-
25
-
If you have any troubles building the project, please do make an issue!
26
-
27
-
## Testing
28
-
29
-
```bash
30
-
cargo test
31
-
```
32
-
33
-
## Running the CLI
34
-
35
-
```bash
36
-
cargo run -p tmc-langs-cli help
37
-
```
38
-
39
-
## Development
40
-
41
-
Format using `cargo fmt`, use `cargo clippy` for linting. All crates should have the clippy lints `print_stdout` and `print_stderr` set to deny. The CLI has one function where writing to stdout is allowed.
42
-
43
-
If using vscode and rust-analyzer, be sure to turn on the setting `loadOutDirsFromCheck` to avoid a spurious unresolved import error from `isolang`.
44
-
45
-
## Updating dependencies
46
-
47
-
In addition to the dependencies listed in each crate's `Cargo.toml`, the project bundles a few external dependencies such as `tmc-checkstyle-runner`, `tmc-junit-runner` and so on. When updating dependencies, you may want to check whether these projects have been updated.
48
-
49
-
For convenience, a tool called [cargo-outdated](https://crates.io/crates/cargo-outdated) can be installed to automatically check all the crates in the workspace for outdated dependencies. You may want to call `cargo update` first to update dependencies to the latest semver-compatible version.
50
-
51
-
## Versioning
52
-
53
-
tmc-langs-rust follows Rust-style semantic versioning, but only for the `tmc-langs-cli` and `tmc-langs` crates. Other crates may go through breaking changes in any release as long as the CLI and langs are unaffected.
54
-
55
-
## CLI binary deployment and downloads
56
-
57
-
Documentation and binaries for the supported targets are built and the binaries deployed to Google Cloud when creating a GitHub release. The binaries are available at https://download.mooc.fi/tmc-langs-rust/, with each binary following the file name format `tmc-langs-cli-{target}-{version}(.exe)`, with the `.exe` suffix added for the Windows binaries. For a list of targets see below. For example, The 64-bit Linux binary for version 0.5.0 is available at https://download.mooc.fi/tmc-langs-rust/tmc-langs-cli-x86_64-unknown-linux-gnu-0.5.0.
58
-
59
-
### Supported targets
60
-
61
-
- Linux 64-bit (x86_64-unknown-linux-gnu)
62
-
- Linux 32-bit (i686-unknown-linux-gnu)
63
-
- Windows MSVC 64-bit (x86_64-pc-windows-msvc)
64
-
- Windows MSVC 32-bit (i686-pc-windows-msvc)
65
-
- MacOS 64-bit (x86_64-apple-darwin)
66
-
- ARM64 (aarch64-unknown-linux-gnu)
67
-
- Armv7 (armv7-unknown-linux-gnueabihf)
9
+
Additional documentation for other aspects of TMC such as configuration file formats is included in the [docs](./docs) directory.
68
10
69
11
## Included projects
70
12
@@ -74,7 +16,7 @@ A "frontend" for tmc-langs. A binary CLI client for TMC-langs for IDEs. Intended
74
16
75
17
### tmc-langs
76
18
77
-
The "backend". A library that provides a convenient API for implementing different frontends. A frontend (such as a CLI) should only depend on this.
19
+
The "backend". A library that provides a convenient API for implementing different frontends. A frontend (such as a CLI) should only depend on this library. The other libraries are considered internal.
78
20
79
21
### tmc-client
80
22
@@ -86,7 +28,7 @@ A library for creating language plugins.
86
28
87
29
### tmc-langs-plugins
88
30
89
-
A library that provides a convenient API for using all the different plugins.
31
+
A library that provides a convenient API abstracting over all the different language plugins.
90
32
91
33
### tmc-langs-util
92
34
@@ -116,6 +58,19 @@ A TMC plugin for Python 3.
116
58
117
59
A TMC plugin for R.
118
60
61
+
### Supported targets
62
+
63
+
- Linux 64-bit (x86_64-unknown-linux-gnu)
64
+
- Linux 32-bit (i686-unknown-linux-gnu)
65
+
- Windows MSVC 64-bit (x86_64-pc-windows-msvc)
66
+
- Windows MSVC 32-bit (i686-pc-windows-msvc)
67
+
- MacOS 64-bit (x86_64-apple-darwin)
68
+
- ARM64 (aarch64-unknown-linux-gnu)
69
+
- Armv7 (armv7-unknown-linux-gnueabihf)
70
+
71
+
## Contributing
72
+
See [CONTRIBUTING](CONTRIBUTING.md).
73
+
119
74
## License
120
75
121
76
Licensed under either of
@@ -126,9 +81,3 @@ Licensed under either of
126
81
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
127
82
128
83
at your option.
129
-
130
-
## Contribution
131
-
132
-
Unless you explicitly state otherwise, any contribution intentionally submitted
133
-
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
134
-
dual licensed as above, without any additional terms or conditions.
Copy file name to clipboardExpand all lines: tmc-langs-cli/README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,22 @@
1
1
CLI interface for tmc-langs. The documentation for the various commands and parameters are best seen from the CLI itself. For example, running `tmc-langs-cli help clean` will print out the information for the `clean` sub-command. Alternatively, `src/app.rs` contains the CLI definition.
2
2
3
+
## Running the CLI
4
+
5
+
Running the project with Cargo from the repository root:
6
+
```bash
7
+
cargo run -p tmc-langs-cli help
8
+
```
9
+
3
10
## API format
11
+
4
12
See the `Output` struct in `src/output.rs` for the type definition that is converted to JSON and printed for every command. See the `api` directory for some examples of what the result looks as JSON. The example files are used in unit tests so they should always be up to date and correct.
5
13
6
14
In general, the API is structured as follows: there is an `output-kind` field which can have one of several values. Each value corresponds to a kind of message that has some fields associated with it. For example, if the `output-kind` is `output-data`, the message will have the fields `status`, `message`, `result`, and `data`. The `data` field, the value of which is an object, will then contain the field `output-data-kind` which specifies the rest of the fields of the `data` object, and so on.
7
15
16
+
## Binary deployment and downloads
17
+
18
+
Documentation and binaries for the supported targets are built and the binaries deployed to Google Cloud when creating a GitHub release. The binaries are available at https://download.mooc.fi/tmc-langs-rust/, with each binary following the file name format `tmc-langs-cli-{target}-{version}(.exe)`, with the `.exe` suffix added for the Windows binaries. For a list of targets see the README at the repository root. For example, The 64-bit Linux binary for version 0.5.0 is available at https://download.mooc.fi/tmc-langs-rust/tmc-langs-cli-x86_64-unknown-linux-gnu-0.5.0.
0 commit comments