From 9228292f4a3d1e404fd81ee73ddc2c17d5582c13 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Mon, 26 Sep 2022 16:18:54 +0300 Subject: [PATCH 01/15] Formatted Cargo.tomls --- Cargo.lock | 139 ++++++++++++++--------------- bindings/tmc-langs-node/Cargo.toml | 10 ++- plugins/csharp/Cargo.toml | 5 +- plugins/java/Cargo.toml | 7 +- plugins/make/Cargo.toml | 5 +- plugins/notests/Cargo.toml | 5 +- plugins/python3/Cargo.toml | 5 +- plugins/r/Cargo.toml | 5 +- tmc-client/Cargo.toml | 16 +++- tmc-langs-cli/Cargo.toml | 5 +- tmc-langs-framework/Cargo.toml | 11 ++- tmc-langs-plugins/Cargo.toml | 7 +- tmc-langs-util/Cargo.toml | 5 +- tmc-langs/Cargo.toml | 12 ++- tmc-server-mock/Cargo.toml | 5 +- 15 files changed, 148 insertions(+), 94 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 54d273cca1c..4700286ceb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -55,9 +55,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9a8f622bcf6ff3df478e9deba3e03e4e04b300f8e6a139e192c05fa3490afc7" +checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" [[package]] name = "assert-json-diff" @@ -352,9 +352,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.21" +version = "3.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed5341b2301a26ab80be5cbdced622e80ed808483c52e45e3310a877d3b37d7" +checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" dependencies = [ "atty", "bitflags", @@ -364,7 +364,7 @@ dependencies = [ "once_cell", "strsim 0.10.0", "termcolor", - "textwrap 0.15.0", + "textwrap 0.15.1", ] [[package]] @@ -470,9 +470,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ "block-buffer 0.10.3", "crypto-common", @@ -537,9 +537,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" dependencies = [ "atty", "humantime", @@ -791,7 +791,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -873,14 +873,13 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.48" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a0714f28b1ee39ccec0770ccb544eb02c9ef2c82bb096230eefcffa6468b0" +checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" dependencies = [ "android_system_properties", "core-foundation-sys", "js-sys", - "once_cell", "wasm-bindgen", "winapi", ] @@ -991,9 +990,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" dependencies = [ "libc", ] @@ -1015,11 +1014,11 @@ checksum = "6204285f77fe7d9784db3fdc449ecce1a0114927a51d5a41c4c7a292011c015f" dependencies = [ "base64", "crypto-common", - "digest 0.10.3", + "digest 0.10.5", "hmac", "serde", "serde_json", - "sha2 0.10.5", + "sha2 0.10.6", ] [[package]] @@ -1030,9 +1029,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.132" +version = "0.2.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" +checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966" [[package]] name = "libloading" @@ -1259,16 +1258,16 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "sha2 0.10.5", + "sha2 0.10.6", "thiserror", "url", ] [[package]] name = "once_cell" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "opaque-debug" @@ -1305,10 +1304,10 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" dependencies = [ - "digest 0.10.3", + "digest 0.10.5", "hmac", "password-hash", - "sha2 0.10.5", + "sha2 0.10.6", ] [[package]] @@ -1399,9 +1398,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "7bd7356a8122b6c4a24a82b278680c73357984ca2fc79a0f9fa6dea7dced7c58" dependencies = [ "unicode-ident", ] @@ -1453,9 +1452,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] @@ -1508,9 +1507,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.11" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" +checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" dependencies = [ "base64", "bytes", @@ -1524,10 +1523,10 @@ dependencies = [ "hyper-rustls", "ipnet", "js-sys", - "lazy_static", "log", "mime", "mime_guess", + "once_cell", "percent-encoding", "pin-project-lite", "rustls", @@ -1579,9 +1578,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.35.9" +version = "0.35.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" +checksum = "af895b90e5c071badc3136fc10ff0bcfc98747eadbaf43ed8f214e07ba8f8477" dependencies = [ "bitflags", "errno", @@ -1679,9 +1678,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.144" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] @@ -1700,9 +1699,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.144" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", @@ -1754,9 +1753,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.11" +version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89f31df3f50926cdf2855da5fd8812295c34752cb20438dae42a67f79e021ac3" +checksum = "8613d593412a0deb7bbd8de9d908efff5a0cb9ccd8f62c641e7b2ed2f57291d1" dependencies = [ "indexmap", "itoa", @@ -1767,13 +1766,13 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006769ba83e921b3085caa8334186b00cf92b4cb1a6cf4632fbccc8eff5c7549" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -1791,13 +1790,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9db03534dff993187064c4e0c05a5708d2a9728ace9a8959b77bedf415dac5" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -1957,9 +1956,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.99" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" dependencies = [ "proc-macro2", "quote", @@ -2022,24 +2021,24 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" [[package]] name = "thiserror" -version = "1.0.34" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" +checksum = "0a99cb8c4b9a8ef0e7907cd3b617cc8dc04d571c4e73c8ae403d80ac160bb122" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.34" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" +checksum = "3a891860d3c8d66fec8e73ddb3765f90082374dbaaa833407b904a94f1a7eb43" dependencies = [ "proc-macro2", "quote", @@ -2140,7 +2139,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "sha2 0.10.5", + "sha2 0.10.6", "shellwords", "simple_logger", "smol", @@ -2165,7 +2164,7 @@ version = "0.26.0" dependencies = [ "anyhow", "base64", - "clap 3.2.21", + "clap 3.2.22", "dirs 4.0.0", "env_logger", "log", @@ -2335,7 +2334,7 @@ dependencies = [ "rand", "serde", "serde_json", - "sha2 0.10.5", + "sha2 0.10.6", "simple_logger", "tempfile", "thiserror", @@ -2392,9 +2391,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.21.0" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89797afd69d206ccd11fb0ea560a44bbb87731d020670e79416d442919257d42" +checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" dependencies = [ "autocfg", "bytes", @@ -2527,36 +2526,36 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unsafe-libyaml" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "931179334a56395bcf64ba5e0ff56781381c1a5832178280c7d7f91d1679aeb0" +checksum = "c1e5fa573d8ac5f1a856f8d7be41d390ee973daf97c806b2c1a465e4e1406e68" [[package]] name = "untrusted" @@ -2715,9 +2714,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" dependencies = [ "webpki", ] diff --git a/bindings/tmc-langs-node/Cargo.toml b/bindings/tmc-langs-node/Cargo.toml index de6e956abc2..8040c98bcbf 100644 --- a/bindings/tmc-langs-node/Cargo.toml +++ b/bindings/tmc-langs-node/Cargo.toml @@ -1,8 +1,12 @@ [package] name = "tmc-langs-node" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" +description = "Bindings to the tmc-langs library for Node" license = "MIT OR Apache-2.0" rust-version = "1.58.1" exclude = ["index.node"] @@ -23,7 +27,9 @@ env_logger = "0.9.0" serde = "1.0.136" serde_json = "1.0.78" thiserror = "1.0.30" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = ["serde-compat"], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b" } +ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ + "serde-compat", +], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b" } [dev-dependencies] log = "0.4.14" diff --git a/plugins/csharp/Cargo.toml b/plugins/csharp/Cargo.toml index 2ede81abf29..a246b3a2261 100644 --- a/plugins/csharp/Cargo.toml +++ b/plugins/csharp/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-langs-csharp" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" diff --git a/plugins/java/Cargo.toml b/plugins/java/Cargo.toml index 4fe09c2c371..7af06ec55f5 100644 --- a/plugins/java/Cargo.toml +++ b/plugins/java/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-langs-java" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" @@ -12,7 +15,7 @@ tmc-langs-util = { path = "../../tmc-langs-util" } dirs = "4.0.0" flate2 = "1.0.22" -j4rs = "=0.13.0" # specific version to match the jar +j4rs = "=0.13.0" # specific version to match the jar log = "0.4.14" once_cell = "1.9.0" serde = { version = "1.0.136", features = ["derive"] } diff --git a/plugins/make/Cargo.toml b/plugins/make/Cargo.toml index 103542e6312..118f7b05560 100644 --- a/plugins/make/Cargo.toml +++ b/plugins/make/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-langs-make" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" diff --git a/plugins/notests/Cargo.toml b/plugins/notests/Cargo.toml index 3ba1f4d0881..8e4f6c01d4d 100644 --- a/plugins/notests/Cargo.toml +++ b/plugins/notests/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-langs-notests" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" diff --git a/plugins/python3/Cargo.toml b/plugins/python3/Cargo.toml index ebf076a1191..413d6d8ddef 100644 --- a/plugins/python3/Cargo.toml +++ b/plugins/python3/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-langs-python3" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" diff --git a/plugins/r/Cargo.toml b/plugins/r/Cargo.toml index 96eefa08488..ffa5a81cf97 100644 --- a/plugins/r/Cargo.toml +++ b/plugins/r/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-langs-r" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" diff --git a/tmc-client/Cargo.toml b/tmc-client/Cargo.toml index b307d46ff16..f2af3709d53 100644 --- a/tmc-client/Cargo.toml +++ b/tmc-client/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-client" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" @@ -18,13 +21,20 @@ oauth2 = { version = "4.1.0", features = ["reqwest"] } once_cell = "1.9.0" percent-encoding = "2.1.0" regex = "1.5.4" -reqwest = { version = "0.11.9", default-features = false, features = ["blocking", "json", "rustls-tls", "multipart"] } +reqwest = { version = "0.11.9", default-features = false, features = [ + "blocking", + "json", + "rustls-tls", + "multipart", +] } schemars = { version = "0.8.8", features = ["chrono"] } serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.78" tempfile = "3.3.0" thiserror = "1.0.30" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = ["serde-compat"], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b", optional = true } +ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ + "serde-compat", +], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b", optional = true } url = "2.2.2" walkdir = "2.3.2" diff --git a/tmc-langs-cli/Cargo.toml b/tmc-langs-cli/Cargo.toml index bf3cb26c951..29afcc76f7e 100644 --- a/tmc-langs-cli/Cargo.toml +++ b/tmc-langs-cli/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-langs-cli" version = "0.26.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" description = "CLI client for TMC" license = "MIT OR Apache-2.0" diff --git a/tmc-langs-framework/Cargo.toml b/tmc-langs-framework/Cargo.toml index b2ab9d70bb7..69b25d7d9f6 100644 --- a/tmc-langs-framework/Cargo.toml +++ b/tmc-langs-framework/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-langs-framework" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" @@ -21,11 +24,13 @@ schemars = "0.8.8" subprocess = "0.2.8" tar = "0.4.38" tempfile = "3.3.0" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = ["serde-compat"], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b", optional = true } +ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ + "serde-compat", +], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b", optional = true } thiserror = "1.0.30" walkdir = "2.3.2" zip = "0.6.2" -zstd = "0.10.2" # zip 0.6 is still on 0.10 +zstd = "0.10.2" # zip 0.6 is still on 0.10 [dev-dependencies] simple_logger = "2.1.0" diff --git a/tmc-langs-plugins/Cargo.toml b/tmc-langs-plugins/Cargo.toml index 8386a066a6b..76b7c31a073 100644 --- a/tmc-langs-plugins/Cargo.toml +++ b/tmc-langs-plugins/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-langs-plugins" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" @@ -23,7 +26,7 @@ tar = "0.4.38" thiserror = "1.0.30" walkdir = "2.3.2" zip = "0.6.2" -zstd = "0.10.2" # zip 0.6 is still on 0.10 +zstd = "0.10.2" # zip 0.6 is still on 0.10 [dev-dependencies] simple_logger = "2.1.0" diff --git a/tmc-langs-util/Cargo.toml b/tmc-langs-util/Cargo.toml index 81ab8449ce9..5131edecdcc 100644 --- a/tmc-langs-util/Cargo.toml +++ b/tmc-langs-util/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-langs-util" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" diff --git a/tmc-langs/Cargo.toml b/tmc-langs/Cargo.toml index e9ae2075b71..fcdc3b513cc 100644 --- a/tmc-langs/Cargo.toml +++ b/tmc-langs/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tmc-langs" version = "0.26.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" -description = "Library for TMC" license = "MIT OR Apache-2.0" rust-version = "1.58.1" @@ -36,11 +38,13 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.30" toml = "0.5.8" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = ["serde-compat"], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b", optional = true } +ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ + "serde-compat", +], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b", optional = true } url = "2.2.2" walkdir = "2.3.2" zip = "0.6.2" -zstd = "0.10.2" # zip 0.6 is still on 0.10 +zstd = "0.10.2" # zip 0.6 is still on 0.10 [target.'cfg(unix)'.dependencies] nix = "0.25.0" diff --git a/tmc-server-mock/Cargo.toml b/tmc-server-mock/Cargo.toml index b4ff06882ee..34f4fcfba2c 100644 --- a/tmc-server-mock/Cargo.toml +++ b/tmc-server-mock/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "tmc-server-mock" version = "0.1.0" -authors = ["University of Helsinki ", "Daniel Martinez "] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.58.1" From 7c36f0b2c4aa8676761603cce760c66864539e15 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Mon, 26 Sep 2022 17:48:25 +0300 Subject: [PATCH 02/15] Minor refactoring --- bindings/tmc-langs-node/src/lib.rs | 2 +- plugins/csharp/src/plugin.rs | 5 +- plugins/csharp/src/policy.rs | 20 ++---- plugins/java/src/ant_plugin.rs | 10 ++- plugins/java/src/ant_policy.rs | 24 +++---- plugins/java/src/maven_plugin.rs | 2 +- plugins/java/src/maven_policy.rs | 28 +++----- plugins/make/src/plugin.rs | 6 +- plugins/make/src/policy.rs | 24 +++---- plugins/notests/src/plugin.rs | 4 +- plugins/notests/src/policy.rs | 2 +- plugins/python3/src/plugin.rs | 16 +++-- plugins/python3/src/policy.rs | 65 +++++++------------ plugins/r/src/plugin.rs | 2 +- plugins/r/src/policy.rs | 18 ++---- tmc-langs-cli/src/lib.rs | 4 +- tmc-langs-framework/src/archive.rs | 2 + tmc-langs-framework/src/plugin.rs | 6 +- tmc-langs-framework/src/policy.rs | 16 +++-- tmc-langs-framework/src/tmc_project_yml.rs | 2 +- tmc-langs-plugins/src/archive.rs | 2 + tmc-langs-plugins/src/compression.rs | 4 +- tmc-langs-plugins/src/error.rs | 2 + tmc-langs-plugins/src/lib.rs | 74 ++++++++++++++++++++++ tmc-langs-util/src/file_util.rs | 26 ++++---- tmc-langs-util/src/path_util.rs | 4 +- tmc-langs/src/config/credentials.rs | 4 +- tmc-langs/src/config/tmc_config.rs | 6 +- tmc-langs/src/lib.rs | 5 +- 29 files changed, 214 insertions(+), 171 deletions(-) diff --git a/bindings/tmc-langs-node/src/lib.rs b/bindings/tmc-langs-node/src/lib.rs index 4fd1a692cf3..0f23f46e84e 100644 --- a/bindings/tmc-langs-node/src/lib.rs +++ b/bindings/tmc-langs-node/src/lib.rs @@ -118,7 +118,7 @@ fn extract_project(mut cx: FunctionContext) -> JsResult { ); let mut archive = - file_util::open_file_lock(archive_path).map_err(|e| convert_err(&mut cx, e))?; + file_util::open_file_locked(archive_path).map_err(|e| convert_err(&mut cx, e))?; let mut guard = archive.write().expect("failed to lock file"); let mut data = vec![]; guard.read_to_end(&mut data).expect("failed to read data"); diff --git a/plugins/csharp/src/plugin.rs b/plugins/csharp/src/plugin.rs index c485d428f0c..920e81f91ff 100644 --- a/plugins/csharp/src/plugin.rs +++ b/plugins/csharp/src/plugin.rs @@ -160,11 +160,12 @@ impl LanguagePlugin for CSharpPlugin { && !file_path.components().any(|c| c.as_os_str() == "__MACOSX") { if let Some(parent) = file_path.parent() { - if let Some(src_parent) = path_util::get_parent_of(parent, "src") { + if let Some(src_parent) = path_util::get_parent_of_named(parent, "src") { return Ok(Break(Some(src_parent))); } if let Some(parent) = parent.parent() { - if let Some(src_parent) = path_util::get_parent_of(parent, "src") { + if let Some(src_parent) = path_util::get_parent_of_named(parent, "src") + { return Ok(Break(Some(src_parent))); } } diff --git a/plugins/csharp/src/policy.rs b/plugins/csharp/src/policy.rs index 11224134cb4..0a7303de2ac 100644 --- a/plugins/csharp/src/policy.rs +++ b/plugins/csharp/src/policy.rs @@ -35,7 +35,7 @@ impl StudentFilePolicy for CSharpStudentFilePolicy { } // false for files in bin or obj directories, true for other files in src. - fn is_student_source_file(path: &Path) -> bool { + fn is_student_source_file(&self, path: &Path) -> bool { path.starts_with("src") && !Self::is_child_of_binary_dir(path) } } @@ -46,21 +46,15 @@ mod test { #[test] fn file_in_binary_dir_is_not_student_file() { - assert!(!CSharpStudentFilePolicy::is_student_source_file(Path::new( - "src/bin/any/file" - ))); - assert!(!CSharpStudentFilePolicy::is_student_source_file(Path::new( - "obj/any/src/file" - ))); + let policy = CSharpStudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(!policy.is_student_source_file(Path::new("src/bin/any/file"))); + assert!(!policy.is_student_source_file(Path::new("obj/any/src/file"))); } #[test] fn file_in_src_is_student_file() { - assert!(CSharpStudentFilePolicy::is_student_source_file(Path::new( - "src/file" - ))); - assert!(CSharpStudentFilePolicy::is_student_source_file(Path::new( - "src/any/file" - ))); + let policy = CSharpStudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(policy.is_student_source_file(Path::new("src/file"))); + assert!(policy.is_student_source_file(Path::new("src/any/file"))); } } diff --git a/plugins/java/src/ant_plugin.rs b/plugins/java/src/ant_plugin.rs index 3f59c5f501a..fa0618fa835 100644 --- a/plugins/java/src/ant_plugin.rs +++ b/plugins/java/src/ant_plugin.rs @@ -113,12 +113,14 @@ impl LanguagePlugin for AntPlugin { if file.is_file() { // check for build.xml - if let Some(parent) = path_util::get_parent_of(&file_path, "build.xml") { + if let Some(parent) = path_util::get_parent_of_named(&file_path, "build.xml") { return Ok(Break(Some(parent))); } } else if file.is_dir() { // check for src - if let Some(src_parent) = path_util::get_parent_of_dir(&file_path, "src") { + if let Some(src_parent) = + path_util::get_parent_of_component_in_path(&file_path, "src") + { if test_parents.contains(&src_parent) { // found a test in the same directory before, return return Ok(Break(Some(src_parent))); @@ -128,7 +130,9 @@ impl LanguagePlugin for AntPlugin { } // check for test - if let Some(test_parent) = path_util::get_parent_of_dir(&file_path, "test") { + if let Some(test_parent) = + path_util::get_parent_of_component_in_path(&file_path, "test") + { if src_parents.contains(&test_parent) { // found a test in the same directory before, return return Ok(Break(Some(test_parent))); diff --git a/plugins/java/src/ant_policy.rs b/plugins/java/src/ant_policy.rs index 1efb622108a..a852bc564d2 100644 --- a/plugins/java/src/ant_policy.rs +++ b/plugins/java/src/ant_policy.rs @@ -19,7 +19,7 @@ impl StudentFilePolicy for AntStudentFilePolicy { &self.project_config } - fn is_student_source_file(path: &Path) -> bool { + fn is_student_source_file(&self, path: &Path) -> bool { path.starts_with("src") } } @@ -30,24 +30,16 @@ mod test { #[test] fn is_student_source_file() { - assert!(AntStudentFilePolicy::is_student_source_file(Path::new( - "src/file" - ))); - assert!(AntStudentFilePolicy::is_student_source_file(Path::new( - "src/dir/file" - ))); + let policy = AntStudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(policy.is_student_source_file(Path::new("src/file"))); + assert!(policy.is_student_source_file(Path::new("src/dir/file"))); } #[test] fn is_not_student_source_file() { - assert!(!AntStudentFilePolicy::is_student_source_file(Path::new( - "file" - ))); - assert!(!AntStudentFilePolicy::is_student_source_file(Path::new( - "dir/src/file" - ))); - assert!(!AntStudentFilePolicy::is_student_source_file(Path::new( - "srca/file" - ))); + let policy = AntStudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(!policy.is_student_source_file(Path::new("file"))); + assert!(!policy.is_student_source_file(Path::new("dir/src/file"))); + assert!(!policy.is_student_source_file(Path::new("srca/file"))); } } diff --git a/plugins/java/src/maven_plugin.rs b/plugins/java/src/maven_plugin.rs index 0e880315af4..d6fe4e6364b 100644 --- a/plugins/java/src/maven_plugin.rs +++ b/plugins/java/src/maven_plugin.rs @@ -139,7 +139,7 @@ impl LanguagePlugin for MavenPlugin { if file.is_file() { // check for pom.xml - if let Some(parent) = path_util::get_parent_of(&file_path, "pom.xml") { + if let Some(parent) = path_util::get_parent_of_named(&file_path, "pom.xml") { return Ok(Break(Some(parent))); } } diff --git a/plugins/java/src/maven_policy.rs b/plugins/java/src/maven_policy.rs index 813fb06fde0..77daa644af2 100644 --- a/plugins/java/src/maven_policy.rs +++ b/plugins/java/src/maven_policy.rs @@ -19,7 +19,7 @@ impl StudentFilePolicy for MavenStudentFilePolicy { &self.project_config } - fn is_student_source_file(path: &Path) -> bool { + fn is_student_source_file(&self, path: &Path) -> bool { path.starts_with("src/main") } } @@ -30,27 +30,17 @@ mod test { #[test] fn is_student_source_file() { - assert!(MavenStudentFilePolicy::is_student_source_file(Path::new( - "src/main/file" - ))); - assert!(MavenStudentFilePolicy::is_student_source_file(Path::new( - "src/main/dir/file" - ))); + let policy = MavenStudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(policy.is_student_source_file(Path::new("src/main/file"))); + assert!(policy.is_student_source_file(Path::new("src/main/dir/file"))); } #[test] fn is_not_student_source_file() { - assert!(!MavenStudentFilePolicy::is_student_source_file(Path::new( - "file" - ))); - assert!(!MavenStudentFilePolicy::is_student_source_file(Path::new( - "dir/src/main/file" - ))); - assert!(!MavenStudentFilePolicy::is_student_source_file(Path::new( - "srca/main/file" - ))); - assert!(!MavenStudentFilePolicy::is_student_source_file(Path::new( - "src/mainc/file" - ))); + let policy = MavenStudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(!policy.is_student_source_file(Path::new("file"))); + assert!(!policy.is_student_source_file(Path::new("dir/src/main/file"))); + assert!(!policy.is_student_source_file(Path::new("srca/main/file"))); + assert!(!policy.is_student_source_file(Path::new("src/mainc/file"))); } } diff --git a/plugins/make/src/plugin.rs b/plugins/make/src/plugin.rs index b586b9cd7fa..8516f924c3a 100644 --- a/plugins/make/src/plugin.rs +++ b/plugins/make/src/plugin.rs @@ -294,7 +294,7 @@ impl LanguagePlugin for MakePlugin { if file.is_file() { // check for Makefile - if let Some(parent) = path_util::get_parent_of(&file_path, "Makefile") { + if let Some(parent) = path_util::get_parent_of_named(&file_path, "Makefile") { if src_parents.contains(&parent) { return Ok(Break(Some(parent))); } else { @@ -303,7 +303,9 @@ impl LanguagePlugin for MakePlugin { } } else if file.is_dir() { // check for src - if let Some(parent) = path_util::get_parent_of_dir(&file_path, "src") { + if let Some(parent) = + path_util::get_parent_of_component_in_path(&file_path, "src") + { if makefile_parents.contains(&parent) { return Ok(Break(Some(parent))); } else { diff --git a/plugins/make/src/policy.rs b/plugins/make/src/policy.rs index 5983727e63f..52165246525 100644 --- a/plugins/make/src/policy.rs +++ b/plugins/make/src/policy.rs @@ -19,7 +19,7 @@ impl StudentFilePolicy for MakeStudentFilePolicy { &self.project_config } - fn is_student_source_file(path: &Path) -> bool { + fn is_student_source_file(&self, path: &Path) -> bool { path.starts_with("src") } } @@ -30,24 +30,16 @@ mod test { #[test] fn is_student_source_file() { - assert!(MakeStudentFilePolicy::is_student_source_file(Path::new( - "src" - ))); - assert!(MakeStudentFilePolicy::is_student_source_file(Path::new( - "src/file" - ))); - assert!(MakeStudentFilePolicy::is_student_source_file(Path::new( - "src/dir/file" - ))); + let policy = MakeStudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(policy.is_student_source_file(Path::new("src"))); + assert!(policy.is_student_source_file(Path::new("src/file"))); + assert!(policy.is_student_source_file(Path::new("src/dir/file"))); } #[test] fn is_not_student_source_file() { - assert!(!MakeStudentFilePolicy::is_student_source_file(Path::new( - "srcc" - ))); - assert!(!MakeStudentFilePolicy::is_student_source_file(Path::new( - "dir/src/file" - ))); + let policy = MakeStudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(!policy.is_student_source_file(Path::new("srcc"))); + assert!(!policy.is_student_source_file(Path::new("dir/src/file"))); } } diff --git a/plugins/notests/src/plugin.rs b/plugins/notests/src/plugin.rs index 39a61eddae3..d5cfc52c87b 100644 --- a/plugins/notests/src/plugin.rs +++ b/plugins/notests/src/plugin.rs @@ -92,7 +92,9 @@ impl LanguagePlugin for NoTestsPlugin { if file.is_file() { // check for .tmcproject.yml - if let Some(parent) = path_util::get_parent_of(&file_path, ".tmcproject.yml") { + if let Some(parent) = + path_util::get_parent_of_named(&file_path, ".tmcproject.yml") + { let tmc_project_yml: TmcProjectYml = deserialize::yaml_from_reader(file) .map_err(|e| TmcError::YamlDeserialize(file_path, e))?; // check no-tests diff --git a/plugins/notests/src/policy.rs b/plugins/notests/src/policy.rs index 7ef2902b821..302e4f6f5fa 100644 --- a/plugins/notests/src/policy.rs +++ b/plugins/notests/src/policy.rs @@ -20,7 +20,7 @@ impl StudentFilePolicy for NoTestsStudentFilePolicy { &self.project_config } - fn is_student_source_file(_file_path: &Path) -> bool { + fn is_student_source_file(&self, _file_path: &Path) -> bool { true } } diff --git a/plugins/python3/src/plugin.rs b/plugins/python3/src/plugin.rs index 2359e8f10c2..a5a41976478 100644 --- a/plugins/python3/src/plugin.rs +++ b/plugins/python3/src/plugin.rs @@ -372,19 +372,23 @@ impl LanguagePlugin for Python3Plugin { let file_path = file.path()?; if file.is_file() { - if let Some(parent) = path_util::get_parent_of(&file_path, "setup.py") { + if let Some(parent) = path_util::get_parent_of_named(&file_path, "setup.py") { return Ok(Break(Some(parent))); } - if let Some(parent) = path_util::get_parent_of(&file_path, "requirements.txt") { + if let Some(parent) = + path_util::get_parent_of_named(&file_path, "requirements.txt") + { return Ok(Break(Some(parent))); } - if let Some(parent) = path_util::get_parent_of(&file_path, "__init__.py") { - if let Some(parent) = path_util::get_parent_of(&parent, "test") { + if let Some(parent) = path_util::get_parent_of_named(&file_path, "__init__.py") + { + if let Some(parent) = path_util::get_parent_of_named(&parent, "test") { return Ok(Break(Some(parent))); } } - if let Some(parent) = path_util::get_parent_of(&file_path, "__main__.py") { - if let Some(parent) = path_util::get_parent_of(&parent, "tmc") { + if let Some(parent) = path_util::get_parent_of_named(&file_path, "__main__.py") + { + if let Some(parent) = path_util::get_parent_of_named(&parent, "tmc") { return Ok(Break(Some(parent))); } } diff --git a/plugins/python3/src/policy.rs b/plugins/python3/src/policy.rs index e086859b982..65e6b739b2d 100644 --- a/plugins/python3/src/policy.rs +++ b/plugins/python3/src/policy.rs @@ -19,7 +19,7 @@ impl StudentFilePolicy for Python3StudentFilePolicy { &self.project_config } - fn is_student_source_file(path: &Path) -> bool { + fn is_student_source_file(&self, path: &Path) -> bool { // all non-pyc or __pycache__ files in src are student source files let in_src = path.starts_with("src"); let is_cache_file = path.extension() == Some(OsStr::new("pyc")) @@ -51,71 +51,50 @@ mod test { #[test] fn in_src_is_source_file() { - assert!(Python3StudentFilePolicy::is_student_source_file(Path::new( - "src/some_file.py" - ))); - assert!(Python3StudentFilePolicy::is_student_source_file(Path::new( - "src/some_dir/some_file.py" - ))); + let policy = Python3StudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(policy.is_student_source_file(Path::new("src/some_file.py"))); + assert!(policy.is_student_source_file(Path::new("src/some_dir/some_file.py"))); } #[test] fn in_root_is_source_file() { - assert!(Python3StudentFilePolicy::is_student_source_file(Path::new( - "some_file.py" - ))); + let policy = Python3StudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(policy.is_student_source_file(Path::new("some_file.py"))); } #[test] fn pycache_is_not_source_file() { - assert!(!Python3StudentFilePolicy::is_student_source_file( - Path::new("__pycache__") - )); - assert!(!Python3StudentFilePolicy::is_student_source_file( - Path::new("__pycache__/cachefile") - )); - assert!(!Python3StudentFilePolicy::is_student_source_file( - Path::new("src/__pycache__") - )); + let policy = Python3StudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(!policy.is_student_source_file(Path::new("__pycache__"))); + assert!(!policy.is_student_source_file(Path::new("__pycache__/cachefile"))); + assert!(!policy.is_student_source_file(Path::new("src/__pycache__"))); } #[test] fn pyc_is_not_source_file() { - assert!(!Python3StudentFilePolicy::is_student_source_file( - Path::new("some.pyc") - )); - assert!(!Python3StudentFilePolicy::is_student_source_file( - Path::new("src/other.pyc") - )); + let policy = Python3StudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(!policy.is_student_source_file(Path::new("some.pyc"))); + assert!(!policy.is_student_source_file(Path::new("src/other.pyc"))); } #[test] fn subdirs_are_student_files() { - assert!(Python3StudentFilePolicy::is_student_source_file(Path::new( - "subdir/something" - ))); - assert!(Python3StudentFilePolicy::is_student_source_file(Path::new( - "another/mid/else" - ))); + let policy = Python3StudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(policy.is_student_source_file(Path::new("subdir/something"))); + assert!(policy.is_student_source_file(Path::new("another/mid/else"))); } #[test] fn tmc_and_test_are_not_student_files() { - assert!(!Python3StudentFilePolicy::is_student_source_file( - Path::new("test/something.py") - )); - assert!(!Python3StudentFilePolicy::is_student_source_file( - Path::new("tmc/mid/else.py") - )); + let policy = Python3StudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(!policy.is_student_source_file(Path::new("test/something.py"))); + assert!(!policy.is_student_source_file(Path::new("tmc/mid/else.py"))); } #[test] fn non_py_file_in_root_is_not_student_file() { - assert!(!Python3StudentFilePolicy::is_student_source_file( - Path::new("test") - )); - assert!(!Python3StudentFilePolicy::is_student_source_file( - Path::new("root_file") - )); + let policy = Python3StudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(!policy.is_student_source_file(Path::new("test"))); + assert!(!policy.is_student_source_file(Path::new("root_file"))); } } diff --git a/plugins/r/src/plugin.rs b/plugins/r/src/plugin.rs index 6ed67dd6625..1d8879a57b3 100644 --- a/plugins/r/src/plugin.rs +++ b/plugins/r/src/plugin.rs @@ -125,7 +125,7 @@ impl LanguagePlugin for RPlugin { let next = iter.with_next(|file| { let file_path = file.path()?; - if let Some(parent) = path_util::get_parent_of_dir(&file_path, "R") { + if let Some(parent) = path_util::get_parent_of_component_in_path(&file_path, "R") { return Ok(Break(Some(parent))); } Ok(Continue(())) diff --git a/plugins/r/src/policy.rs b/plugins/r/src/policy.rs index 3adeb6648db..97ebb9f8b46 100644 --- a/plugins/r/src/policy.rs +++ b/plugins/r/src/policy.rs @@ -19,7 +19,7 @@ impl StudentFilePolicy for RStudentFilePolicy { &self.project_config } - fn is_student_source_file(path: &Path) -> bool { + fn is_student_source_file(&self, path: &Path) -> bool { path.starts_with("R") } } @@ -38,21 +38,17 @@ mod test { fn is_student_source_file() { init(); - assert!(RStudentFilePolicy::is_student_source_file(Path::new("R"))); - assert!(RStudentFilePolicy::is_student_source_file(Path::new( - "R/file" - ))); + let policy = RStudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(policy.is_student_source_file(Path::new("R"))); + assert!(policy.is_student_source_file(Path::new("R/file"))); } #[test] fn is_not_student_source_file() { init(); - assert!(!RStudentFilePolicy::is_student_source_file(Path::new( - "dir/R" - ))); - assert!(!RStudentFilePolicy::is_student_source_file(Path::new( - "dir/R/file" - ))); + let policy = RStudentFilePolicy::new(Path::new(".")).unwrap(); + assert!(!policy.is_student_source_file(Path::new("dir/R"))); + assert!(!policy.is_student_source_file(Path::new("dir/R/file"))); } } diff --git a/tmc-langs-cli/src/lib.rs b/tmc-langs-cli/src/lib.rs index d5bde822c77..f018dfd8f04 100644 --- a/tmc-langs-cli/src/lib.rs +++ b/tmc-langs-cli/src/lib.rs @@ -258,7 +258,7 @@ fn run_app(matches: Opt) -> Result<()> { compression, naive, } => { - let mut archive = file_util::open_file_lock(&archive_path)?; + let mut archive = file_util::open_file_locked(&archive_path)?; let mut guard = archive.write()?; let mut data = vec![]; @@ -1093,7 +1093,7 @@ fn write_result_to_file_as_json( pretty: bool, secret: Option, ) -> Result<()> { - let mut output_file = file_util::create_file_lock(output_path).with_context(|| { + let mut output_file = file_util::create_file_locked(output_path).with_context(|| { format!( "Failed to create results JSON file at {}", output_path.display() diff --git a/tmc-langs-framework/src/archive.rs b/tmc-langs-framework/src/archive.rs index b00ff1ba1d7..781fac1eaca 100644 --- a/tmc-langs-framework/src/archive.rs +++ b/tmc-langs-framework/src/archive.rs @@ -1,3 +1,5 @@ +//! Contains types that abstract over the various archive formats. + use crate::TmcError; use serde::Deserialize; use std::{ diff --git a/tmc-langs-framework/src/plugin.rs b/tmc-langs-framework/src/plugin.rs index 345b7b4cafe..9156876e0fc 100644 --- a/tmc-langs-framework/src/plugin.rs +++ b/tmc-langs-framework/src/plugin.rs @@ -511,7 +511,7 @@ mod test { fn get_project_config(&self) -> &TmcProjectYml { &self.project_config } - fn is_student_source_file(path: &Path) -> bool { + fn is_student_source_file(&self, path: &Path) -> bool { path.starts_with("src") } } @@ -550,7 +550,9 @@ mod test { let next = iter.with_next(|file| { let file_path = file.path()?; - if let Some(parent) = path_util::get_parent_of_dir(&file_path, "src") { + if let Some(parent) = + path_util::get_parent_of_component_in_path(&file_path, "src") + { return Ok(Break(Some(parent))); } Ok(Continue(())) diff --git a/tmc-langs-framework/src/policy.rs b/tmc-langs-framework/src/policy.rs index 62ea3e8e7c3..bdb7b90cc4d 100644 --- a/tmc-langs-framework/src/policy.rs +++ b/tmc-langs-framework/src/policy.rs @@ -27,7 +27,7 @@ pub trait StudentFilePolicy { fn get_project_config(&self) -> &TmcProjectYml; /// Checks whether the path is considered a student source file. The file_path can be assumed to be a relative path starting from the project root directory. - fn is_student_source_file(file_path: &Path) -> bool; + fn is_student_source_file(&self, file_path: &Path) -> bool; /// Determines whether a file is a student source file. /// @@ -81,7 +81,7 @@ pub trait StudentFilePolicy { .iter() .any(|f| relative.starts_with(f)); - Ok(is_extra_student_file || Self::is_student_source_file(relative)) + Ok(is_extra_student_file || self.is_student_source_file(relative)) } /// Used to check for files which should always be overwritten. @@ -132,7 +132,7 @@ impl StudentFilePolicy for NothingIsStudentFilePolicy { Ok(false) } - fn is_student_source_file(_path: &Path) -> bool { + fn is_student_source_file(&self, _path: &Path) -> bool { false } } @@ -173,7 +173,7 @@ impl StudentFilePolicy for EverythingIsStudentFilePolicy { Ok(true) } - fn is_student_source_file(_path: &Path) -> bool { + fn is_student_source_file(&self, _path: &Path) -> bool { true } } @@ -219,7 +219,7 @@ mod test { &self.project_config } - fn is_student_source_file(file_path: &Path) -> bool { + fn is_student_source_file(&self, file_path: &Path) -> bool { file_path .components() .any(|c| c.as_os_str() == "student_file") @@ -307,4 +307,10 @@ mod test { .unwrap()); assert!(!policy.is_updating_forced(Path::new("other file")).unwrap()); } + + #[test] + fn is_object_safe() { + // this will fail to compile if the trait is not object safe + fn _f(_: Box) {} + } } diff --git a/tmc-langs-framework/src/tmc_project_yml.rs b/tmc-langs-framework/src/tmc_project_yml.rs index 2e4d7826d85..b2ae64b0805 100644 --- a/tmc-langs-framework/src/tmc_project_yml.rs +++ b/tmc-langs-framework/src/tmc_project_yml.rs @@ -115,7 +115,7 @@ impl TmcProjectYml { pub fn save_to_dir(&self, dir: &Path) -> Result<(), TmcError> { let config_path = Self::path_in_dir(dir); - let mut file = file_util::create_file_lock(&config_path)?; + let mut file = file_util::create_file_locked(&config_path)?; let guard = file .write() .map_err(|e| FileError::FdLock(config_path.clone(), e))?; diff --git a/tmc-langs-plugins/src/archive.rs b/tmc-langs-plugins/src/archive.rs index 9dc9e4d8e29..aec1cca9490 100644 --- a/tmc-langs-plugins/src/archive.rs +++ b/tmc-langs-plugins/src/archive.rs @@ -1,3 +1,5 @@ +//! Contains types that abstract over the various archive formats. + use std::{ io::{self, Cursor, Seek, Write}, path::Path, diff --git a/tmc-langs-plugins/src/compression.rs b/tmc-langs-plugins/src/compression.rs index 270d095183b..39621ce7cad 100644 --- a/tmc-langs-plugins/src/compression.rs +++ b/tmc-langs-plugins/src/compression.rs @@ -1,4 +1,4 @@ -//! Contains functions for zipping and unzipping projects. +//! Contains functions for compressing and uncompressing projects. use crate::archive::ArchiveBuilder; use std::{ @@ -11,7 +11,7 @@ use walkdir::{DirEntry, WalkDir}; pub use zip::result::ZipError; use zip::ZipArchive; -/// Zips the given directory, only including student files according to the given policy. +/// Compressesthe given directory, only including student files according to the given policy. pub fn compress_student_files( policy: P, root_directory: &Path, diff --git a/tmc-langs-plugins/src/error.rs b/tmc-langs-plugins/src/error.rs index e6f2c62902b..7d8412de1d3 100644 --- a/tmc-langs-plugins/src/error.rs +++ b/tmc-langs-plugins/src/error.rs @@ -7,6 +7,8 @@ pub enum PluginError { PluginNotFound(PathBuf), #[error(transparent)] Tmc(#[from] tmc_langs_framework::TmcError), + #[error(transparent)] + Walkdir(#[from] walkdir::Error), } impl From for PluginError { diff --git a/tmc-langs-plugins/src/lib.rs b/tmc-langs-plugins/src/lib.rs index 9d9537dcdf6..ffd9f8f9db5 100644 --- a/tmc-langs-plugins/src/lib.rs +++ b/tmc-langs-plugins/src/lib.rs @@ -6,6 +6,7 @@ mod error; pub use error::PluginError; use std::{ + collections::HashSet, io::{Read, Seek}, path::{Path, PathBuf}, }; @@ -21,6 +22,7 @@ pub use tmc_langs_make::MakePlugin; pub use tmc_langs_notests::NoTestsPlugin; pub use tmc_langs_python3::Python3Plugin; pub use tmc_langs_r::RPlugin; +use walkdir::WalkDir; /// Finds the correct language plug-in for the given exercise path and calls `LanguagePlugin::extract_project`, /// If no language plugin matches, see `extract_project_overwrite`. @@ -104,6 +106,35 @@ pub fn compress_project( } } +pub fn get_exercise_packaging_configuration( + path: &Path, +) -> Result { + let policy = get_student_file_policy(path)?; + let mut config = ExercisePackagingConfiguration { + student_file_paths: HashSet::new(), + exercise_file_paths: HashSet::new(), + }; + for entry in WalkDir::new(path) { + let entry = entry?; + if entry.metadata()?.is_dir() { + continue; + } + + let path = entry + .path() + .strip_prefix(path) + .expect("All entries are within path") + .to_path_buf(); + if policy.is_student_source_file(&path) { + config.student_file_paths.insert(path); + } else { + config.exercise_file_paths.insert(path); + } + } + + Ok(config) +} + // enum containing all the plugins #[impl_enum::with_methods( pub fn clean(&self, path: &Path) -> Result<(), TmcError> @@ -136,6 +167,23 @@ pub enum PluginType { Ant, } +impl PluginType { + pub fn get_exercise_packaging_configuration( + self, + config: TmcProjectYml, + ) -> Result { + match self { + Self::CSharp => CSharpPlugin::get_exercise_packaging_configuration(config), + Self::Make => MakePlugin::get_exercise_packaging_configuration(config), + Self::Maven => MavenPlugin::get_exercise_packaging_configuration(config), + Self::NoTests => NoTestsPlugin::get_exercise_packaging_configuration(config), + Self::Python3 => Python3Plugin::get_exercise_packaging_configuration(config), + Self::R => RPlugin::get_exercise_packaging_configuration(config), + Self::Ant => AntPlugin::get_exercise_packaging_configuration(config), + } + } +} + pub fn get_language_plugin_type(path: &Path) -> Option { let plugin_type = if NoTestsPlugin::is_exercise_type_correct(path) { log::info!( @@ -207,3 +255,29 @@ pub fn get_language_plugin(path: &Path) -> Result { }; Ok(plugin) } + +pub fn get_student_file_policy(path: &Path) -> Result, PluginError> { + let policy: Box = match get_language_plugin_type(path) { + Some(PluginType::NoTests) => Box::new( + ::StudentFilePolicy::new(path)?, + ), + Some(PluginType::CSharp) => Box::new( + ::StudentFilePolicy::new(path)?, + ), + Some(PluginType::Make) => Box::new(::StudentFilePolicy::new( + path, + )?), + Some(PluginType::Python3) => Box::new( + ::StudentFilePolicy::new(path)?, + ), + Some(PluginType::R) => Box::new(::StudentFilePolicy::new(path)?), + Some(PluginType::Maven) => Box::new( + ::StudentFilePolicy::new(path)?, + ), + Some(PluginType::Ant) => { + Box::new(::StudentFilePolicy::new(path)?) + } + None => return Err(PluginError::PluginNotFound(path.to_path_buf())), + }; + Ok(policy) +} diff --git a/tmc-langs-util/src/file_util.rs b/tmc-langs-util/src/file_util.rs index 2ec7724a9a3..63056c5070e 100644 --- a/tmc-langs-util/src/file_util.rs +++ b/tmc-langs-util/src/file_util.rs @@ -1,5 +1,15 @@ //! Various utility functions, primarily wrapping the standard library's IO and filesystem functions +#[cfg(unix)] +mod lock_unix; +#[cfg(unix)] +pub use lock_unix::*; + +#[cfg(windows)] +mod lock_windows; +#[cfg(windows)] +pub use lock_windows::*; + use crate::error::FileError; use fd_lock::RwLock; use std::{ @@ -49,16 +59,6 @@ impl Drop for FdLockWrapper { } } -#[cfg(unix)] -mod lock_unix; -#[cfg(unix)] -pub use lock_unix::*; - -#[cfg(windows)] -mod lock_windows; -#[cfg(windows)] -pub use lock_windows::*; - pub fn temp_file() -> Result { tempfile::tempfile().map_err(FileError::TempFile) } @@ -67,13 +67,13 @@ pub fn named_temp_file() -> Result { tempfile::NamedTempFile::new().map_err(FileError::TempFile) } -pub fn open_file>(path: P) -> Result { +pub fn open_file(path: impl AsRef) -> Result { let path = path.as_ref(); File::open(path).map_err(|e| FileError::FileOpen(path.to_path_buf(), e)) } /// Opens and locks the given file. Note: Does not work on directories on Windows. -pub fn open_file_lock>(path: P) -> Result { +pub fn open_file_locked(path: impl AsRef) -> Result { log::trace!("locking file {}", path.as_ref().display()); let file = open_file(path)?; @@ -116,7 +116,7 @@ pub fn create_file>(path: P) -> Result { /// Creates a file and wraps it in a lock. If a file already exists at the path, it acquires a lock on it first and then recreates it. /// Note: creates all intermediary directories if needed. -pub fn create_file_lock>(path: P) -> Result { +pub fn create_file_locked>(path: P) -> Result { log::trace!("locking file {}", path.as_ref().display()); if let Ok(existing) = open_file(&path) { diff --git a/tmc-langs-util/src/path_util.rs b/tmc-langs-util/src/path_util.rs index 8a56982878a..2c758fe283f 100644 --- a/tmc-langs-util/src/path_util.rs +++ b/tmc-langs-util/src/path_util.rs @@ -5,7 +5,7 @@ use std::{ /// If the path contains a component that equals the component argument, returns its parent. /// Ignores paths that contain __MACOSX in the parent. -pub fn get_parent_of_dir(path: &Path, component: &str) -> Option { +pub fn get_parent_of_component_in_path(path: &Path, component: &str) -> Option { if path.components().any(|c| c.as_os_str() == component) { let path: PathBuf = path .components() @@ -20,7 +20,7 @@ pub fn get_parent_of_dir(path: &Path, component: &str) -> Option { /// Returns the path's parent path if the path's name equals the name argument. /// Ignores paths that contain __MACOSX in the parent. -pub fn get_parent_of(path: &Path, name: &str) -> Option { +pub fn get_parent_of_named(path: &Path, name: &str) -> Option { if path.file_name() == Some(OsStr::new(name)) && !path.components().any(|c| c.as_os_str() == "__MACOSX") { diff --git a/tmc-langs/src/config/credentials.rs b/tmc-langs/src/config/credentials.rs index 636c5155501..eb38dd87e66 100644 --- a/tmc-langs/src/config/credentials.rs +++ b/tmc-langs/src/config/credentials.rs @@ -30,7 +30,7 @@ impl Credentials { return Ok(None); } - let mut credentials_file = file_util::open_file_lock(&credentials_path)?; + let mut credentials_file = file_util::open_file_locked(&credentials_path)?; let guard = credentials_file .write() .map_err(|e| FileError::FdLock(credentials_path.clone(), e))?; @@ -57,7 +57,7 @@ impl Credentials { if let Some(p) = credentials_path.parent() { file_util::create_dir_all(p)?; } - let mut credentials_file = file_util::create_file_lock(&credentials_path)?; + let mut credentials_file = file_util::create_file_locked(&credentials_path)?; let guard = credentials_file .write() .map_err(|e| FileError::FdLock(credentials_path.clone(), e))?; diff --git a/tmc-langs/src/config/tmc_config.rs b/tmc-langs/src/config/tmc_config.rs index f6019c2b49f..ea0a82e2016 100644 --- a/tmc-langs/src/config/tmc_config.rs +++ b/tmc-langs/src/config/tmc_config.rs @@ -69,7 +69,7 @@ impl TmcConfig { if let Some(parent) = path.parent() { file_util::create_dir_all(parent)?; } - let mut lock = file_util::create_file_lock(&path)?; + let mut lock = file_util::create_file_locked(&path)?; let mut guard = lock .write() .map_err(|e| FileError::FdLock(path.to_path_buf(), e))?; @@ -89,7 +89,7 @@ impl TmcConfig { pub fn load(client_name: &str, path: &Path) -> Result { // try to open config file - let config = match file_util::open_file_lock(path) { + let config = match file_util::open_file_locked(path) { Ok(mut lock) => { // found config file, lock and read let mut guard = lock @@ -147,7 +147,7 @@ impl TmcConfig { file_util::create_dir_all(parent)?; } - let mut lock = file_util::create_file_lock(path)?; + let mut lock = file_util::create_file_locked(path)?; let mut guard = lock .write() .map_err(|e| FileError::FdLock(path.to_path_buf(), e))?; diff --git a/tmc-langs/src/lib.rs b/tmc-langs/src/lib.rs index 3955ae2dfb4..4df753c768c 100644 --- a/tmc-langs/src/lib.rs +++ b/tmc-langs/src/lib.rs @@ -871,9 +871,8 @@ pub fn get_exercise_packaging_configuration( ) -> Result { log::debug!("getting exercise packaging config for {}", path.display()); - let config = TmcProjectYml::load_or_default(path)?; - Ok(tmc_langs_plugins::get_language_plugin(path)? - .get_exercise_packaging_configuration(config)?) + let config = tmc_langs_plugins::get_exercise_packaging_configuration(path)?; + Ok(config) } /// Prepares the exercise stub, copying tmc-junit-runner for Ant exercises. From 461352e86a7018e4622971b24b8935dda46dd4e3 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Fri, 30 Sep 2022 18:23:38 +0300 Subject: [PATCH 03/15] Update deps --- Cargo.lock | 93 +++++++++++++----------------- Cargo.toml | 2 +- bindings/tmc-langs-node/Cargo.toml | 2 +- plugins/csharp/Cargo.toml | 2 +- plugins/java/Cargo.toml | 2 +- plugins/make/Cargo.toml | 2 +- plugins/notests/Cargo.toml | 2 +- plugins/python3/Cargo.toml | 2 +- plugins/r/Cargo.toml | 2 +- tmc-client/Cargo.toml | 2 +- tmc-langs-cli/Cargo.toml | 2 +- tmc-langs-cli/src/app.rs | 9 +-- tmc-langs-cli/src/lib.rs | 2 +- tmc-langs-framework/Cargo.toml | 6 +- tmc-langs-plugins/Cargo.toml | 4 +- tmc-langs/Cargo.toml | 6 +- 16 files changed, 65 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4700286ceb7..d53a260ed57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -202,9 +202,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64ct" -version = "1.0.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" +checksum = "ea2b2456fd614d856680dcd9fcc660a51a820fa09daef2e49772b56a193c8474" [[package]] name = "bitflags" @@ -345,33 +345,31 @@ dependencies = [ "atty", "bitflags", "strsim 0.8.0", - "textwrap 0.11.0", + "textwrap", "unicode-width", "vec_map", ] [[package]] name = "clap" -version = "3.2.22" +version = "4.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" +checksum = "0a1af219c3e254a8b4649d6ddaef886b2015089f35f2ac5e1db31410c0566ab8" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", - "indexmap", "once_cell", "strsim 0.10.0", "termcolor", - "textwrap 0.15.1", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "4.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "cd114ae53ce5a0670f43d2f169c1cd26c69b4896b0c121900cf1e4d06d67316c" dependencies = [ "heck 0.4.0", "proc-macro-error", @@ -382,9 +380,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" dependencies = [ "os_str_bytes", ] @@ -441,12 +439,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -1029,9 +1026,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.133" +version = "0.2.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966" +checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" [[package]] name = "libloading" @@ -1289,9 +1286,9 @@ checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "password-hash" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core", @@ -1300,9 +1297,9 @@ dependencies = [ [[package]] name = "pbkdf2" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.5", "hmac", @@ -1398,9 +1395,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.44" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd7356a8122b6c4a24a82b278680c73357984ca2fc79a0f9fa6dea7dced7c58" +checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" dependencies = [ "unicode-ident", ] @@ -1578,9 +1575,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.35.10" +version = "0.35.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af895b90e5c071badc3136fc10ff0bcfc98747eadbaf43ed8f214e07ba8f8477" +checksum = "fbb2fda4666def1433b1b05431ab402e42a1084285477222b72d6c564c417cef" dependencies = [ "bitflags", "errno", @@ -1956,9 +1953,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.100" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" +checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" dependencies = [ "proc-macro2", "quote", @@ -2019,26 +2016,20 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "textwrap" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" - [[package]] name = "thiserror" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a99cb8c4b9a8ef0e7907cd3b617cc8dc04d571c4e73c8ae403d80ac160bb122" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a891860d3c8d66fec8e73ddb3765f90082374dbaaa833407b904a94f1a7eb43" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", @@ -2164,7 +2155,7 @@ version = "0.26.0" dependencies = [ "anyhow", "base64", - "clap 3.2.22", + "clap 4.0.7", "dirs 4.0.0", "env_logger", "log", @@ -2391,9 +2382,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.21.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ "autocfg", "bytes", @@ -2401,7 +2392,6 @@ dependencies = [ "memchr", "mio", "num_cpus", - "once_cell", "pin-project-lite", "socket2", "winapi", @@ -2475,8 +2465,8 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "ts-rs" -version = "6.1.2" -source = "git+https://github.com/Heliozoa/ts-rs/?rev=71bba3a18cdc5bc02c63b2772fd5324b1b07227b#71bba3a18cdc5bc02c63b2772fd5324b1b07227b" +version = "6.2.0" +source = "git+https://github.com/Heliozoa/ts-rs/?rev=f78e0c43b62266a49a227e20733aca6467970f13#f78e0c43b62266a49a227e20733aca6467970f13" dependencies = [ "thiserror", "ts-rs-macros", @@ -2484,8 +2474,8 @@ dependencies = [ [[package]] name = "ts-rs-macros" -version = "6.1.2" -source = "git+https://github.com/Heliozoa/ts-rs/?rev=71bba3a18cdc5bc02c63b2772fd5324b1b07227b#71bba3a18cdc5bc02c63b2772fd5324b1b07227b" +version = "6.2.0" +source = "git+https://github.com/Heliozoa/ts-rs/?rev=f78e0c43b62266a49a227e20733aca6467970f13#f78e0c43b62266a49a227e20733aca6467970f13" dependencies = [ "Inflector", "proc-macro2", @@ -2831,8 +2821,7 @@ checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" [[package]] name = "zip" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" +source = "git+https://github.com/zip-rs/zip.git?rev=bb230ef56adc13436d1fcdfaa489249d119c498f#bb230ef56adc13436d1fcdfaa489249d119c498f" dependencies = [ "aes", "byteorder", @@ -2850,18 +2839,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.10.2+zstd.1.5.2" +version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4a6bd64f22b5e3e94b4e238669ff9f10815c27a5180108b849d24174a83847" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "4.1.6+zstd.1.5.2" +version = "5.0.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b61c51bb270702d6167b8ce67340d2754b088d0c091b06e593aa772c3ee9bb" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" dependencies = [ "libc", "zstd-sys", @@ -2869,9 +2858,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.6.3+zstd.1.5.2" +version = "2.0.1+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" dependencies = [ "cc", "libc", diff --git a/Cargo.toml b/Cargo.toml index 76779064760..2f5388f5f7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members =[ +members = [ # core libraries "tmc-client", "tmc-langs", diff --git a/bindings/tmc-langs-node/Cargo.toml b/bindings/tmc-langs-node/Cargo.toml index 8040c98bcbf..bf40e138665 100644 --- a/bindings/tmc-langs-node/Cargo.toml +++ b/bindings/tmc-langs-node/Cargo.toml @@ -29,7 +29,7 @@ serde_json = "1.0.78" thiserror = "1.0.30" ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ "serde-compat", -], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b" } +], rev = "f78e0c43b62266a49a227e20733aca6467970f13" } [dev-dependencies] log = "0.4.14" diff --git a/plugins/csharp/Cargo.toml b/plugins/csharp/Cargo.toml index a246b3a2261..4d3f3a579a5 100644 --- a/plugins/csharp/Cargo.toml +++ b/plugins/csharp/Cargo.toml @@ -19,7 +19,7 @@ serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.78" thiserror = "1.0.30" walkdir = "2.3.2" -zip = "0.6.2" +zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 [dev-dependencies] once_cell = "1.9.0" diff --git a/plugins/java/Cargo.toml b/plugins/java/Cargo.toml index 7af06ec55f5..fe9ff6a82a6 100644 --- a/plugins/java/Cargo.toml +++ b/plugins/java/Cargo.toml @@ -27,4 +27,4 @@ walkdir = "2.3.2" [dev-dependencies] simple_logger = "2.1.0" -zip = "0.6.2" +zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 diff --git a/plugins/make/Cargo.toml b/plugins/make/Cargo.toml index 118f7b05560..490e180a69a 100644 --- a/plugins/make/Cargo.toml +++ b/plugins/make/Cargo.toml @@ -20,7 +20,7 @@ serde = { version = "1.0.136", features = ["derive"] } serde_yaml = "0.9.10" serde-xml-rs = "0.6.0" thiserror = "1.0.30" -zip = "0.6.2" +zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 [dev-dependencies] simple_logger = "2.1.0" diff --git a/plugins/notests/Cargo.toml b/plugins/notests/Cargo.toml index 8e4f6c01d4d..8206bda62d8 100644 --- a/plugins/notests/Cargo.toml +++ b/plugins/notests/Cargo.toml @@ -14,7 +14,7 @@ tmc-langs-framework = { path = "../../tmc-langs-framework" } tmc-langs-util = { path = "../../tmc-langs-util" } log = "0.4.14" -zip = "0.6.2" +zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 [dev-dependencies] simple_logger = "2.1.0" diff --git a/plugins/python3/Cargo.toml b/plugins/python3/Cargo.toml index 413d6d8ddef..25a23bd65c7 100644 --- a/plugins/python3/Cargo.toml +++ b/plugins/python3/Cargo.toml @@ -25,7 +25,7 @@ serde_json = "1.0.78" sha2 = "0.10.1" thiserror = "1.0.30" walkdir = "2.3.2" -zip = "0.6.2" +zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 [dev-dependencies] simple_logger = "2.1.0" diff --git a/plugins/r/Cargo.toml b/plugins/r/Cargo.toml index ffa5a81cf97..31af260b321 100644 --- a/plugins/r/Cargo.toml +++ b/plugins/r/Cargo.toml @@ -17,7 +17,7 @@ log = "0.4.14" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.78" thiserror = "1.0.30" -zip = "0.6.2" +zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 [dev-dependencies] simple_logger = "2.1.0" diff --git a/tmc-client/Cargo.toml b/tmc-client/Cargo.toml index f2af3709d53..056ba46c058 100644 --- a/tmc-client/Cargo.toml +++ b/tmc-client/Cargo.toml @@ -34,7 +34,7 @@ tempfile = "3.3.0" thiserror = "1.0.30" ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ "serde-compat", -], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b", optional = true } +], rev = "f78e0c43b62266a49a227e20733aca6467970f13", optional = true } url = "2.2.2" walkdir = "2.3.2" diff --git a/tmc-langs-cli/Cargo.toml b/tmc-langs-cli/Cargo.toml index 29afcc76f7e..96ecedc73cf 100644 --- a/tmc-langs-cli/Cargo.toml +++ b/tmc-langs-cli/Cargo.toml @@ -17,7 +17,7 @@ tmc-langs-util = { path = "../tmc-langs-util" } anyhow = "1.0.53" base64 = "0.13.0" -clap = { version = "3.0.14", features = ["derive"] } +clap = { version = "4.0.7", features = ["derive"] } dirs = "4.0.0" env_logger = "0.9.0" log = "0.4.14" diff --git a/tmc-langs-cli/src/app.rs b/tmc-langs-cli/src/app.rs index 56d36f34c26..a1005c6226b 100644 --- a/tmc-langs-cli/src/app.rs +++ b/tmc-langs-cli/src/app.rs @@ -286,7 +286,7 @@ pub enum Core { #[clap(long)] download_template: bool, /// Exercise id of an exercise that should be downloaded. Multiple ids can be given. - #[clap(long, multiple = true, required = true)] + #[clap(long, num_args = 1..)] exercise_id: Vec, }, @@ -388,7 +388,7 @@ pub enum Core { #[clap(long)] base64: bool, /// The email address of your TMC account. The password will be read through stdin. - #[clap(long, required_unless_present = "set-access-token")] + #[clap(long, required_unless_present = "set_access_token")] email: Option, /// The OAUTH2 access token that should be used for authentication. #[clap(long, required_unless_present = "email")] @@ -466,10 +466,10 @@ pub enum Core { #[clap(long_about = schema_leaked::())] SendFeedback { /// The ID of the submission. - #[clap(long, required_unless_present = "feedback-url")] + #[clap(long, required_unless_present = "feedback_url")] submission_id: Option, /// The feedback answer URL. - #[clap(long, required_unless_present = "submission-id")] + #[clap(long, required_unless_present = "submission_id")] feedback_url: Option, /// A feedback answer. Takes two values, a feedback answer id and the answer. Multiple feedback arguments can be given. #[clap(long, required = true, number_of_values = 2, value_names = &["feedback-answer-id, answer"])] @@ -558,6 +558,7 @@ pub enum Settings { }, } +#[derive(Clone, Copy)] pub struct Locale(pub Language); impl FromStr for Locale { diff --git a/tmc-langs-cli/src/lib.rs b/tmc-langs-cli/src/lib.rs index f018dfd8f04..ffc074c8a45 100644 --- a/tmc-langs-cli/src/lib.rs +++ b/tmc-langs-cli/src/lib.rs @@ -13,7 +13,7 @@ use self::{ use crate::app::{Locale, Opt}; use anyhow::{Context, Result}; use app::{Command, Core, Settings}; -use clap::{ErrorKind, IntoApp, Parser}; +use clap::{error::ErrorKind, CommandFactory, Parser}; use serde::Serialize; use serde_json::Value; use std::{ diff --git a/tmc-langs-framework/Cargo.toml b/tmc-langs-framework/Cargo.toml index 69b25d7d9f6..cea061c82c8 100644 --- a/tmc-langs-framework/Cargo.toml +++ b/tmc-langs-framework/Cargo.toml @@ -26,11 +26,11 @@ tar = "0.4.38" tempfile = "3.3.0" ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ "serde-compat", -], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b", optional = true } +], rev = "f78e0c43b62266a49a227e20733aca6467970f13", optional = true } thiserror = "1.0.30" walkdir = "2.3.2" -zip = "0.6.2" -zstd = "0.10.2" # zip 0.6 is still on 0.10 +zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zstd = "0.11.2" [dev-dependencies] simple_logger = "2.1.0" diff --git a/tmc-langs-plugins/Cargo.toml b/tmc-langs-plugins/Cargo.toml index 76b7c31a073..e2bf2e8b90b 100644 --- a/tmc-langs-plugins/Cargo.toml +++ b/tmc-langs-plugins/Cargo.toml @@ -25,8 +25,8 @@ log = "0.4.14" tar = "0.4.38" thiserror = "1.0.30" walkdir = "2.3.2" -zip = "0.6.2" -zstd = "0.10.2" # zip 0.6 is still on 0.10 +zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zstd = "0.11.2" [dev-dependencies] simple_logger = "2.1.0" diff --git a/tmc-langs/Cargo.toml b/tmc-langs/Cargo.toml index fcdc3b513cc..7327c9adedd 100644 --- a/tmc-langs/Cargo.toml +++ b/tmc-langs/Cargo.toml @@ -40,11 +40,11 @@ thiserror = "1.0.30" toml = "0.5.8" ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ "serde-compat", -], rev = "71bba3a18cdc5bc02c63b2772fd5324b1b07227b", optional = true } +], rev = "f78e0c43b62266a49a227e20733aca6467970f13", optional = true } url = "2.2.2" walkdir = "2.3.2" -zip = "0.6.2" -zstd = "0.10.2" # zip 0.6 is still on 0.10 +zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zstd = "0.11.2" [target.'cfg(unix)'.dependencies] nix = "0.25.0" From a6d576f43877741ee3f1635ad8c5bcb401253717 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Fri, 30 Sep 2022 18:24:29 +0300 Subject: [PATCH 04/15] Use dyn policy to clean some functions --- tmc-langs-plugins/src/archive.rs | 9 ++--- tmc-langs-plugins/src/compression.rs | 10 +++--- tmc-langs-plugins/src/lib.rs | 52 +++++----------------------- tmc-langs/src/lib.rs | 3 -- 4 files changed, 16 insertions(+), 58 deletions(-) diff --git a/tmc-langs-plugins/src/archive.rs b/tmc-langs-plugins/src/archive.rs index aec1cca9490..534c856bfe4 100644 --- a/tmc-langs-plugins/src/archive.rs +++ b/tmc-langs-plugins/src/archive.rs @@ -25,18 +25,15 @@ impl ArchiveBuilder { } } + /// Does not include any files within the directory. pub fn add_directory(&mut self, path: &str) -> Result<(), TmcError> { log::trace!("adding directory {}", path); match self { Self::Tar(builder) => { - builder - .append_dir_all(path, path) - .map_err(TmcError::TarWrite)?; + builder.append_dir(path, path).map_err(TmcError::TarWrite)?; } Self::TarZstd(_, builder) => { - builder - .append_dir_all(path, path) - .map_err(TmcError::TarWrite)?; + builder.append_dir(path, path).map_err(TmcError::TarWrite)?; } Self::Zip(builder) => { builder.add_directory(path, FileOptions::default().unix_permissions(0o755))? diff --git a/tmc-langs-plugins/src/compression.rs b/tmc-langs-plugins/src/compression.rs index 39621ce7cad..e9bbd594544 100644 --- a/tmc-langs-plugins/src/compression.rs +++ b/tmc-langs-plugins/src/compression.rs @@ -11,9 +11,9 @@ use walkdir::{DirEntry, WalkDir}; pub use zip::result::ZipError; use zip::ZipArchive; -/// Compressesthe given directory, only including student files according to the given policy. -pub fn compress_student_files( - policy: P, +/// Compresses the given directory, only including student files according to the given policy. +pub fn compress_student_files( + policy: &dyn StudentFilePolicy, root_directory: &Path, compression: Compression, ) -> Result, TmcError> { @@ -53,7 +53,7 @@ fn path_to_zip_compatible_string(path: &Path) -> String { if !string.is_empty() { string.push('/'); } - string.push_str(&*component.as_os_str().to_string_lossy()); + string.push_str(component.as_os_str().to_string_lossy().as_ref()); } string } @@ -213,7 +213,7 @@ mod test { let path = temp.path().join("exercise-name"); let zipped = compress_student_files( - EverythingIsStudentFilePolicy::new(&path).unwrap(), + &EverythingIsStudentFilePolicy::new(&path).unwrap(), &path, Compression::Zip, ) diff --git a/tmc-langs-plugins/src/lib.rs b/tmc-langs-plugins/src/lib.rs index ffd9f8f9db5..7c92ec6836e 100644 --- a/tmc-langs-plugins/src/lib.rs +++ b/tmc-langs-plugins/src/lib.rs @@ -54,56 +54,20 @@ pub fn extract_project_overwrite( Ok(()) } -/// See `LanguagePlugin::compress_project`. -// TODO: clean up +/// Compresses the directory at the given path, only including student files unless `naive` is set to true. pub fn compress_project( path: &Path, compression: Compression, naive: bool, ) -> Result, PluginError> { - if naive { - let compressed = compression.compress(path)?; - return Ok(compressed); - } + let compressed = if naive { + compression.compress(path)? + } else { + let policy = get_student_file_policy(path)?; + compression::compress_student_files(policy.as_ref(), path, compression)? + }; - match get_language_plugin_type(path) { - Some(PluginType::CSharp) => Ok(compression::compress_student_files( - ::StudentFilePolicy::new(path)?, - path, - compression, - )?), - Some(PluginType::Make) => Ok(compression::compress_student_files( - ::StudentFilePolicy::new(path)?, - path, - compression, - )?), - Some(PluginType::Maven) => Ok(compression::compress_student_files( - ::StudentFilePolicy::new(path)?, - path, - compression, - )?), - Some(PluginType::NoTests) => Ok(compression::compress_student_files( - ::StudentFilePolicy::new(path)?, - path, - compression, - )?), - Some(PluginType::Python3) => Ok(compression::compress_student_files( - ::StudentFilePolicy::new(path)?, - path, - compression, - )?), - Some(PluginType::R) => Ok(compression::compress_student_files( - ::StudentFilePolicy::new(path)?, - path, - compression, - )?), - Some(PluginType::Ant) => Ok(compression::compress_student_files( - ::StudentFilePolicy::new(path)?, - path, - compression, - )?), - None => Err(PluginError::PluginNotFound(path.to_path_buf())), - } + Ok(compressed) } pub fn get_exercise_packaging_configuration( diff --git a/tmc-langs/src/lib.rs b/tmc-langs/src/lib.rs index 4df753c768c..f23e6763347 100644 --- a/tmc-langs/src/lib.rs +++ b/tmc-langs/src/lib.rs @@ -770,9 +770,6 @@ pub fn compress_project_to( ); let data = tmc_langs_plugins::compress_project(source, compression, naive)?; - if let Some(parent) = target.parent() { - file_util::create_dir_all(parent)?; - } file_util::write_to_file(&data, target)?; Ok(()) } From 54fa636679006cbad140d362e91b790ecda82e3a Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Fri, 30 Sep 2022 18:43:31 +0300 Subject: [PATCH 05/15] Inherit from workspace Cargo.toml --- Cargo.toml | 9 +++++++++ bindings/tmc-langs-node/Cargo.toml | 11 ++++------- plugins/csharp/Cargo.toml | 11 ++++------- plugins/java/Cargo.toml | 11 ++++------- plugins/make/Cargo.toml | 11 ++++------- plugins/notests/Cargo.toml | 11 ++++------- plugins/python3/Cargo.toml | 11 ++++------- plugins/r/Cargo.toml | 11 ++++------- tmc-client/Cargo.toml | 11 ++++------- tmc-langs-cli/Cargo.toml | 11 ++++------- tmc-langs-framework/Cargo.toml | 11 ++++------- tmc-langs-plugins/Cargo.toml | 11 ++++------- tmc-langs-util/Cargo.toml | 11 ++++------- tmc-langs/Cargo.toml | 11 ++++------- tmc-server-mock/Cargo.toml | 11 ++++------- 15 files changed, 65 insertions(+), 98 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2f5388f5f7a..73a0444c6bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,12 @@ members = [ "tmc-server-mock", ] resolver = "2" + +[workspace.package] +authors = [ + "University of Helsinki ", + "Daniel Martinez ", +] +edition = "2021" +rust-version = "1.58.1" +license = "MIT OR Apache-2.0" diff --git a/bindings/tmc-langs-node/Cargo.toml b/bindings/tmc-langs-node/Cargo.toml index bf40e138665..60af327a324 100644 --- a/bindings/tmc-langs-node/Cargo.toml +++ b/bindings/tmc-langs-node/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "tmc-langs-node" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" +authors.workspace = true +edition.workspace = true description = "Bindings to the tmc-langs library for Node" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +license.workspace = true +rust-version.workspace = true exclude = ["index.node"] [lib] diff --git a/plugins/csharp/Cargo.toml b/plugins/csharp/Cargo.toml index 4d3f3a579a5..80be0039b98 100644 --- a/plugins/csharp/Cargo.toml +++ b/plugins/csharp/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-langs-csharp" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] tmc-langs-framework = { path = "../../tmc-langs-framework" } diff --git a/plugins/java/Cargo.toml b/plugins/java/Cargo.toml index fe9ff6a82a6..da000e2d101 100644 --- a/plugins/java/Cargo.toml +++ b/plugins/java/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-langs-java" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] tmc-langs-framework = { path = "../../tmc-langs-framework" } diff --git a/plugins/make/Cargo.toml b/plugins/make/Cargo.toml index 490e180a69a..d03ca248a5d 100644 --- a/plugins/make/Cargo.toml +++ b/plugins/make/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-langs-make" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] tmc-langs-framework = { path = "../../tmc-langs-framework" } diff --git a/plugins/notests/Cargo.toml b/plugins/notests/Cargo.toml index 8206bda62d8..edff773a0c4 100644 --- a/plugins/notests/Cargo.toml +++ b/plugins/notests/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-langs-notests" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] tmc-langs-framework = { path = "../../tmc-langs-framework" } diff --git a/plugins/python3/Cargo.toml b/plugins/python3/Cargo.toml index 25a23bd65c7..867e3e27433 100644 --- a/plugins/python3/Cargo.toml +++ b/plugins/python3/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-langs-python3" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] tmc-langs-framework = { path = "../../tmc-langs-framework" } diff --git a/plugins/r/Cargo.toml b/plugins/r/Cargo.toml index 31af260b321..a95b885c678 100644 --- a/plugins/r/Cargo.toml +++ b/plugins/r/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-langs-r" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] tmc-langs-framework = { path = "../../tmc-langs-framework" } diff --git a/tmc-client/Cargo.toml b/tmc-client/Cargo.toml index 056ba46c058..6a10c4e9d31 100644 --- a/tmc-client/Cargo.toml +++ b/tmc-client/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-client" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] tmc-langs-plugins = { path = "../tmc-langs-plugins" } diff --git a/tmc-langs-cli/Cargo.toml b/tmc-langs-cli/Cargo.toml index 96ecedc73cf..edce6401561 100644 --- a/tmc-langs-cli/Cargo.toml +++ b/tmc-langs-cli/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "tmc-langs-cli" version = "0.26.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" +authors.workspace = true +edition.workspace = true description = "CLI client for TMC" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +license.workspace = true +rust-version.workspace = true default-run = "tmc-langs-cli" [dependencies] diff --git a/tmc-langs-framework/Cargo.toml b/tmc-langs-framework/Cargo.toml index cea061c82c8..03b363db5e2 100644 --- a/tmc-langs-framework/Cargo.toml +++ b/tmc-langs-framework/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-langs-framework" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] tmc-langs-util = { path = "../tmc-langs-util" } diff --git a/tmc-langs-plugins/Cargo.toml b/tmc-langs-plugins/Cargo.toml index e2bf2e8b90b..4781db8a305 100644 --- a/tmc-langs-plugins/Cargo.toml +++ b/tmc-langs-plugins/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-langs-plugins" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] tmc-langs-framework = { path = "../tmc-langs-framework" } diff --git a/tmc-langs-util/Cargo.toml b/tmc-langs-util/Cargo.toml index 5131edecdcc..e5be603c52b 100644 --- a/tmc-langs-util/Cargo.toml +++ b/tmc-langs-util/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-langs-util" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] fd-lock = "3.0.3" diff --git a/tmc-langs/Cargo.toml b/tmc-langs/Cargo.toml index 7327c9adedd..e3b7695d9b6 100644 --- a/tmc-langs/Cargo.toml +++ b/tmc-langs/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-langs" version = "0.26.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] tmc-client = { path = "../tmc-client" } diff --git a/tmc-server-mock/Cargo.toml b/tmc-server-mock/Cargo.toml index 34f4fcfba2c..a88384b4b7a 100644 --- a/tmc-server-mock/Cargo.toml +++ b/tmc-server-mock/Cargo.toml @@ -1,13 +1,10 @@ [package] name = "tmc-server-mock" version = "0.1.0" -authors = [ - "University of Helsinki ", - "Daniel Martinez ", -] -edition = "2021" -license = "MIT OR Apache-2.0" -rust-version = "1.58.1" +authors.workspace = true +edition.workspace = true +license.workspace = true +rust-version.workspace = true [dependencies] serde_json = "1.0.78" From 3dab20cb5262116a27259a3ed23b8a9bc686e982 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Fri, 30 Sep 2022 18:51:58 +0300 Subject: [PATCH 06/15] Put crates in crates --- Cargo.toml | 32 ++++++++++-------- .../bindings}/tmc-langs-node/.gitignore | 0 .../bindings}/tmc-langs-node/Cargo.toml | 4 +-- .../bindings}/tmc-langs-node/README.md | 0 .../bindings}/tmc-langs-node/babel.config.js | 0 .../jest/maven-exercise/.classpath | 0 .../jest/maven-exercise/.factorypath | 0 .../jest/maven-exercise/.project | 0 .../org.eclipse.core.resources.prefs | 0 .../.settings/org.eclipse.jdt.apt.core.prefs | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.m2e.core.prefs | 0 .../jest/maven-exercise/.tmcproject.json | 0 .../jest/maven-exercise/pom.xml | 0 .../java/fi/helsinki/cs/maventest/App.java | 0 .../fi/helsinki/cs/maventest/AppTest.java | 0 .../tmc-langs-node/jest/mock_server.js | 0 .../tmc-langs-node/jest/python-exercise.zip | Bin .../bindings}/tmc-langs-node/jest/tmc.test.ts | 0 .../tmc-langs-node/package-lock.json | 0 .../bindings}/tmc-langs-node/package.json | 0 .../src/bin/generate-bindings.rs | 0 .../bindings}/tmc-langs-node/src/de.rs | 0 .../bindings}/tmc-langs-node/src/error.rs | 0 .../bindings}/tmc-langs-node/src/helpers.rs | 0 .../bindings}/tmc-langs-node/src/lib.rs | 0 .../bindings}/tmc-langs-node/src/ser.rs | 0 .../tmc-langs-node/ts/functions.d.ts | 0 .../tmc-langs-node/ts/generated.d.ts | 0 .../bindings}/tmc-langs-node/ts/tmc.ts | 0 .../bindings}/tmc-langs-node/tsconfig.json | 0 .../helpers/tmc-server-mock}/Cargo.toml | 0 .../tmc-server-mock}/python-exercise.zip | Bin .../helpers/tmc-server-mock}/src/lib.rs | 0 {plugins => crates/plugins}/csharp/Cargo.toml | 4 +-- {plugins => crates/plugins}/csharp/README.md | 0 .../csharp/deps/tmc-csharp-runner-2.0.zip | Bin .../plugins}/csharp/src/cs_test_result.rs | 0 .../plugins}/csharp/src/error.rs | 0 {plugins => crates/plugins}/csharp/src/lib.rs | 0 .../plugins}/csharp/src/plugin.rs | 0 .../plugins}/csharp/src/policy.rs | 0 .../tests/data/failing-exercise/nuget.config | 0 .../src/FailingSample/FailingSample.csproj | 0 .../src/FailingSample/Program.cs | 0 .../FailingSampleTests.csproj | 0 .../test/FailingSampleTests/ProgramTest.cs | 0 .../data/non-compiling-exercise/nuget.config | 0 .../NonCompilingSample.csproj | 0 .../src/NonCompilingSample/Program.cs | 0 .../NonCompilingSampleTests.csproj | 0 .../NonCompilingSampleTests/ProgramTest.cs | 0 .../tests/data/partially-passing/nuget.config | 0 .../src/TestProject/Program.cs | 0 .../src/TestProject/TestProject.csproj | 0 .../test/TestProjectTests/ProgramTest.cs | 0 .../TestProjectTests/TestProjectTests.csproj | 0 .../tests/data/passing-exercise/nuget.config | 0 .../src/PassingSample/PassingSample.csproj | 0 .../src/PassingSample/Program.cs | 0 .../PassingSampleTests.csproj | 0 .../test/PassingSampleTests/ProgramTest.cs | 0 {plugins => crates/plugins}/java/Cargo.toml | 4 +-- {plugins => crates/plugins}/java/README.md | 0 .../java/deps/apache-maven-3.8.1-bin.tar.gz | Bin .../j4rs-0.13.0-jar-with-dependencies.jar | Bin ...ckstyle-runner-3.0.3-20200520.064542-3.jar | Bin .../java/deps/tmc-junit-runner-0.2.8.jar | Bin .../plugins}/java/src/ant_plugin.rs | 0 .../plugins}/java/src/ant_policy.rs | 0 {plugins => crates/plugins}/java/src/error.rs | 0 .../plugins}/java/src/java_plugin.rs | 0 {plugins => crates/plugins}/java/src/lib.rs | 0 .../plugins}/java/src/maven_plugin.rs | 0 .../plugins}/java/src/maven_policy.rs | 0 .../tests/data/ant-exercise/.tmcproject.json | 0 .../java/tests/data/ant-exercise/build.xml | 0 .../ant-exercise/lib/edu-test-utils-0.4.1.jar | Bin .../data/ant-exercise/lib/junit-4.10.jar | Bin .../ant-exercise/nbproject/build-impl.xml | 0 .../nbproject/genfiles.properties | 0 .../ant-exercise/nbproject/project.properties | 0 .../data/ant-exercise/nbproject/project.xml | 0 .../tests/data/ant-exercise/src/Arith.java | 0 .../data/ant-exercise/test/ArithTest.java | 0 .../java/tests/data/maven-exercise/.classpath | 0 .../tests/data/maven-exercise/.factorypath | 0 .../java/tests/data/maven-exercise/.project | 0 .../org.eclipse.core.resources.prefs | 0 .../.settings/org.eclipse.jdt.apt.core.prefs | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.m2e.core.prefs | 0 .../data/maven-exercise/.tmcproject.json | 0 .../java/tests/data/maven-exercise/pom.xml | 0 .../java/fi/helsinki/cs/maventest/App.java | 0 .../fi/helsinki/cs/maventest/AppTest.java | 0 {plugins => crates/plugins}/make/Cargo.toml | 4 +-- {plugins => crates/plugins}/make/README.md | 0 .../plugins}/make/src/check_log.rs | 0 {plugins => crates/plugins}/make/src/error.rs | 0 {plugins => crates/plugins}/make/src/lib.rs | 0 .../plugins}/make/src/plugin.rs | 0 .../plugins}/make/src/policy.rs | 0 .../plugins}/make/src/valgrind_log.rs | 0 .../make/tests/data/failing-exercise/Makefile | 0 .../tests/data/failing-exercise/src/Makefile | 0 .../tests/data/failing-exercise/src/main.c | 0 .../tests/data/failing-exercise/src/source.c | 0 .../tests/data/failing-exercise/src/source.h | 0 .../tests/data/failing-exercise/test/Makefile | 0 .../data/failing-exercise/test/checkhelp.c | 0 .../data/failing-exercise/test/test_source.c | 0 .../data/failing-exercise/test/tmc-check.c | 0 .../data/failing-exercise/test/tmc-check.h | 0 .../make/tests/data/passing-exercise/Makefile | 0 .../tests/data/passing-exercise/src/Makefile | 0 .../tests/data/passing-exercise/src/main.c | 0 .../tests/data/passing-exercise/src/source.c | 0 .../tests/data/passing-exercise/src/source.h | 0 .../tests/data/passing-exercise/test/Makefile | 0 .../data/passing-exercise/test/checkhelp.c | 0 .../tests/data/passing-exercise/test/test | Bin .../data/passing-exercise/test/test_source.c | 0 .../data/passing-exercise/test/tmc-check.c | 0 .../data/passing-exercise/test/tmc-check.h | 0 .../test/tmc_available_points.txt | 0 .../test/tmc_test_results.xml | 0 .../data/valgrind-failing-exercise/Makefile | 0 .../valgrind-failing-exercise/src/Makefile | 0 .../data/valgrind-failing-exercise/src/main.c | 0 .../valgrind-failing-exercise/src/source.c | 0 .../valgrind-failing-exercise/src/source.h | 0 .../valgrind-failing-exercise/test/Makefile | 0 .../test/checkhelp.c | 0 .../data/valgrind-failing-exercise/test/test | Bin .../test/test_source.c | 0 .../test/tmc-check.c | 0 .../test/tmc-check.h | 0 .../test/tmc_available_points.txt | 0 .../test/tmc_test_results.xml | 0 .../plugins}/notests/Cargo.toml | 4 +-- {plugins => crates/plugins}/notests/README.md | 0 .../plugins}/notests/src/lib.rs | 0 .../plugins}/notests/src/plugin.rs | 0 .../plugins}/notests/src/policy.rs | 0 .../plugins}/python3/Cargo.toml | 4 +-- {plugins => crates/plugins}/python3/README.md | 0 .../plugins}/python3/src/error.rs | 0 .../plugins}/python3/src/lib.rs | 0 .../plugins}/python3/src/plugin.rs | 0 .../plugins}/python3/src/policy.rs | 0 .../python3/src/python_test_result.rs | 0 .../plugins}/python3/tests/data/tmc/UPDATED | 0 .../python3/tests/data/tmc/__init__.py | 0 .../python3/tests/data/tmc/__main__.py | 0 .../plugins}/python3/tests/data/tmc/django.py | 0 .../python3/tests/data/tmc/hmac_writer.py | 0 .../plugins}/python3/tests/data/tmc/points.py | 0 .../python3/tests/data/tmc/reflect.py | 0 .../plugins}/python3/tests/data/tmc/result.py | 0 .../plugins}/python3/tests/data/tmc/runner.py | 0 .../plugins}/python3/tests/data/tmc/utils.py | 0 {plugins => crates/plugins}/r/Cargo.toml | 4 +-- {plugins => crates/plugins}/r/README.md | 0 {plugins => crates/plugins}/r/src/error.rs | 0 {plugins => crates/plugins}/r/src/lib.rs | 0 {plugins => crates/plugins}/r/src/plugin.rs | 0 {plugins => crates/plugins}/r/src/policy.rs | 0 .../plugins}/r/src/r_run_result.rs | 0 .../r/tests/tmcRtestrunner/.Rbuildignore | 0 .../plugins}/r/tests/tmcRtestrunner/.lintr | 0 .../r/tests/tmcRtestrunner/DESCRIPTION | 0 .../plugins}/r/tests/tmcRtestrunner/NAMESPACE | 0 .../tmcRtestrunner/R/GetAvailablePoints.R | 0 .../r/tests/tmcRtestrunner/R/ResultsCreator.R | 0 .../tmcRtestrunner/R/ResultsJsonParser.R | 0 .../r/tests/tmcRtestrunner/R/RunTests.R | 0 .../tests/tmcRtestrunner/R/TestEnvironment.R | 0 .../plugins}/r/tests/tmcRtestrunner/UPDATED | 0 .../tests/tmcRtestrunner/man/file_encoding.Rd | 0 .../man/run_available_points.Rd | 0 .../r/tests/tmcRtestrunner/man/run_tests.Rd | 0 .../r/tests/tmcRtestrunner/tests/testthat.R | 0 .../tests/testthat/helperFunctions.R | 0 .../resources/simple_all_tests_fail/R/main.R | 0 .../simple_all_tests_fail.Rproj | 0 .../tests/testthat/testMain.R | 0 .../resources/simple_all_tests_pass/R/main.R | 0 .../simple_all_tests_pass/R/second.R | 0 .../simple_all_tests_pass.Rproj | 0 .../tests/testthat/testMain.R | 0 .../tests/testthat/testSecond.R | 0 .../simple_all_tests_pass_with_plot/R/main.R | 0 .../simple_sourcing_fail.Rproj | 0 .../tests/testthat/mock.R | 0 .../tests/testthat/testMain.R | 0 .../resources/simple_run_fail/R/main.R | 0 .../simple_run_fail/simple_run_fail.Rproj | 0 .../simple_run_fail/tests/testthat/testMain.R | 0 .../resources/simple_some_tests_fail/R/main.R | 0 .../simple_some_tests_fail.Rproj | 0 .../tests/testthat/testMain.R | 0 .../resources/simple_sourcing_fail/R/main.R | 0 .../simple_sourcing_fail.Rproj | 0 .../tests/testthat/testMain.R | 0 .../tests/testthat/testGetAvailablePoints.R | 0 .../tests/testthat/testResultsCreator.R | 0 .../tests/testthat/testRunTests.R | 0 .../tests/testthat/testTestEnvironment.R | 0 .../tests/tmcRtestrunner/tmcRtestrunner.Rproj | 0 {tmc-client => crates/tmc-client}/.gitignore | 0 {tmc-client => crates/tmc-client}/Cargo.toml | 4 +-- {tmc-client => crates/tmc-client}/README.md | 0 .../tmc-client}/src/error.rs | 0 {tmc-client => crates/tmc-client}/src/lib.rs | 0 .../tmc-client}/src/request.rs | 0 .../tmc-client}/src/response.rs | 0 .../tmc-client}/src/tmc_client.rs | 0 .../tmc-client}/src/tmc_client/api_v8.rs | 0 .../tmc-client}/tests/api_integration.rs | 0 .../tests/data/part01-Part01_01.Sandbox.zip | Bin .../tmc-langs-cli}/.gitignore | 0 .../tmc-langs-cli}/Cargo.toml | 4 +-- .../tmc-langs-cli}/README.md | 0 .../api/output-data-download-or-update.json | 0 .../tmc-langs-cli}/api/output-data-error.json | 0 .../tmc-langs-cli}/api/output-data-none.json | 0 .../tmc-langs-cli}/api/status-update.json | 0 .../tmc-langs-cli}/api/warnings.json | 0 .../tmc-langs-cli}/src/app.rs | 0 .../tmc-langs-cli}/src/error.rs | 0 .../tmc-langs-cli}/src/lib.rs | 0 .../tmc-langs-cli}/src/main.rs | 0 .../tmc-langs-cli}/src/output.rs | 0 .../tmc-langs-framework}/Cargo.toml | 2 +- .../tmc-langs-framework}/README.md | 0 .../tmc-langs-framework}/src/archive.rs | 0 .../tmc-langs-framework}/src/command.rs | 0 .../tmc-langs-framework}/src/domain.rs | 0 .../tmc-langs-framework}/src/error.rs | 0 .../tmc-langs-framework}/src/lib.rs | 0 .../tmc-langs-framework}/src/meta_syntax.rs | 0 .../tmc-langs-framework}/src/plugin.rs | 0 .../tmc-langs-framework}/src/policy.rs | 0 .../src/tmc_project_yml.rs | 0 .../tmc-langs-plugins}/Cargo.toml | 16 ++++----- .../tmc-langs-plugins}/README.md | 0 .../tmc-langs-plugins}/src/archive.rs | 0 .../tmc-langs-plugins}/src/compression.rs | 0 .../tmc-langs-plugins}/src/error.rs | 0 .../tmc-langs-plugins}/src/lib.rs | 0 .../tests/data/zip/compressed.zip | Bin .../tests/data/zip/course-module-trivial.zip | Bin .../tests/data/zip/exercise-name/.project | 0 .../data/zip/exercise-name/.tmcproject.yml | 0 .../tests/data/zip/exercise-name/pom.xml | 0 .../src/main/java/AdaLovelace.java | 0 .../src/test/java/AdaLovelaceTest.java | 0 .../target/classes/AdaLovelace.class | Bin .../compile/default-compile/createdFiles.lst | 0 .../compile/default-compile/inputFiles.lst | 0 .../default-testCompile/createdFiles.lst | 0 .../default-testCompile/inputFiles.lst | 0 .../data/zip/exercise-name/target/stderr.txt | 0 .../data/zip/exercise-name/target/stdout.txt | 0 .../target/test-classes/AdaLovelaceTest.class | Bin .../tests/data/zip/module-trivial.zip | Bin .../tests/data/zip/module-trivial/.gitignore | 0 .../tests/data/zip/module-trivial/build.xml | 0 .../lib/edu-test-utils-0.4.1.jar | Bin .../zip/module-trivial/lib/junit-4.10.jar | Bin .../tests/data/zip/module-trivial/manifest.mf | 0 .../module-trivial/nbproject/build-impl.xml | 0 .../nbproject/genfiles.properties | 0 .../nbproject/project.properties | 0 .../zip/module-trivial/nbproject/project.xml | 0 .../data/zip/module-trivial/src/.gitkeep | 0 .../data/zip/module-trivial/src/Trivial.java | 0 .../data/zip/module-trivial/test/.gitkeep | 0 .../zip/module-trivial/test/TrivialTest.java | 0 .../tests/data/zip/no-src-entry.zip | Bin .../tmc-langs-util}/Cargo.toml | 0 .../tmc-langs-util}/README.md | 0 .../tmc-langs-util}/src/deserialize.rs | 0 .../tmc-langs-util}/src/error.rs | 0 .../tmc-langs-util}/src/file_util.rs | 0 .../src/file_util/lock_unix.rs | 0 .../src/file_util/lock_windows.rs | 0 .../tmc-langs-util}/src/lib.rs | 0 .../src/notification_reporter.rs | 0 .../tmc-langs-util}/src/parse_util.rs | 0 .../tmc-langs-util}/src/path_util.rs | 0 .../tmc-langs-util}/src/progress_reporter.rs | 0 {tmc-langs => crates/tmc-langs}/Cargo.toml | 8 ++--- {tmc-langs => crates/tmc-langs}/README.md | 0 {tmc-langs => crates/tmc-langs}/src/config.rs | 0 .../tmc-langs}/src/config/credentials.rs | 0 .../tmc-langs}/src/config/projects_config.rs | 0 .../tmc-langs}/src/config/tmc_config.rs | 0 .../tmc-langs}/src/course_refresher.rs | 0 {tmc-langs => crates/tmc-langs}/src/data.rs | 0 {tmc-langs => crates/tmc-langs}/src/error.rs | 0 {tmc-langs => crates/tmc-langs}/src/lib.rs | 0 .../tmc-langs}/src/submission_packaging.rs | 0 .../tmc-langs}/src/submission_processing.rs | 0 .../tmc-langs}/tests/data/MakeExercise.zip | Bin .../tmc-langs}/tests/data/MavenExercise.zip | Bin .../tmc-langs}/tests/data/MavenStub.zip | Bin .../tmc-langs}/tests/data/PythonExercise.zip | Bin .../data/some_course/MakeExercise/Makefile | 0 .../some_course/MakeExercise/src/Makefile | 0 .../data/some_course/MakeExercise/src/main.c | 0 .../some_course/MakeExercise/src/source.c | 0 .../some_course/MakeExercise/src/source.h | 0 .../some_course/MakeExercise/test/Makefile | 0 .../some_course/MakeExercise/test/checkhelp.c | 0 .../data/some_course/MakeExercise/test/test | Bin .../MakeExercise/test/test_source.c | 0 .../some_course/MakeExercise/test/tmc-check.c | 0 .../some_course/MakeExercise/test/tmc-check.h | 0 .../test/tmc_available_points.txt | 0 .../MakeExercise/test/tmc_test_results.xml | 0 .../data/some_course/MavenExercise/.classpath | 0 .../org.eclipse.core.resources.prefs | 0 .../.settings/org.eclipse.jdt.apt.core.prefs | 0 .../.settings/org.eclipse.jdt.core.prefs | 0 .../.settings/org.eclipse.m2e.core.prefs | 0 .../MavenExercise/__MACOSX/some mac file | 0 .../some_course/MavenExercise/desktop.ini | 0 .../data/some_course/MavenExercise/pom.xml | 0 .../src/main/java/SimpleStuff.java | 0 .../src/test/java/SimpleHiddenTest.java | 0 .../src/test/java/SimpleTest.java | 0 .../some_course/PythonExercise/__init__.py | 0 .../PythonExercise/src/__init__.py | 0 .../PythonExercise/src/__main__.py | 0 .../some_course/PythonExercise/src/greeter.py | 0 .../PythonExercise/src/lastiruuma.py | 0 .../PythonExercise/src/matkalaukku.py | 0 .../some_course/PythonExercise/src/tavara.py | 0 .../PythonExercise/test/__init__.py | 0 .../PythonExercise/test/test_greeter.py | 0 .../PythonExercise/test/test_lastiruuma.py | 0 .../PythonExercise/test/test_matkalaukku.py | 0 .../PythonExercise/test/test_tavara.py | 0 .../PythonExercise/tmc/__init__.py | 0 .../PythonExercise/tmc/__main__.py | 0 .../tmc/__pycache__/__init__.cpython-38.pyc | Bin .../tmc/__pycache__/__main__.cpython-38.pyc | Bin .../tmc/__pycache__/points.cpython-38.pyc | Bin .../tmc/__pycache__/result.cpython-38.pyc | Bin .../tmc/__pycache__/runner.cpython-38.pyc | Bin .../some_course/PythonExercise/tmc/points.py | 0 .../some_course/PythonExercise/tmc/result.py | 0 .../some_course/PythonExercise/tmc/runner.py | 0 .../some_course/PythonExercise/tmc/utils.py | 0 356 files changed, 49 insertions(+), 45 deletions(-) rename {bindings => crates/bindings}/tmc-langs-node/.gitignore (100%) rename {bindings => crates/bindings}/tmc-langs-node/Cargo.toml (86%) rename {bindings => crates/bindings}/tmc-langs-node/README.md (100%) rename {bindings => crates/bindings}/tmc-langs-node/babel.config.js (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/.classpath (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/.factorypath (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/.project (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.core.resources.prefs (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.jdt.apt.core.prefs (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.jdt.core.prefs (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.m2e.core.prefs (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/.tmcproject.json (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/pom.xml (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/src/main/java/fi/helsinki/cs/maventest/App.java (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/maven-exercise/src/test/java/fi/helsinki/cs/maventest/AppTest.java (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/mock_server.js (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/python-exercise.zip (100%) rename {bindings => crates/bindings}/tmc-langs-node/jest/tmc.test.ts (100%) rename {bindings => crates/bindings}/tmc-langs-node/package-lock.json (100%) rename {bindings => crates/bindings}/tmc-langs-node/package.json (100%) rename {bindings => crates/bindings}/tmc-langs-node/src/bin/generate-bindings.rs (100%) rename {bindings => crates/bindings}/tmc-langs-node/src/de.rs (100%) rename {bindings => crates/bindings}/tmc-langs-node/src/error.rs (100%) rename {bindings => crates/bindings}/tmc-langs-node/src/helpers.rs (100%) rename {bindings => crates/bindings}/tmc-langs-node/src/lib.rs (100%) rename {bindings => crates/bindings}/tmc-langs-node/src/ser.rs (100%) rename {bindings => crates/bindings}/tmc-langs-node/ts/functions.d.ts (100%) rename {bindings => crates/bindings}/tmc-langs-node/ts/generated.d.ts (100%) rename {bindings => crates/bindings}/tmc-langs-node/ts/tmc.ts (100%) rename {bindings => crates/bindings}/tmc-langs-node/tsconfig.json (100%) rename {tmc-server-mock => crates/helpers/tmc-server-mock}/Cargo.toml (100%) rename {tmc-server-mock => crates/helpers/tmc-server-mock}/python-exercise.zip (100%) rename {tmc-server-mock => crates/helpers/tmc-server-mock}/src/lib.rs (100%) rename {plugins => crates/plugins}/csharp/Cargo.toml (83%) rename {plugins => crates/plugins}/csharp/README.md (100%) rename {plugins => crates/plugins}/csharp/deps/tmc-csharp-runner-2.0.zip (100%) rename {plugins => crates/plugins}/csharp/src/cs_test_result.rs (100%) rename {plugins => crates/plugins}/csharp/src/error.rs (100%) rename {plugins => crates/plugins}/csharp/src/lib.rs (100%) rename {plugins => crates/plugins}/csharp/src/plugin.rs (100%) rename {plugins => crates/plugins}/csharp/src/policy.rs (100%) rename {plugins => crates/plugins}/csharp/tests/data/failing-exercise/nuget.config (100%) rename {plugins => crates/plugins}/csharp/tests/data/failing-exercise/src/FailingSample/FailingSample.csproj (100%) rename {plugins => crates/plugins}/csharp/tests/data/failing-exercise/src/FailingSample/Program.cs (100%) rename {plugins => crates/plugins}/csharp/tests/data/failing-exercise/test/FailingSampleTests/FailingSampleTests.csproj (100%) rename {plugins => crates/plugins}/csharp/tests/data/failing-exercise/test/FailingSampleTests/ProgramTest.cs (100%) rename {plugins => crates/plugins}/csharp/tests/data/non-compiling-exercise/nuget.config (100%) rename {plugins => crates/plugins}/csharp/tests/data/non-compiling-exercise/src/NonCompilingSample/NonCompilingSample.csproj (100%) rename {plugins => crates/plugins}/csharp/tests/data/non-compiling-exercise/src/NonCompilingSample/Program.cs (100%) rename {plugins => crates/plugins}/csharp/tests/data/non-compiling-exercise/test/NonCompilingSampleTests/NonCompilingSampleTests.csproj (100%) rename {plugins => crates/plugins}/csharp/tests/data/non-compiling-exercise/test/NonCompilingSampleTests/ProgramTest.cs (100%) rename {plugins => crates/plugins}/csharp/tests/data/partially-passing/nuget.config (100%) rename {plugins => crates/plugins}/csharp/tests/data/partially-passing/src/TestProject/Program.cs (100%) rename {plugins => crates/plugins}/csharp/tests/data/partially-passing/src/TestProject/TestProject.csproj (100%) rename {plugins => crates/plugins}/csharp/tests/data/partially-passing/test/TestProjectTests/ProgramTest.cs (100%) rename {plugins => crates/plugins}/csharp/tests/data/partially-passing/test/TestProjectTests/TestProjectTests.csproj (100%) rename {plugins => crates/plugins}/csharp/tests/data/passing-exercise/nuget.config (100%) rename {plugins => crates/plugins}/csharp/tests/data/passing-exercise/src/PassingSample/PassingSample.csproj (100%) rename {plugins => crates/plugins}/csharp/tests/data/passing-exercise/src/PassingSample/Program.cs (100%) rename {plugins => crates/plugins}/csharp/tests/data/passing-exercise/test/PassingSampleTests/PassingSampleTests.csproj (100%) rename {plugins => crates/plugins}/csharp/tests/data/passing-exercise/test/PassingSampleTests/ProgramTest.cs (100%) rename {plugins => crates/plugins}/java/Cargo.toml (86%) rename {plugins => crates/plugins}/java/README.md (100%) rename {plugins => crates/plugins}/java/deps/apache-maven-3.8.1-bin.tar.gz (100%) rename {plugins => crates/plugins}/java/deps/j4rs-0.13.0-jar-with-dependencies.jar (100%) rename {plugins => crates/plugins}/java/deps/tmc-checkstyle-runner-3.0.3-20200520.064542-3.jar (100%) rename {plugins => crates/plugins}/java/deps/tmc-junit-runner-0.2.8.jar (100%) rename {plugins => crates/plugins}/java/src/ant_plugin.rs (100%) rename {plugins => crates/plugins}/java/src/ant_policy.rs (100%) rename {plugins => crates/plugins}/java/src/error.rs (100%) rename {plugins => crates/plugins}/java/src/java_plugin.rs (100%) rename {plugins => crates/plugins}/java/src/lib.rs (100%) rename {plugins => crates/plugins}/java/src/maven_plugin.rs (100%) rename {plugins => crates/plugins}/java/src/maven_policy.rs (100%) rename {plugins => crates/plugins}/java/tests/data/ant-exercise/.tmcproject.json (100%) rename {plugins => crates/plugins}/java/tests/data/ant-exercise/build.xml (100%) rename {plugins => crates/plugins}/java/tests/data/ant-exercise/lib/edu-test-utils-0.4.1.jar (100%) rename {plugins => crates/plugins}/java/tests/data/ant-exercise/lib/junit-4.10.jar (100%) rename {plugins => crates/plugins}/java/tests/data/ant-exercise/nbproject/build-impl.xml (100%) rename {plugins => crates/plugins}/java/tests/data/ant-exercise/nbproject/genfiles.properties (100%) rename {plugins => crates/plugins}/java/tests/data/ant-exercise/nbproject/project.properties (100%) rename {plugins => crates/plugins}/java/tests/data/ant-exercise/nbproject/project.xml (100%) rename {plugins => crates/plugins}/java/tests/data/ant-exercise/src/Arith.java (100%) rename {plugins => crates/plugins}/java/tests/data/ant-exercise/test/ArithTest.java (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/.classpath (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/.factorypath (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/.project (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/.settings/org.eclipse.core.resources.prefs (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/.settings/org.eclipse.jdt.apt.core.prefs (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/.settings/org.eclipse.jdt.core.prefs (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/.settings/org.eclipse.m2e.core.prefs (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/.tmcproject.json (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/pom.xml (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/src/main/java/fi/helsinki/cs/maventest/App.java (100%) rename {plugins => crates/plugins}/java/tests/data/maven-exercise/src/test/java/fi/helsinki/cs/maventest/AppTest.java (100%) rename {plugins => crates/plugins}/make/Cargo.toml (84%) rename {plugins => crates/plugins}/make/README.md (100%) rename {plugins => crates/plugins}/make/src/check_log.rs (100%) rename {plugins => crates/plugins}/make/src/error.rs (100%) rename {plugins => crates/plugins}/make/src/lib.rs (100%) rename {plugins => crates/plugins}/make/src/plugin.rs (100%) rename {plugins => crates/plugins}/make/src/policy.rs (100%) rename {plugins => crates/plugins}/make/src/valgrind_log.rs (100%) rename {plugins => crates/plugins}/make/tests/data/failing-exercise/Makefile (100%) rename {plugins => crates/plugins}/make/tests/data/failing-exercise/src/Makefile (100%) rename {plugins => crates/plugins}/make/tests/data/failing-exercise/src/main.c (100%) rename {plugins => crates/plugins}/make/tests/data/failing-exercise/src/source.c (100%) rename {plugins => crates/plugins}/make/tests/data/failing-exercise/src/source.h (100%) rename {plugins => crates/plugins}/make/tests/data/failing-exercise/test/Makefile (100%) rename {plugins => crates/plugins}/make/tests/data/failing-exercise/test/checkhelp.c (100%) rename {plugins => crates/plugins}/make/tests/data/failing-exercise/test/test_source.c (100%) rename {plugins => crates/plugins}/make/tests/data/failing-exercise/test/tmc-check.c (100%) rename {plugins => crates/plugins}/make/tests/data/failing-exercise/test/tmc-check.h (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/Makefile (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/src/Makefile (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/src/main.c (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/src/source.c (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/src/source.h (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/test/Makefile (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/test/checkhelp.c (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/test/test (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/test/test_source.c (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/test/tmc-check.c (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/test/tmc-check.h (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/test/tmc_available_points.txt (100%) rename {plugins => crates/plugins}/make/tests/data/passing-exercise/test/tmc_test_results.xml (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/Makefile (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/src/Makefile (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/src/main.c (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/src/source.c (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/src/source.h (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/test/Makefile (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/test/checkhelp.c (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/test/test (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/test/test_source.c (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/test/tmc-check.c (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/test/tmc-check.h (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/test/tmc_available_points.txt (100%) rename {plugins => crates/plugins}/make/tests/data/valgrind-failing-exercise/test/tmc_test_results.xml (100%) rename {plugins => crates/plugins}/notests/Cargo.toml (78%) rename {plugins => crates/plugins}/notests/README.md (100%) rename {plugins => crates/plugins}/notests/src/lib.rs (100%) rename {plugins => crates/plugins}/notests/src/plugin.rs (100%) rename {plugins => crates/plugins}/notests/src/policy.rs (100%) rename {plugins => crates/plugins}/python3/Cargo.toml (84%) rename {plugins => crates/plugins}/python3/README.md (100%) rename {plugins => crates/plugins}/python3/src/error.rs (100%) rename {plugins => crates/plugins}/python3/src/lib.rs (100%) rename {plugins => crates/plugins}/python3/src/plugin.rs (100%) rename {plugins => crates/plugins}/python3/src/policy.rs (100%) rename {plugins => crates/plugins}/python3/src/python_test_result.rs (100%) rename {plugins => crates/plugins}/python3/tests/data/tmc/UPDATED (100%) rename {plugins => crates/plugins}/python3/tests/data/tmc/__init__.py (100%) rename {plugins => crates/plugins}/python3/tests/data/tmc/__main__.py (100%) rename {plugins => crates/plugins}/python3/tests/data/tmc/django.py (100%) rename {plugins => crates/plugins}/python3/tests/data/tmc/hmac_writer.py (100%) rename {plugins => crates/plugins}/python3/tests/data/tmc/points.py (100%) rename {plugins => crates/plugins}/python3/tests/data/tmc/reflect.py (100%) rename {plugins => crates/plugins}/python3/tests/data/tmc/result.py (100%) rename {plugins => crates/plugins}/python3/tests/data/tmc/runner.py (100%) rename {plugins => crates/plugins}/python3/tests/data/tmc/utils.py (100%) rename {plugins => crates/plugins}/r/Cargo.toml (82%) rename {plugins => crates/plugins}/r/README.md (100%) rename {plugins => crates/plugins}/r/src/error.rs (100%) rename {plugins => crates/plugins}/r/src/lib.rs (100%) rename {plugins => crates/plugins}/r/src/plugin.rs (100%) rename {plugins => crates/plugins}/r/src/policy.rs (100%) rename {plugins => crates/plugins}/r/src/r_run_result.rs (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/.Rbuildignore (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/.lintr (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/DESCRIPTION (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/NAMESPACE (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/R/GetAvailablePoints.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/R/ResultsCreator.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/R/ResultsJsonParser.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/R/RunTests.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/R/TestEnvironment.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/UPDATED (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/man/file_encoding.Rd (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/man/run_available_points.Rd (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/man/run_tests.Rd (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/helperFunctions.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/R/main.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/simple_all_tests_fail.Rproj (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/tests/testthat/testMain.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/R/main.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/R/second.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/simple_all_tests_pass.Rproj (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/tests/testthat/testMain.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/tests/testthat/testSecond.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/R/main.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/simple_sourcing_fail.Rproj (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/tests/testthat/mock.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/tests/testthat/testMain.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/R/main.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/simple_run_fail.Rproj (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/tests/testthat/testMain.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/R/main.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/simple_some_tests_fail.Rproj (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/tests/testthat/testMain.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/R/main.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/simple_sourcing_fail.Rproj (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/tests/testthat/testMain.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/testGetAvailablePoints.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/testResultsCreator.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/testRunTests.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tests/testthat/testTestEnvironment.R (100%) rename {plugins => crates/plugins}/r/tests/tmcRtestrunner/tmcRtestrunner.Rproj (100%) rename {tmc-client => crates/tmc-client}/.gitignore (100%) rename {tmc-client => crates/tmc-client}/Cargo.toml (90%) rename {tmc-client => crates/tmc-client}/README.md (100%) rename {tmc-client => crates/tmc-client}/src/error.rs (100%) rename {tmc-client => crates/tmc-client}/src/lib.rs (100%) rename {tmc-client => crates/tmc-client}/src/request.rs (100%) rename {tmc-client => crates/tmc-client}/src/response.rs (100%) rename {tmc-client => crates/tmc-client}/src/tmc_client.rs (100%) rename {tmc-client => crates/tmc-client}/src/tmc_client/api_v8.rs (100%) rename {tmc-client => crates/tmc-client}/tests/api_integration.rs (100%) rename {tmc-client => crates/tmc-client}/tests/data/part01-Part01_01.Sandbox.zip (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/.gitignore (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/Cargo.toml (88%) rename {tmc-langs-cli => crates/tmc-langs-cli}/README.md (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/api/output-data-download-or-update.json (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/api/output-data-error.json (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/api/output-data-none.json (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/api/status-update.json (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/api/warnings.json (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/src/app.rs (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/src/error.rs (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/src/lib.rs (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/src/main.rs (100%) rename {tmc-langs-cli => crates/tmc-langs-cli}/src/output.rs (100%) rename {tmc-langs-framework => crates/tmc-langs-framework}/Cargo.toml (95%) rename {tmc-langs-framework => crates/tmc-langs-framework}/README.md (100%) rename {tmc-langs-framework => crates/tmc-langs-framework}/src/archive.rs (100%) rename {tmc-langs-framework => crates/tmc-langs-framework}/src/command.rs (100%) rename {tmc-langs-framework => crates/tmc-langs-framework}/src/domain.rs (100%) rename {tmc-langs-framework => crates/tmc-langs-framework}/src/error.rs (100%) rename {tmc-langs-framework => crates/tmc-langs-framework}/src/lib.rs (100%) rename {tmc-langs-framework => crates/tmc-langs-framework}/src/meta_syntax.rs (100%) rename {tmc-langs-framework => crates/tmc-langs-framework}/src/plugin.rs (100%) rename {tmc-langs-framework => crates/tmc-langs-framework}/src/policy.rs (100%) rename {tmc-langs-framework => crates/tmc-langs-framework}/src/tmc_project_yml.rs (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/Cargo.toml (56%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/README.md (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/src/archive.rs (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/src/compression.rs (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/src/error.rs (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/src/lib.rs (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/compressed.zip (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/course-module-trivial.zip (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/.project (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/.tmcproject.yml (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/pom.xml (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/src/main/java/AdaLovelace.java (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/src/test/java/AdaLovelaceTest.java (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/target/classes/AdaLovelace.class (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/target/stderr.txt (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/target/stdout.txt (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/exercise-name/target/test-classes/AdaLovelaceTest.class (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial.zip (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/.gitignore (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/build.xml (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/lib/edu-test-utils-0.4.1.jar (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/lib/junit-4.10.jar (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/manifest.mf (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/nbproject/build-impl.xml (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/nbproject/genfiles.properties (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/nbproject/project.properties (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/nbproject/project.xml (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/src/.gitkeep (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/src/Trivial.java (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/test/.gitkeep (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/module-trivial/test/TrivialTest.java (100%) rename {tmc-langs-plugins => crates/tmc-langs-plugins}/tests/data/zip/no-src-entry.zip (100%) rename {tmc-langs-util => crates/tmc-langs-util}/Cargo.toml (100%) rename {tmc-langs-util => crates/tmc-langs-util}/README.md (100%) rename {tmc-langs-util => crates/tmc-langs-util}/src/deserialize.rs (100%) rename {tmc-langs-util => crates/tmc-langs-util}/src/error.rs (100%) rename {tmc-langs-util => crates/tmc-langs-util}/src/file_util.rs (100%) rename {tmc-langs-util => crates/tmc-langs-util}/src/file_util/lock_unix.rs (100%) rename {tmc-langs-util => crates/tmc-langs-util}/src/file_util/lock_windows.rs (100%) rename {tmc-langs-util => crates/tmc-langs-util}/src/lib.rs (100%) rename {tmc-langs-util => crates/tmc-langs-util}/src/notification_reporter.rs (100%) rename {tmc-langs-util => crates/tmc-langs-util}/src/parse_util.rs (100%) rename {tmc-langs-util => crates/tmc-langs-util}/src/path_util.rs (100%) rename {tmc-langs-util => crates/tmc-langs-util}/src/progress_reporter.rs (100%) rename {tmc-langs => crates/tmc-langs}/Cargo.toml (86%) rename {tmc-langs => crates/tmc-langs}/README.md (100%) rename {tmc-langs => crates/tmc-langs}/src/config.rs (100%) rename {tmc-langs => crates/tmc-langs}/src/config/credentials.rs (100%) rename {tmc-langs => crates/tmc-langs}/src/config/projects_config.rs (100%) rename {tmc-langs => crates/tmc-langs}/src/config/tmc_config.rs (100%) rename {tmc-langs => crates/tmc-langs}/src/course_refresher.rs (100%) rename {tmc-langs => crates/tmc-langs}/src/data.rs (100%) rename {tmc-langs => crates/tmc-langs}/src/error.rs (100%) rename {tmc-langs => crates/tmc-langs}/src/lib.rs (100%) rename {tmc-langs => crates/tmc-langs}/src/submission_packaging.rs (100%) rename {tmc-langs => crates/tmc-langs}/src/submission_processing.rs (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/MakeExercise.zip (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/MavenExercise.zip (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/MavenStub.zip (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/PythonExercise.zip (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/Makefile (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/src/Makefile (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/src/main.c (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/src/source.c (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/src/source.h (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/test/Makefile (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/test/checkhelp.c (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/test/test (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/test/test_source.c (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/test/tmc-check.c (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/test/tmc-check.h (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/test/tmc_available_points.txt (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MakeExercise/test/tmc_test_results.xml (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/.classpath (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/.settings/org.eclipse.core.resources.prefs (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/.settings/org.eclipse.jdt.apt.core.prefs (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/.settings/org.eclipse.jdt.core.prefs (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/.settings/org.eclipse.m2e.core.prefs (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/__MACOSX/some mac file (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/desktop.ini (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/pom.xml (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/src/main/java/SimpleStuff.java (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/src/test/java/SimpleHiddenTest.java (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/MavenExercise/src/test/java/SimpleTest.java (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/__init__.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/src/__init__.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/src/__main__.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/src/greeter.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/src/lastiruuma.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/src/matkalaukku.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/src/tavara.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/test/__init__.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/test/test_greeter.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/test/test_lastiruuma.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/test/test_matkalaukku.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/test/test_tavara.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/__init__.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/__main__.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/__pycache__/__init__.cpython-38.pyc (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/__pycache__/__main__.cpython-38.pyc (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/__pycache__/points.cpython-38.pyc (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/__pycache__/result.cpython-38.pyc (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/__pycache__/runner.cpython-38.pyc (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/points.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/result.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/runner.py (100%) rename {tmc-langs => crates/tmc-langs}/tests/data/some_course/PythonExercise/tmc/utils.py (100%) diff --git a/Cargo.toml b/Cargo.toml index 73a0444c6bc..68d35322097 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,26 +1,16 @@ [workspace] members = [ # core libraries - "tmc-client", - "tmc-langs", - "tmc-langs-cli", - "tmc-langs-framework", - "tmc-langs-plugins", - "tmc-langs-util", + "crates/tmc-*", # language plugins - "plugins/csharp", - "plugins/java", - "plugins/make", - "plugins/notests", - "plugins/python3", - "plugins/r", + "crates/plugins/*", # bindings to other languages - "bindings/tmc-langs-node", + "crates/bindings/*", # test helpers - "tmc-server-mock", + "crates/helpers/*", ] resolver = "2" @@ -32,3 +22,17 @@ authors = [ edition = "2021" rust-version = "1.58.1" license = "MIT OR Apache-2.0" + +[workspace.dependencies] +tmc-client = { path = "crates/tmc-client" } +tmc-langs = { path = "crates/tmc-langs" } +tmc-langs-framework = { path = "crates/tmc-langs-framework" } +tmc-langs-plugins = { path = "crates/tmc-langs-plugins" } +tmc-langs-util = { path = "crates/tmc-langs-util" } +tmc-langs-csharp = { path = "crates/plugins/csharp" } +tmc-langs-java = { path = "crates/plugins/java" } +tmc-langs-make = { path = "crates/plugins/make" } +tmc-langs-notests = { path = "crates/plugins/notests" } +tmc-langs-python3 = { path = "crates/plugins/python3" } +tmc-langs-r = { path = "crates/plugins/r" } +tmc-server-mock = { path = "crates/helpers/tmc-server-mock" } diff --git a/bindings/tmc-langs-node/.gitignore b/crates/bindings/tmc-langs-node/.gitignore similarity index 100% rename from bindings/tmc-langs-node/.gitignore rename to crates/bindings/tmc-langs-node/.gitignore diff --git a/bindings/tmc-langs-node/Cargo.toml b/crates/bindings/tmc-langs-node/Cargo.toml similarity index 86% rename from bindings/tmc-langs-node/Cargo.toml rename to crates/bindings/tmc-langs-node/Cargo.toml index 60af327a324..1503653d31d 100644 --- a/bindings/tmc-langs-node/Cargo.toml +++ b/crates/bindings/tmc-langs-node/Cargo.toml @@ -17,7 +17,7 @@ default-features = false features = ["napi-6", "default-panic-hook"] [dependencies] -tmc-langs = { path = "../../tmc-langs", features = ["ts"] } +tmc-langs = { workspace = true, features = ["ts"] } base64 = "0.13.0" env_logger = "0.9.0" @@ -32,4 +32,4 @@ ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ log = "0.4.14" once_cell = "1.9.0" simple_logger = "2.1.0" -tmc-server-mock = { path = "../../tmc-server-mock" } +tmc-server-mock .workspace = true diff --git a/bindings/tmc-langs-node/README.md b/crates/bindings/tmc-langs-node/README.md similarity index 100% rename from bindings/tmc-langs-node/README.md rename to crates/bindings/tmc-langs-node/README.md diff --git a/bindings/tmc-langs-node/babel.config.js b/crates/bindings/tmc-langs-node/babel.config.js similarity index 100% rename from bindings/tmc-langs-node/babel.config.js rename to crates/bindings/tmc-langs-node/babel.config.js diff --git a/bindings/tmc-langs-node/jest/maven-exercise/.classpath b/crates/bindings/tmc-langs-node/jest/maven-exercise/.classpath similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/.classpath rename to crates/bindings/tmc-langs-node/jest/maven-exercise/.classpath diff --git a/bindings/tmc-langs-node/jest/maven-exercise/.factorypath b/crates/bindings/tmc-langs-node/jest/maven-exercise/.factorypath similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/.factorypath rename to crates/bindings/tmc-langs-node/jest/maven-exercise/.factorypath diff --git a/bindings/tmc-langs-node/jest/maven-exercise/.project b/crates/bindings/tmc-langs-node/jest/maven-exercise/.project similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/.project rename to crates/bindings/tmc-langs-node/jest/maven-exercise/.project diff --git a/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.core.resources.prefs b/crates/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.core.resources.prefs similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.core.resources.prefs rename to crates/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.core.resources.prefs diff --git a/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.jdt.apt.core.prefs b/crates/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.jdt.apt.core.prefs similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.jdt.apt.core.prefs rename to crates/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.jdt.apt.core.prefs diff --git a/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.jdt.core.prefs b/crates/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.jdt.core.prefs rename to crates/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.jdt.core.prefs diff --git a/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.m2e.core.prefs b/crates/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.m2e.core.prefs similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.m2e.core.prefs rename to crates/bindings/tmc-langs-node/jest/maven-exercise/.settings/org.eclipse.m2e.core.prefs diff --git a/bindings/tmc-langs-node/jest/maven-exercise/.tmcproject.json b/crates/bindings/tmc-langs-node/jest/maven-exercise/.tmcproject.json similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/.tmcproject.json rename to crates/bindings/tmc-langs-node/jest/maven-exercise/.tmcproject.json diff --git a/bindings/tmc-langs-node/jest/maven-exercise/pom.xml b/crates/bindings/tmc-langs-node/jest/maven-exercise/pom.xml similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/pom.xml rename to crates/bindings/tmc-langs-node/jest/maven-exercise/pom.xml diff --git a/bindings/tmc-langs-node/jest/maven-exercise/src/main/java/fi/helsinki/cs/maventest/App.java b/crates/bindings/tmc-langs-node/jest/maven-exercise/src/main/java/fi/helsinki/cs/maventest/App.java similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/src/main/java/fi/helsinki/cs/maventest/App.java rename to crates/bindings/tmc-langs-node/jest/maven-exercise/src/main/java/fi/helsinki/cs/maventest/App.java diff --git a/bindings/tmc-langs-node/jest/maven-exercise/src/test/java/fi/helsinki/cs/maventest/AppTest.java b/crates/bindings/tmc-langs-node/jest/maven-exercise/src/test/java/fi/helsinki/cs/maventest/AppTest.java similarity index 100% rename from bindings/tmc-langs-node/jest/maven-exercise/src/test/java/fi/helsinki/cs/maventest/AppTest.java rename to crates/bindings/tmc-langs-node/jest/maven-exercise/src/test/java/fi/helsinki/cs/maventest/AppTest.java diff --git a/bindings/tmc-langs-node/jest/mock_server.js b/crates/bindings/tmc-langs-node/jest/mock_server.js similarity index 100% rename from bindings/tmc-langs-node/jest/mock_server.js rename to crates/bindings/tmc-langs-node/jest/mock_server.js diff --git a/bindings/tmc-langs-node/jest/python-exercise.zip b/crates/bindings/tmc-langs-node/jest/python-exercise.zip similarity index 100% rename from bindings/tmc-langs-node/jest/python-exercise.zip rename to crates/bindings/tmc-langs-node/jest/python-exercise.zip diff --git a/bindings/tmc-langs-node/jest/tmc.test.ts b/crates/bindings/tmc-langs-node/jest/tmc.test.ts similarity index 100% rename from bindings/tmc-langs-node/jest/tmc.test.ts rename to crates/bindings/tmc-langs-node/jest/tmc.test.ts diff --git a/bindings/tmc-langs-node/package-lock.json b/crates/bindings/tmc-langs-node/package-lock.json similarity index 100% rename from bindings/tmc-langs-node/package-lock.json rename to crates/bindings/tmc-langs-node/package-lock.json diff --git a/bindings/tmc-langs-node/package.json b/crates/bindings/tmc-langs-node/package.json similarity index 100% rename from bindings/tmc-langs-node/package.json rename to crates/bindings/tmc-langs-node/package.json diff --git a/bindings/tmc-langs-node/src/bin/generate-bindings.rs b/crates/bindings/tmc-langs-node/src/bin/generate-bindings.rs similarity index 100% rename from bindings/tmc-langs-node/src/bin/generate-bindings.rs rename to crates/bindings/tmc-langs-node/src/bin/generate-bindings.rs diff --git a/bindings/tmc-langs-node/src/de.rs b/crates/bindings/tmc-langs-node/src/de.rs similarity index 100% rename from bindings/tmc-langs-node/src/de.rs rename to crates/bindings/tmc-langs-node/src/de.rs diff --git a/bindings/tmc-langs-node/src/error.rs b/crates/bindings/tmc-langs-node/src/error.rs similarity index 100% rename from bindings/tmc-langs-node/src/error.rs rename to crates/bindings/tmc-langs-node/src/error.rs diff --git a/bindings/tmc-langs-node/src/helpers.rs b/crates/bindings/tmc-langs-node/src/helpers.rs similarity index 100% rename from bindings/tmc-langs-node/src/helpers.rs rename to crates/bindings/tmc-langs-node/src/helpers.rs diff --git a/bindings/tmc-langs-node/src/lib.rs b/crates/bindings/tmc-langs-node/src/lib.rs similarity index 100% rename from bindings/tmc-langs-node/src/lib.rs rename to crates/bindings/tmc-langs-node/src/lib.rs diff --git a/bindings/tmc-langs-node/src/ser.rs b/crates/bindings/tmc-langs-node/src/ser.rs similarity index 100% rename from bindings/tmc-langs-node/src/ser.rs rename to crates/bindings/tmc-langs-node/src/ser.rs diff --git a/bindings/tmc-langs-node/ts/functions.d.ts b/crates/bindings/tmc-langs-node/ts/functions.d.ts similarity index 100% rename from bindings/tmc-langs-node/ts/functions.d.ts rename to crates/bindings/tmc-langs-node/ts/functions.d.ts diff --git a/bindings/tmc-langs-node/ts/generated.d.ts b/crates/bindings/tmc-langs-node/ts/generated.d.ts similarity index 100% rename from bindings/tmc-langs-node/ts/generated.d.ts rename to crates/bindings/tmc-langs-node/ts/generated.d.ts diff --git a/bindings/tmc-langs-node/ts/tmc.ts b/crates/bindings/tmc-langs-node/ts/tmc.ts similarity index 100% rename from bindings/tmc-langs-node/ts/tmc.ts rename to crates/bindings/tmc-langs-node/ts/tmc.ts diff --git a/bindings/tmc-langs-node/tsconfig.json b/crates/bindings/tmc-langs-node/tsconfig.json similarity index 100% rename from bindings/tmc-langs-node/tsconfig.json rename to crates/bindings/tmc-langs-node/tsconfig.json diff --git a/tmc-server-mock/Cargo.toml b/crates/helpers/tmc-server-mock/Cargo.toml similarity index 100% rename from tmc-server-mock/Cargo.toml rename to crates/helpers/tmc-server-mock/Cargo.toml diff --git a/tmc-server-mock/python-exercise.zip b/crates/helpers/tmc-server-mock/python-exercise.zip similarity index 100% rename from tmc-server-mock/python-exercise.zip rename to crates/helpers/tmc-server-mock/python-exercise.zip diff --git a/tmc-server-mock/src/lib.rs b/crates/helpers/tmc-server-mock/src/lib.rs similarity index 100% rename from tmc-server-mock/src/lib.rs rename to crates/helpers/tmc-server-mock/src/lib.rs diff --git a/plugins/csharp/Cargo.toml b/crates/plugins/csharp/Cargo.toml similarity index 83% rename from plugins/csharp/Cargo.toml rename to crates/plugins/csharp/Cargo.toml index 80be0039b98..b7b8f5e8041 100644 --- a/plugins/csharp/Cargo.toml +++ b/crates/plugins/csharp/Cargo.toml @@ -7,8 +7,8 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-framework = { path = "../../tmc-langs-framework" } -tmc-langs-util = { path = "../../tmc-langs-util" } +tmc-langs-framework .workspace = true +tmc-langs-util .workspace = true dirs = "4.0.0" log = "0.4.14" diff --git a/plugins/csharp/README.md b/crates/plugins/csharp/README.md similarity index 100% rename from plugins/csharp/README.md rename to crates/plugins/csharp/README.md diff --git a/plugins/csharp/deps/tmc-csharp-runner-2.0.zip b/crates/plugins/csharp/deps/tmc-csharp-runner-2.0.zip similarity index 100% rename from plugins/csharp/deps/tmc-csharp-runner-2.0.zip rename to crates/plugins/csharp/deps/tmc-csharp-runner-2.0.zip diff --git a/plugins/csharp/src/cs_test_result.rs b/crates/plugins/csharp/src/cs_test_result.rs similarity index 100% rename from plugins/csharp/src/cs_test_result.rs rename to crates/plugins/csharp/src/cs_test_result.rs diff --git a/plugins/csharp/src/error.rs b/crates/plugins/csharp/src/error.rs similarity index 100% rename from plugins/csharp/src/error.rs rename to crates/plugins/csharp/src/error.rs diff --git a/plugins/csharp/src/lib.rs b/crates/plugins/csharp/src/lib.rs similarity index 100% rename from plugins/csharp/src/lib.rs rename to crates/plugins/csharp/src/lib.rs diff --git a/plugins/csharp/src/plugin.rs b/crates/plugins/csharp/src/plugin.rs similarity index 100% rename from plugins/csharp/src/plugin.rs rename to crates/plugins/csharp/src/plugin.rs diff --git a/plugins/csharp/src/policy.rs b/crates/plugins/csharp/src/policy.rs similarity index 100% rename from plugins/csharp/src/policy.rs rename to crates/plugins/csharp/src/policy.rs diff --git a/plugins/csharp/tests/data/failing-exercise/nuget.config b/crates/plugins/csharp/tests/data/failing-exercise/nuget.config similarity index 100% rename from plugins/csharp/tests/data/failing-exercise/nuget.config rename to crates/plugins/csharp/tests/data/failing-exercise/nuget.config diff --git a/plugins/csharp/tests/data/failing-exercise/src/FailingSample/FailingSample.csproj b/crates/plugins/csharp/tests/data/failing-exercise/src/FailingSample/FailingSample.csproj similarity index 100% rename from plugins/csharp/tests/data/failing-exercise/src/FailingSample/FailingSample.csproj rename to crates/plugins/csharp/tests/data/failing-exercise/src/FailingSample/FailingSample.csproj diff --git a/plugins/csharp/tests/data/failing-exercise/src/FailingSample/Program.cs b/crates/plugins/csharp/tests/data/failing-exercise/src/FailingSample/Program.cs similarity index 100% rename from plugins/csharp/tests/data/failing-exercise/src/FailingSample/Program.cs rename to crates/plugins/csharp/tests/data/failing-exercise/src/FailingSample/Program.cs diff --git a/plugins/csharp/tests/data/failing-exercise/test/FailingSampleTests/FailingSampleTests.csproj b/crates/plugins/csharp/tests/data/failing-exercise/test/FailingSampleTests/FailingSampleTests.csproj similarity index 100% rename from plugins/csharp/tests/data/failing-exercise/test/FailingSampleTests/FailingSampleTests.csproj rename to crates/plugins/csharp/tests/data/failing-exercise/test/FailingSampleTests/FailingSampleTests.csproj diff --git a/plugins/csharp/tests/data/failing-exercise/test/FailingSampleTests/ProgramTest.cs b/crates/plugins/csharp/tests/data/failing-exercise/test/FailingSampleTests/ProgramTest.cs similarity index 100% rename from plugins/csharp/tests/data/failing-exercise/test/FailingSampleTests/ProgramTest.cs rename to crates/plugins/csharp/tests/data/failing-exercise/test/FailingSampleTests/ProgramTest.cs diff --git a/plugins/csharp/tests/data/non-compiling-exercise/nuget.config b/crates/plugins/csharp/tests/data/non-compiling-exercise/nuget.config similarity index 100% rename from plugins/csharp/tests/data/non-compiling-exercise/nuget.config rename to crates/plugins/csharp/tests/data/non-compiling-exercise/nuget.config diff --git a/plugins/csharp/tests/data/non-compiling-exercise/src/NonCompilingSample/NonCompilingSample.csproj b/crates/plugins/csharp/tests/data/non-compiling-exercise/src/NonCompilingSample/NonCompilingSample.csproj similarity index 100% rename from plugins/csharp/tests/data/non-compiling-exercise/src/NonCompilingSample/NonCompilingSample.csproj rename to crates/plugins/csharp/tests/data/non-compiling-exercise/src/NonCompilingSample/NonCompilingSample.csproj diff --git a/plugins/csharp/tests/data/non-compiling-exercise/src/NonCompilingSample/Program.cs b/crates/plugins/csharp/tests/data/non-compiling-exercise/src/NonCompilingSample/Program.cs similarity index 100% rename from plugins/csharp/tests/data/non-compiling-exercise/src/NonCompilingSample/Program.cs rename to crates/plugins/csharp/tests/data/non-compiling-exercise/src/NonCompilingSample/Program.cs diff --git a/plugins/csharp/tests/data/non-compiling-exercise/test/NonCompilingSampleTests/NonCompilingSampleTests.csproj b/crates/plugins/csharp/tests/data/non-compiling-exercise/test/NonCompilingSampleTests/NonCompilingSampleTests.csproj similarity index 100% rename from plugins/csharp/tests/data/non-compiling-exercise/test/NonCompilingSampleTests/NonCompilingSampleTests.csproj rename to crates/plugins/csharp/tests/data/non-compiling-exercise/test/NonCompilingSampleTests/NonCompilingSampleTests.csproj diff --git a/plugins/csharp/tests/data/non-compiling-exercise/test/NonCompilingSampleTests/ProgramTest.cs b/crates/plugins/csharp/tests/data/non-compiling-exercise/test/NonCompilingSampleTests/ProgramTest.cs similarity index 100% rename from plugins/csharp/tests/data/non-compiling-exercise/test/NonCompilingSampleTests/ProgramTest.cs rename to crates/plugins/csharp/tests/data/non-compiling-exercise/test/NonCompilingSampleTests/ProgramTest.cs diff --git a/plugins/csharp/tests/data/partially-passing/nuget.config b/crates/plugins/csharp/tests/data/partially-passing/nuget.config similarity index 100% rename from plugins/csharp/tests/data/partially-passing/nuget.config rename to crates/plugins/csharp/tests/data/partially-passing/nuget.config diff --git a/plugins/csharp/tests/data/partially-passing/src/TestProject/Program.cs b/crates/plugins/csharp/tests/data/partially-passing/src/TestProject/Program.cs similarity index 100% rename from plugins/csharp/tests/data/partially-passing/src/TestProject/Program.cs rename to crates/plugins/csharp/tests/data/partially-passing/src/TestProject/Program.cs diff --git a/plugins/csharp/tests/data/partially-passing/src/TestProject/TestProject.csproj b/crates/plugins/csharp/tests/data/partially-passing/src/TestProject/TestProject.csproj similarity index 100% rename from plugins/csharp/tests/data/partially-passing/src/TestProject/TestProject.csproj rename to crates/plugins/csharp/tests/data/partially-passing/src/TestProject/TestProject.csproj diff --git a/plugins/csharp/tests/data/partially-passing/test/TestProjectTests/ProgramTest.cs b/crates/plugins/csharp/tests/data/partially-passing/test/TestProjectTests/ProgramTest.cs similarity index 100% rename from plugins/csharp/tests/data/partially-passing/test/TestProjectTests/ProgramTest.cs rename to crates/plugins/csharp/tests/data/partially-passing/test/TestProjectTests/ProgramTest.cs diff --git a/plugins/csharp/tests/data/partially-passing/test/TestProjectTests/TestProjectTests.csproj b/crates/plugins/csharp/tests/data/partially-passing/test/TestProjectTests/TestProjectTests.csproj similarity index 100% rename from plugins/csharp/tests/data/partially-passing/test/TestProjectTests/TestProjectTests.csproj rename to crates/plugins/csharp/tests/data/partially-passing/test/TestProjectTests/TestProjectTests.csproj diff --git a/plugins/csharp/tests/data/passing-exercise/nuget.config b/crates/plugins/csharp/tests/data/passing-exercise/nuget.config similarity index 100% rename from plugins/csharp/tests/data/passing-exercise/nuget.config rename to crates/plugins/csharp/tests/data/passing-exercise/nuget.config diff --git a/plugins/csharp/tests/data/passing-exercise/src/PassingSample/PassingSample.csproj b/crates/plugins/csharp/tests/data/passing-exercise/src/PassingSample/PassingSample.csproj similarity index 100% rename from plugins/csharp/tests/data/passing-exercise/src/PassingSample/PassingSample.csproj rename to crates/plugins/csharp/tests/data/passing-exercise/src/PassingSample/PassingSample.csproj diff --git a/plugins/csharp/tests/data/passing-exercise/src/PassingSample/Program.cs b/crates/plugins/csharp/tests/data/passing-exercise/src/PassingSample/Program.cs similarity index 100% rename from plugins/csharp/tests/data/passing-exercise/src/PassingSample/Program.cs rename to crates/plugins/csharp/tests/data/passing-exercise/src/PassingSample/Program.cs diff --git a/plugins/csharp/tests/data/passing-exercise/test/PassingSampleTests/PassingSampleTests.csproj b/crates/plugins/csharp/tests/data/passing-exercise/test/PassingSampleTests/PassingSampleTests.csproj similarity index 100% rename from plugins/csharp/tests/data/passing-exercise/test/PassingSampleTests/PassingSampleTests.csproj rename to crates/plugins/csharp/tests/data/passing-exercise/test/PassingSampleTests/PassingSampleTests.csproj diff --git a/plugins/csharp/tests/data/passing-exercise/test/PassingSampleTests/ProgramTest.cs b/crates/plugins/csharp/tests/data/passing-exercise/test/PassingSampleTests/ProgramTest.cs similarity index 100% rename from plugins/csharp/tests/data/passing-exercise/test/PassingSampleTests/ProgramTest.cs rename to crates/plugins/csharp/tests/data/passing-exercise/test/PassingSampleTests/ProgramTest.cs diff --git a/plugins/java/Cargo.toml b/crates/plugins/java/Cargo.toml similarity index 86% rename from plugins/java/Cargo.toml rename to crates/plugins/java/Cargo.toml index da000e2d101..ae4a92c03a5 100644 --- a/plugins/java/Cargo.toml +++ b/crates/plugins/java/Cargo.toml @@ -7,8 +7,8 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-framework = { path = "../../tmc-langs-framework" } -tmc-langs-util = { path = "../../tmc-langs-util" } +tmc-langs-framework .workspace = true +tmc-langs-util .workspace = true dirs = "4.0.0" flate2 = "1.0.22" diff --git a/plugins/java/README.md b/crates/plugins/java/README.md similarity index 100% rename from plugins/java/README.md rename to crates/plugins/java/README.md diff --git a/plugins/java/deps/apache-maven-3.8.1-bin.tar.gz b/crates/plugins/java/deps/apache-maven-3.8.1-bin.tar.gz similarity index 100% rename from plugins/java/deps/apache-maven-3.8.1-bin.tar.gz rename to crates/plugins/java/deps/apache-maven-3.8.1-bin.tar.gz diff --git a/plugins/java/deps/j4rs-0.13.0-jar-with-dependencies.jar b/crates/plugins/java/deps/j4rs-0.13.0-jar-with-dependencies.jar similarity index 100% rename from plugins/java/deps/j4rs-0.13.0-jar-with-dependencies.jar rename to crates/plugins/java/deps/j4rs-0.13.0-jar-with-dependencies.jar diff --git a/plugins/java/deps/tmc-checkstyle-runner-3.0.3-20200520.064542-3.jar b/crates/plugins/java/deps/tmc-checkstyle-runner-3.0.3-20200520.064542-3.jar similarity index 100% rename from plugins/java/deps/tmc-checkstyle-runner-3.0.3-20200520.064542-3.jar rename to crates/plugins/java/deps/tmc-checkstyle-runner-3.0.3-20200520.064542-3.jar diff --git a/plugins/java/deps/tmc-junit-runner-0.2.8.jar b/crates/plugins/java/deps/tmc-junit-runner-0.2.8.jar similarity index 100% rename from plugins/java/deps/tmc-junit-runner-0.2.8.jar rename to crates/plugins/java/deps/tmc-junit-runner-0.2.8.jar diff --git a/plugins/java/src/ant_plugin.rs b/crates/plugins/java/src/ant_plugin.rs similarity index 100% rename from plugins/java/src/ant_plugin.rs rename to crates/plugins/java/src/ant_plugin.rs diff --git a/plugins/java/src/ant_policy.rs b/crates/plugins/java/src/ant_policy.rs similarity index 100% rename from plugins/java/src/ant_policy.rs rename to crates/plugins/java/src/ant_policy.rs diff --git a/plugins/java/src/error.rs b/crates/plugins/java/src/error.rs similarity index 100% rename from plugins/java/src/error.rs rename to crates/plugins/java/src/error.rs diff --git a/plugins/java/src/java_plugin.rs b/crates/plugins/java/src/java_plugin.rs similarity index 100% rename from plugins/java/src/java_plugin.rs rename to crates/plugins/java/src/java_plugin.rs diff --git a/plugins/java/src/lib.rs b/crates/plugins/java/src/lib.rs similarity index 100% rename from plugins/java/src/lib.rs rename to crates/plugins/java/src/lib.rs diff --git a/plugins/java/src/maven_plugin.rs b/crates/plugins/java/src/maven_plugin.rs similarity index 100% rename from plugins/java/src/maven_plugin.rs rename to crates/plugins/java/src/maven_plugin.rs diff --git a/plugins/java/src/maven_policy.rs b/crates/plugins/java/src/maven_policy.rs similarity index 100% rename from plugins/java/src/maven_policy.rs rename to crates/plugins/java/src/maven_policy.rs diff --git a/plugins/java/tests/data/ant-exercise/.tmcproject.json b/crates/plugins/java/tests/data/ant-exercise/.tmcproject.json similarity index 100% rename from plugins/java/tests/data/ant-exercise/.tmcproject.json rename to crates/plugins/java/tests/data/ant-exercise/.tmcproject.json diff --git a/plugins/java/tests/data/ant-exercise/build.xml b/crates/plugins/java/tests/data/ant-exercise/build.xml similarity index 100% rename from plugins/java/tests/data/ant-exercise/build.xml rename to crates/plugins/java/tests/data/ant-exercise/build.xml diff --git a/plugins/java/tests/data/ant-exercise/lib/edu-test-utils-0.4.1.jar b/crates/plugins/java/tests/data/ant-exercise/lib/edu-test-utils-0.4.1.jar similarity index 100% rename from plugins/java/tests/data/ant-exercise/lib/edu-test-utils-0.4.1.jar rename to crates/plugins/java/tests/data/ant-exercise/lib/edu-test-utils-0.4.1.jar diff --git a/plugins/java/tests/data/ant-exercise/lib/junit-4.10.jar b/crates/plugins/java/tests/data/ant-exercise/lib/junit-4.10.jar similarity index 100% rename from plugins/java/tests/data/ant-exercise/lib/junit-4.10.jar rename to crates/plugins/java/tests/data/ant-exercise/lib/junit-4.10.jar diff --git a/plugins/java/tests/data/ant-exercise/nbproject/build-impl.xml b/crates/plugins/java/tests/data/ant-exercise/nbproject/build-impl.xml similarity index 100% rename from plugins/java/tests/data/ant-exercise/nbproject/build-impl.xml rename to crates/plugins/java/tests/data/ant-exercise/nbproject/build-impl.xml diff --git a/plugins/java/tests/data/ant-exercise/nbproject/genfiles.properties b/crates/plugins/java/tests/data/ant-exercise/nbproject/genfiles.properties similarity index 100% rename from plugins/java/tests/data/ant-exercise/nbproject/genfiles.properties rename to crates/plugins/java/tests/data/ant-exercise/nbproject/genfiles.properties diff --git a/plugins/java/tests/data/ant-exercise/nbproject/project.properties b/crates/plugins/java/tests/data/ant-exercise/nbproject/project.properties similarity index 100% rename from plugins/java/tests/data/ant-exercise/nbproject/project.properties rename to crates/plugins/java/tests/data/ant-exercise/nbproject/project.properties diff --git a/plugins/java/tests/data/ant-exercise/nbproject/project.xml b/crates/plugins/java/tests/data/ant-exercise/nbproject/project.xml similarity index 100% rename from plugins/java/tests/data/ant-exercise/nbproject/project.xml rename to crates/plugins/java/tests/data/ant-exercise/nbproject/project.xml diff --git a/plugins/java/tests/data/ant-exercise/src/Arith.java b/crates/plugins/java/tests/data/ant-exercise/src/Arith.java similarity index 100% rename from plugins/java/tests/data/ant-exercise/src/Arith.java rename to crates/plugins/java/tests/data/ant-exercise/src/Arith.java diff --git a/plugins/java/tests/data/ant-exercise/test/ArithTest.java b/crates/plugins/java/tests/data/ant-exercise/test/ArithTest.java similarity index 100% rename from plugins/java/tests/data/ant-exercise/test/ArithTest.java rename to crates/plugins/java/tests/data/ant-exercise/test/ArithTest.java diff --git a/plugins/java/tests/data/maven-exercise/.classpath b/crates/plugins/java/tests/data/maven-exercise/.classpath similarity index 100% rename from plugins/java/tests/data/maven-exercise/.classpath rename to crates/plugins/java/tests/data/maven-exercise/.classpath diff --git a/plugins/java/tests/data/maven-exercise/.factorypath b/crates/plugins/java/tests/data/maven-exercise/.factorypath similarity index 100% rename from plugins/java/tests/data/maven-exercise/.factorypath rename to crates/plugins/java/tests/data/maven-exercise/.factorypath diff --git a/plugins/java/tests/data/maven-exercise/.project b/crates/plugins/java/tests/data/maven-exercise/.project similarity index 100% rename from plugins/java/tests/data/maven-exercise/.project rename to crates/plugins/java/tests/data/maven-exercise/.project diff --git a/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.core.resources.prefs b/crates/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.core.resources.prefs similarity index 100% rename from plugins/java/tests/data/maven-exercise/.settings/org.eclipse.core.resources.prefs rename to crates/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.core.resources.prefs diff --git a/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.jdt.apt.core.prefs b/crates/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.jdt.apt.core.prefs similarity index 100% rename from plugins/java/tests/data/maven-exercise/.settings/org.eclipse.jdt.apt.core.prefs rename to crates/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.jdt.apt.core.prefs diff --git a/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.jdt.core.prefs b/crates/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from plugins/java/tests/data/maven-exercise/.settings/org.eclipse.jdt.core.prefs rename to crates/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.jdt.core.prefs diff --git a/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.m2e.core.prefs b/crates/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.m2e.core.prefs similarity index 100% rename from plugins/java/tests/data/maven-exercise/.settings/org.eclipse.m2e.core.prefs rename to crates/plugins/java/tests/data/maven-exercise/.settings/org.eclipse.m2e.core.prefs diff --git a/plugins/java/tests/data/maven-exercise/.tmcproject.json b/crates/plugins/java/tests/data/maven-exercise/.tmcproject.json similarity index 100% rename from plugins/java/tests/data/maven-exercise/.tmcproject.json rename to crates/plugins/java/tests/data/maven-exercise/.tmcproject.json diff --git a/plugins/java/tests/data/maven-exercise/pom.xml b/crates/plugins/java/tests/data/maven-exercise/pom.xml similarity index 100% rename from plugins/java/tests/data/maven-exercise/pom.xml rename to crates/plugins/java/tests/data/maven-exercise/pom.xml diff --git a/plugins/java/tests/data/maven-exercise/src/main/java/fi/helsinki/cs/maventest/App.java b/crates/plugins/java/tests/data/maven-exercise/src/main/java/fi/helsinki/cs/maventest/App.java similarity index 100% rename from plugins/java/tests/data/maven-exercise/src/main/java/fi/helsinki/cs/maventest/App.java rename to crates/plugins/java/tests/data/maven-exercise/src/main/java/fi/helsinki/cs/maventest/App.java diff --git a/plugins/java/tests/data/maven-exercise/src/test/java/fi/helsinki/cs/maventest/AppTest.java b/crates/plugins/java/tests/data/maven-exercise/src/test/java/fi/helsinki/cs/maventest/AppTest.java similarity index 100% rename from plugins/java/tests/data/maven-exercise/src/test/java/fi/helsinki/cs/maventest/AppTest.java rename to crates/plugins/java/tests/data/maven-exercise/src/test/java/fi/helsinki/cs/maventest/AppTest.java diff --git a/plugins/make/Cargo.toml b/crates/plugins/make/Cargo.toml similarity index 84% rename from plugins/make/Cargo.toml rename to crates/plugins/make/Cargo.toml index d03ca248a5d..a3a976976fa 100644 --- a/plugins/make/Cargo.toml +++ b/crates/plugins/make/Cargo.toml @@ -7,8 +7,8 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-framework = { path = "../../tmc-langs-framework" } -tmc-langs-util = { path = "../../tmc-langs-util" } +tmc-langs-framework.workspace = true +tmc-langs-util.workspace = true log = "0.4.14" once_cell = "1.9.0" diff --git a/plugins/make/README.md b/crates/plugins/make/README.md similarity index 100% rename from plugins/make/README.md rename to crates/plugins/make/README.md diff --git a/plugins/make/src/check_log.rs b/crates/plugins/make/src/check_log.rs similarity index 100% rename from plugins/make/src/check_log.rs rename to crates/plugins/make/src/check_log.rs diff --git a/plugins/make/src/error.rs b/crates/plugins/make/src/error.rs similarity index 100% rename from plugins/make/src/error.rs rename to crates/plugins/make/src/error.rs diff --git a/plugins/make/src/lib.rs b/crates/plugins/make/src/lib.rs similarity index 100% rename from plugins/make/src/lib.rs rename to crates/plugins/make/src/lib.rs diff --git a/plugins/make/src/plugin.rs b/crates/plugins/make/src/plugin.rs similarity index 100% rename from plugins/make/src/plugin.rs rename to crates/plugins/make/src/plugin.rs diff --git a/plugins/make/src/policy.rs b/crates/plugins/make/src/policy.rs similarity index 100% rename from plugins/make/src/policy.rs rename to crates/plugins/make/src/policy.rs diff --git a/plugins/make/src/valgrind_log.rs b/crates/plugins/make/src/valgrind_log.rs similarity index 100% rename from plugins/make/src/valgrind_log.rs rename to crates/plugins/make/src/valgrind_log.rs diff --git a/plugins/make/tests/data/failing-exercise/Makefile b/crates/plugins/make/tests/data/failing-exercise/Makefile similarity index 100% rename from plugins/make/tests/data/failing-exercise/Makefile rename to crates/plugins/make/tests/data/failing-exercise/Makefile diff --git a/plugins/make/tests/data/failing-exercise/src/Makefile b/crates/plugins/make/tests/data/failing-exercise/src/Makefile similarity index 100% rename from plugins/make/tests/data/failing-exercise/src/Makefile rename to crates/plugins/make/tests/data/failing-exercise/src/Makefile diff --git a/plugins/make/tests/data/failing-exercise/src/main.c b/crates/plugins/make/tests/data/failing-exercise/src/main.c similarity index 100% rename from plugins/make/tests/data/failing-exercise/src/main.c rename to crates/plugins/make/tests/data/failing-exercise/src/main.c diff --git a/plugins/make/tests/data/failing-exercise/src/source.c b/crates/plugins/make/tests/data/failing-exercise/src/source.c similarity index 100% rename from plugins/make/tests/data/failing-exercise/src/source.c rename to crates/plugins/make/tests/data/failing-exercise/src/source.c diff --git a/plugins/make/tests/data/failing-exercise/src/source.h b/crates/plugins/make/tests/data/failing-exercise/src/source.h similarity index 100% rename from plugins/make/tests/data/failing-exercise/src/source.h rename to crates/plugins/make/tests/data/failing-exercise/src/source.h diff --git a/plugins/make/tests/data/failing-exercise/test/Makefile b/crates/plugins/make/tests/data/failing-exercise/test/Makefile similarity index 100% rename from plugins/make/tests/data/failing-exercise/test/Makefile rename to crates/plugins/make/tests/data/failing-exercise/test/Makefile diff --git a/plugins/make/tests/data/failing-exercise/test/checkhelp.c b/crates/plugins/make/tests/data/failing-exercise/test/checkhelp.c similarity index 100% rename from plugins/make/tests/data/failing-exercise/test/checkhelp.c rename to crates/plugins/make/tests/data/failing-exercise/test/checkhelp.c diff --git a/plugins/make/tests/data/failing-exercise/test/test_source.c b/crates/plugins/make/tests/data/failing-exercise/test/test_source.c similarity index 100% rename from plugins/make/tests/data/failing-exercise/test/test_source.c rename to crates/plugins/make/tests/data/failing-exercise/test/test_source.c diff --git a/plugins/make/tests/data/failing-exercise/test/tmc-check.c b/crates/plugins/make/tests/data/failing-exercise/test/tmc-check.c similarity index 100% rename from plugins/make/tests/data/failing-exercise/test/tmc-check.c rename to crates/plugins/make/tests/data/failing-exercise/test/tmc-check.c diff --git a/plugins/make/tests/data/failing-exercise/test/tmc-check.h b/crates/plugins/make/tests/data/failing-exercise/test/tmc-check.h similarity index 100% rename from plugins/make/tests/data/failing-exercise/test/tmc-check.h rename to crates/plugins/make/tests/data/failing-exercise/test/tmc-check.h diff --git a/plugins/make/tests/data/passing-exercise/Makefile b/crates/plugins/make/tests/data/passing-exercise/Makefile similarity index 100% rename from plugins/make/tests/data/passing-exercise/Makefile rename to crates/plugins/make/tests/data/passing-exercise/Makefile diff --git a/plugins/make/tests/data/passing-exercise/src/Makefile b/crates/plugins/make/tests/data/passing-exercise/src/Makefile similarity index 100% rename from plugins/make/tests/data/passing-exercise/src/Makefile rename to crates/plugins/make/tests/data/passing-exercise/src/Makefile diff --git a/plugins/make/tests/data/passing-exercise/src/main.c b/crates/plugins/make/tests/data/passing-exercise/src/main.c similarity index 100% rename from plugins/make/tests/data/passing-exercise/src/main.c rename to crates/plugins/make/tests/data/passing-exercise/src/main.c diff --git a/plugins/make/tests/data/passing-exercise/src/source.c b/crates/plugins/make/tests/data/passing-exercise/src/source.c similarity index 100% rename from plugins/make/tests/data/passing-exercise/src/source.c rename to crates/plugins/make/tests/data/passing-exercise/src/source.c diff --git a/plugins/make/tests/data/passing-exercise/src/source.h b/crates/plugins/make/tests/data/passing-exercise/src/source.h similarity index 100% rename from plugins/make/tests/data/passing-exercise/src/source.h rename to crates/plugins/make/tests/data/passing-exercise/src/source.h diff --git a/plugins/make/tests/data/passing-exercise/test/Makefile b/crates/plugins/make/tests/data/passing-exercise/test/Makefile similarity index 100% rename from plugins/make/tests/data/passing-exercise/test/Makefile rename to crates/plugins/make/tests/data/passing-exercise/test/Makefile diff --git a/plugins/make/tests/data/passing-exercise/test/checkhelp.c b/crates/plugins/make/tests/data/passing-exercise/test/checkhelp.c similarity index 100% rename from plugins/make/tests/data/passing-exercise/test/checkhelp.c rename to crates/plugins/make/tests/data/passing-exercise/test/checkhelp.c diff --git a/plugins/make/tests/data/passing-exercise/test/test b/crates/plugins/make/tests/data/passing-exercise/test/test similarity index 100% rename from plugins/make/tests/data/passing-exercise/test/test rename to crates/plugins/make/tests/data/passing-exercise/test/test diff --git a/plugins/make/tests/data/passing-exercise/test/test_source.c b/crates/plugins/make/tests/data/passing-exercise/test/test_source.c similarity index 100% rename from plugins/make/tests/data/passing-exercise/test/test_source.c rename to crates/plugins/make/tests/data/passing-exercise/test/test_source.c diff --git a/plugins/make/tests/data/passing-exercise/test/tmc-check.c b/crates/plugins/make/tests/data/passing-exercise/test/tmc-check.c similarity index 100% rename from plugins/make/tests/data/passing-exercise/test/tmc-check.c rename to crates/plugins/make/tests/data/passing-exercise/test/tmc-check.c diff --git a/plugins/make/tests/data/passing-exercise/test/tmc-check.h b/crates/plugins/make/tests/data/passing-exercise/test/tmc-check.h similarity index 100% rename from plugins/make/tests/data/passing-exercise/test/tmc-check.h rename to crates/plugins/make/tests/data/passing-exercise/test/tmc-check.h diff --git a/plugins/make/tests/data/passing-exercise/test/tmc_available_points.txt b/crates/plugins/make/tests/data/passing-exercise/test/tmc_available_points.txt similarity index 100% rename from plugins/make/tests/data/passing-exercise/test/tmc_available_points.txt rename to crates/plugins/make/tests/data/passing-exercise/test/tmc_available_points.txt diff --git a/plugins/make/tests/data/passing-exercise/test/tmc_test_results.xml b/crates/plugins/make/tests/data/passing-exercise/test/tmc_test_results.xml similarity index 100% rename from plugins/make/tests/data/passing-exercise/test/tmc_test_results.xml rename to crates/plugins/make/tests/data/passing-exercise/test/tmc_test_results.xml diff --git a/plugins/make/tests/data/valgrind-failing-exercise/Makefile b/crates/plugins/make/tests/data/valgrind-failing-exercise/Makefile similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/Makefile rename to crates/plugins/make/tests/data/valgrind-failing-exercise/Makefile diff --git a/plugins/make/tests/data/valgrind-failing-exercise/src/Makefile b/crates/plugins/make/tests/data/valgrind-failing-exercise/src/Makefile similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/src/Makefile rename to crates/plugins/make/tests/data/valgrind-failing-exercise/src/Makefile diff --git a/plugins/make/tests/data/valgrind-failing-exercise/src/main.c b/crates/plugins/make/tests/data/valgrind-failing-exercise/src/main.c similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/src/main.c rename to crates/plugins/make/tests/data/valgrind-failing-exercise/src/main.c diff --git a/plugins/make/tests/data/valgrind-failing-exercise/src/source.c b/crates/plugins/make/tests/data/valgrind-failing-exercise/src/source.c similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/src/source.c rename to crates/plugins/make/tests/data/valgrind-failing-exercise/src/source.c diff --git a/plugins/make/tests/data/valgrind-failing-exercise/src/source.h b/crates/plugins/make/tests/data/valgrind-failing-exercise/src/source.h similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/src/source.h rename to crates/plugins/make/tests/data/valgrind-failing-exercise/src/source.h diff --git a/plugins/make/tests/data/valgrind-failing-exercise/test/Makefile b/crates/plugins/make/tests/data/valgrind-failing-exercise/test/Makefile similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/test/Makefile rename to crates/plugins/make/tests/data/valgrind-failing-exercise/test/Makefile diff --git a/plugins/make/tests/data/valgrind-failing-exercise/test/checkhelp.c b/crates/plugins/make/tests/data/valgrind-failing-exercise/test/checkhelp.c similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/test/checkhelp.c rename to crates/plugins/make/tests/data/valgrind-failing-exercise/test/checkhelp.c diff --git a/plugins/make/tests/data/valgrind-failing-exercise/test/test b/crates/plugins/make/tests/data/valgrind-failing-exercise/test/test similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/test/test rename to crates/plugins/make/tests/data/valgrind-failing-exercise/test/test diff --git a/plugins/make/tests/data/valgrind-failing-exercise/test/test_source.c b/crates/plugins/make/tests/data/valgrind-failing-exercise/test/test_source.c similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/test/test_source.c rename to crates/plugins/make/tests/data/valgrind-failing-exercise/test/test_source.c diff --git a/plugins/make/tests/data/valgrind-failing-exercise/test/tmc-check.c b/crates/plugins/make/tests/data/valgrind-failing-exercise/test/tmc-check.c similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/test/tmc-check.c rename to crates/plugins/make/tests/data/valgrind-failing-exercise/test/tmc-check.c diff --git a/plugins/make/tests/data/valgrind-failing-exercise/test/tmc-check.h b/crates/plugins/make/tests/data/valgrind-failing-exercise/test/tmc-check.h similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/test/tmc-check.h rename to crates/plugins/make/tests/data/valgrind-failing-exercise/test/tmc-check.h diff --git a/plugins/make/tests/data/valgrind-failing-exercise/test/tmc_available_points.txt b/crates/plugins/make/tests/data/valgrind-failing-exercise/test/tmc_available_points.txt similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/test/tmc_available_points.txt rename to crates/plugins/make/tests/data/valgrind-failing-exercise/test/tmc_available_points.txt diff --git a/plugins/make/tests/data/valgrind-failing-exercise/test/tmc_test_results.xml b/crates/plugins/make/tests/data/valgrind-failing-exercise/test/tmc_test_results.xml similarity index 100% rename from plugins/make/tests/data/valgrind-failing-exercise/test/tmc_test_results.xml rename to crates/plugins/make/tests/data/valgrind-failing-exercise/test/tmc_test_results.xml diff --git a/plugins/notests/Cargo.toml b/crates/plugins/notests/Cargo.toml similarity index 78% rename from plugins/notests/Cargo.toml rename to crates/plugins/notests/Cargo.toml index edff773a0c4..b32591e9daf 100644 --- a/plugins/notests/Cargo.toml +++ b/crates/plugins/notests/Cargo.toml @@ -7,8 +7,8 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-framework = { path = "../../tmc-langs-framework" } -tmc-langs-util = { path = "../../tmc-langs-util" } +tmc-langs-framework.workspace = true +tmc-langs-util.workspace = true log = "0.4.14" zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 diff --git a/plugins/notests/README.md b/crates/plugins/notests/README.md similarity index 100% rename from plugins/notests/README.md rename to crates/plugins/notests/README.md diff --git a/plugins/notests/src/lib.rs b/crates/plugins/notests/src/lib.rs similarity index 100% rename from plugins/notests/src/lib.rs rename to crates/plugins/notests/src/lib.rs diff --git a/plugins/notests/src/plugin.rs b/crates/plugins/notests/src/plugin.rs similarity index 100% rename from plugins/notests/src/plugin.rs rename to crates/plugins/notests/src/plugin.rs diff --git a/plugins/notests/src/policy.rs b/crates/plugins/notests/src/policy.rs similarity index 100% rename from plugins/notests/src/policy.rs rename to crates/plugins/notests/src/policy.rs diff --git a/plugins/python3/Cargo.toml b/crates/plugins/python3/Cargo.toml similarity index 84% rename from plugins/python3/Cargo.toml rename to crates/plugins/python3/Cargo.toml index 867e3e27433..1eacabadc80 100644 --- a/plugins/python3/Cargo.toml +++ b/crates/plugins/python3/Cargo.toml @@ -7,8 +7,8 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-framework = { path = "../../tmc-langs-framework" } -tmc-langs-util = { path = "../../tmc-langs-util" } +tmc-langs-framework.workspace = true +tmc-langs-util.workspace = true dunce = "1.0.2" hex = "0.4.3" diff --git a/plugins/python3/README.md b/crates/plugins/python3/README.md similarity index 100% rename from plugins/python3/README.md rename to crates/plugins/python3/README.md diff --git a/plugins/python3/src/error.rs b/crates/plugins/python3/src/error.rs similarity index 100% rename from plugins/python3/src/error.rs rename to crates/plugins/python3/src/error.rs diff --git a/plugins/python3/src/lib.rs b/crates/plugins/python3/src/lib.rs similarity index 100% rename from plugins/python3/src/lib.rs rename to crates/plugins/python3/src/lib.rs diff --git a/plugins/python3/src/plugin.rs b/crates/plugins/python3/src/plugin.rs similarity index 100% rename from plugins/python3/src/plugin.rs rename to crates/plugins/python3/src/plugin.rs diff --git a/plugins/python3/src/policy.rs b/crates/plugins/python3/src/policy.rs similarity index 100% rename from plugins/python3/src/policy.rs rename to crates/plugins/python3/src/policy.rs diff --git a/plugins/python3/src/python_test_result.rs b/crates/plugins/python3/src/python_test_result.rs similarity index 100% rename from plugins/python3/src/python_test_result.rs rename to crates/plugins/python3/src/python_test_result.rs diff --git a/plugins/python3/tests/data/tmc/UPDATED b/crates/plugins/python3/tests/data/tmc/UPDATED similarity index 100% rename from plugins/python3/tests/data/tmc/UPDATED rename to crates/plugins/python3/tests/data/tmc/UPDATED diff --git a/plugins/python3/tests/data/tmc/__init__.py b/crates/plugins/python3/tests/data/tmc/__init__.py similarity index 100% rename from plugins/python3/tests/data/tmc/__init__.py rename to crates/plugins/python3/tests/data/tmc/__init__.py diff --git a/plugins/python3/tests/data/tmc/__main__.py b/crates/plugins/python3/tests/data/tmc/__main__.py similarity index 100% rename from plugins/python3/tests/data/tmc/__main__.py rename to crates/plugins/python3/tests/data/tmc/__main__.py diff --git a/plugins/python3/tests/data/tmc/django.py b/crates/plugins/python3/tests/data/tmc/django.py similarity index 100% rename from plugins/python3/tests/data/tmc/django.py rename to crates/plugins/python3/tests/data/tmc/django.py diff --git a/plugins/python3/tests/data/tmc/hmac_writer.py b/crates/plugins/python3/tests/data/tmc/hmac_writer.py similarity index 100% rename from plugins/python3/tests/data/tmc/hmac_writer.py rename to crates/plugins/python3/tests/data/tmc/hmac_writer.py diff --git a/plugins/python3/tests/data/tmc/points.py b/crates/plugins/python3/tests/data/tmc/points.py similarity index 100% rename from plugins/python3/tests/data/tmc/points.py rename to crates/plugins/python3/tests/data/tmc/points.py diff --git a/plugins/python3/tests/data/tmc/reflect.py b/crates/plugins/python3/tests/data/tmc/reflect.py similarity index 100% rename from plugins/python3/tests/data/tmc/reflect.py rename to crates/plugins/python3/tests/data/tmc/reflect.py diff --git a/plugins/python3/tests/data/tmc/result.py b/crates/plugins/python3/tests/data/tmc/result.py similarity index 100% rename from plugins/python3/tests/data/tmc/result.py rename to crates/plugins/python3/tests/data/tmc/result.py diff --git a/plugins/python3/tests/data/tmc/runner.py b/crates/plugins/python3/tests/data/tmc/runner.py similarity index 100% rename from plugins/python3/tests/data/tmc/runner.py rename to crates/plugins/python3/tests/data/tmc/runner.py diff --git a/plugins/python3/tests/data/tmc/utils.py b/crates/plugins/python3/tests/data/tmc/utils.py similarity index 100% rename from plugins/python3/tests/data/tmc/utils.py rename to crates/plugins/python3/tests/data/tmc/utils.py diff --git a/plugins/r/Cargo.toml b/crates/plugins/r/Cargo.toml similarity index 82% rename from plugins/r/Cargo.toml rename to crates/plugins/r/Cargo.toml index a95b885c678..191c3db68a3 100644 --- a/plugins/r/Cargo.toml +++ b/crates/plugins/r/Cargo.toml @@ -7,8 +7,8 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-framework = { path = "../../tmc-langs-framework" } -tmc-langs-util = { path = "../../tmc-langs-util" } +tmc-langs-framework.workspace = true +tmc-langs-util.workspace = true log = "0.4.14" serde = { version = "1.0.136", features = ["derive"] } diff --git a/plugins/r/README.md b/crates/plugins/r/README.md similarity index 100% rename from plugins/r/README.md rename to crates/plugins/r/README.md diff --git a/plugins/r/src/error.rs b/crates/plugins/r/src/error.rs similarity index 100% rename from plugins/r/src/error.rs rename to crates/plugins/r/src/error.rs diff --git a/plugins/r/src/lib.rs b/crates/plugins/r/src/lib.rs similarity index 100% rename from plugins/r/src/lib.rs rename to crates/plugins/r/src/lib.rs diff --git a/plugins/r/src/plugin.rs b/crates/plugins/r/src/plugin.rs similarity index 100% rename from plugins/r/src/plugin.rs rename to crates/plugins/r/src/plugin.rs diff --git a/plugins/r/src/policy.rs b/crates/plugins/r/src/policy.rs similarity index 100% rename from plugins/r/src/policy.rs rename to crates/plugins/r/src/policy.rs diff --git a/plugins/r/src/r_run_result.rs b/crates/plugins/r/src/r_run_result.rs similarity index 100% rename from plugins/r/src/r_run_result.rs rename to crates/plugins/r/src/r_run_result.rs diff --git a/plugins/r/tests/tmcRtestrunner/.Rbuildignore b/crates/plugins/r/tests/tmcRtestrunner/.Rbuildignore similarity index 100% rename from plugins/r/tests/tmcRtestrunner/.Rbuildignore rename to crates/plugins/r/tests/tmcRtestrunner/.Rbuildignore diff --git a/plugins/r/tests/tmcRtestrunner/.lintr b/crates/plugins/r/tests/tmcRtestrunner/.lintr similarity index 100% rename from plugins/r/tests/tmcRtestrunner/.lintr rename to crates/plugins/r/tests/tmcRtestrunner/.lintr diff --git a/plugins/r/tests/tmcRtestrunner/DESCRIPTION b/crates/plugins/r/tests/tmcRtestrunner/DESCRIPTION similarity index 100% rename from plugins/r/tests/tmcRtestrunner/DESCRIPTION rename to crates/plugins/r/tests/tmcRtestrunner/DESCRIPTION diff --git a/plugins/r/tests/tmcRtestrunner/NAMESPACE b/crates/plugins/r/tests/tmcRtestrunner/NAMESPACE similarity index 100% rename from plugins/r/tests/tmcRtestrunner/NAMESPACE rename to crates/plugins/r/tests/tmcRtestrunner/NAMESPACE diff --git a/plugins/r/tests/tmcRtestrunner/R/GetAvailablePoints.R b/crates/plugins/r/tests/tmcRtestrunner/R/GetAvailablePoints.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/R/GetAvailablePoints.R rename to crates/plugins/r/tests/tmcRtestrunner/R/GetAvailablePoints.R diff --git a/plugins/r/tests/tmcRtestrunner/R/ResultsCreator.R b/crates/plugins/r/tests/tmcRtestrunner/R/ResultsCreator.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/R/ResultsCreator.R rename to crates/plugins/r/tests/tmcRtestrunner/R/ResultsCreator.R diff --git a/plugins/r/tests/tmcRtestrunner/R/ResultsJsonParser.R b/crates/plugins/r/tests/tmcRtestrunner/R/ResultsJsonParser.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/R/ResultsJsonParser.R rename to crates/plugins/r/tests/tmcRtestrunner/R/ResultsJsonParser.R diff --git a/plugins/r/tests/tmcRtestrunner/R/RunTests.R b/crates/plugins/r/tests/tmcRtestrunner/R/RunTests.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/R/RunTests.R rename to crates/plugins/r/tests/tmcRtestrunner/R/RunTests.R diff --git a/plugins/r/tests/tmcRtestrunner/R/TestEnvironment.R b/crates/plugins/r/tests/tmcRtestrunner/R/TestEnvironment.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/R/TestEnvironment.R rename to crates/plugins/r/tests/tmcRtestrunner/R/TestEnvironment.R diff --git a/plugins/r/tests/tmcRtestrunner/UPDATED b/crates/plugins/r/tests/tmcRtestrunner/UPDATED similarity index 100% rename from plugins/r/tests/tmcRtestrunner/UPDATED rename to crates/plugins/r/tests/tmcRtestrunner/UPDATED diff --git a/plugins/r/tests/tmcRtestrunner/man/file_encoding.Rd b/crates/plugins/r/tests/tmcRtestrunner/man/file_encoding.Rd similarity index 100% rename from plugins/r/tests/tmcRtestrunner/man/file_encoding.Rd rename to crates/plugins/r/tests/tmcRtestrunner/man/file_encoding.Rd diff --git a/plugins/r/tests/tmcRtestrunner/man/run_available_points.Rd b/crates/plugins/r/tests/tmcRtestrunner/man/run_available_points.Rd similarity index 100% rename from plugins/r/tests/tmcRtestrunner/man/run_available_points.Rd rename to crates/plugins/r/tests/tmcRtestrunner/man/run_available_points.Rd diff --git a/plugins/r/tests/tmcRtestrunner/man/run_tests.Rd b/crates/plugins/r/tests/tmcRtestrunner/man/run_tests.Rd similarity index 100% rename from plugins/r/tests/tmcRtestrunner/man/run_tests.Rd rename to crates/plugins/r/tests/tmcRtestrunner/man/run_tests.Rd diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/helperFunctions.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/helperFunctions.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/helperFunctions.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/helperFunctions.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/R/main.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/R/main.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/R/main.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/R/main.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/simple_all_tests_fail.Rproj b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/simple_all_tests_fail.Rproj similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/simple_all_tests_fail.Rproj rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/simple_all_tests_fail.Rproj diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/tests/testthat/testMain.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/tests/testthat/testMain.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/tests/testthat/testMain.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_fail/tests/testthat/testMain.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/R/main.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/R/main.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/R/main.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/R/main.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/R/second.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/R/second.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/R/second.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/R/second.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/simple_all_tests_pass.Rproj b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/simple_all_tests_pass.Rproj similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/simple_all_tests_pass.Rproj rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/simple_all_tests_pass.Rproj diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/tests/testthat/testMain.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/tests/testthat/testMain.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/tests/testthat/testMain.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/tests/testthat/testMain.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/tests/testthat/testSecond.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/tests/testthat/testSecond.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/tests/testthat/testSecond.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass/tests/testthat/testSecond.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/R/main.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/R/main.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/R/main.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/R/main.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/simple_sourcing_fail.Rproj b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/simple_sourcing_fail.Rproj similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/simple_sourcing_fail.Rproj rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/simple_sourcing_fail.Rproj diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/tests/testthat/mock.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/tests/testthat/mock.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/tests/testthat/mock.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/tests/testthat/mock.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/tests/testthat/testMain.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/tests/testthat/testMain.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/tests/testthat/testMain.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_all_tests_pass_with_plot/tests/testthat/testMain.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/R/main.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/R/main.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/R/main.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/R/main.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/simple_run_fail.Rproj b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/simple_run_fail.Rproj similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/simple_run_fail.Rproj rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/simple_run_fail.Rproj diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/tests/testthat/testMain.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/tests/testthat/testMain.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/tests/testthat/testMain.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_run_fail/tests/testthat/testMain.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/R/main.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/R/main.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/R/main.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/R/main.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/simple_some_tests_fail.Rproj b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/simple_some_tests_fail.Rproj similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/simple_some_tests_fail.Rproj rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/simple_some_tests_fail.Rproj diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/tests/testthat/testMain.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/tests/testthat/testMain.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/tests/testthat/testMain.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_some_tests_fail/tests/testthat/testMain.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/R/main.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/R/main.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/R/main.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/R/main.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/simple_sourcing_fail.Rproj b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/simple_sourcing_fail.Rproj similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/simple_sourcing_fail.Rproj rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/simple_sourcing_fail.Rproj diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/tests/testthat/testMain.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/tests/testthat/testMain.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/tests/testthat/testMain.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/resources/simple_sourcing_fail/tests/testthat/testMain.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/testGetAvailablePoints.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/testGetAvailablePoints.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/testGetAvailablePoints.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/testGetAvailablePoints.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/testResultsCreator.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/testResultsCreator.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/testResultsCreator.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/testResultsCreator.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/testRunTests.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/testRunTests.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/testRunTests.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/testRunTests.R diff --git a/plugins/r/tests/tmcRtestrunner/tests/testthat/testTestEnvironment.R b/crates/plugins/r/tests/tmcRtestrunner/tests/testthat/testTestEnvironment.R similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tests/testthat/testTestEnvironment.R rename to crates/plugins/r/tests/tmcRtestrunner/tests/testthat/testTestEnvironment.R diff --git a/plugins/r/tests/tmcRtestrunner/tmcRtestrunner.Rproj b/crates/plugins/r/tests/tmcRtestrunner/tmcRtestrunner.Rproj similarity index 100% rename from plugins/r/tests/tmcRtestrunner/tmcRtestrunner.Rproj rename to crates/plugins/r/tests/tmcRtestrunner/tmcRtestrunner.Rproj diff --git a/tmc-client/.gitignore b/crates/tmc-client/.gitignore similarity index 100% rename from tmc-client/.gitignore rename to crates/tmc-client/.gitignore diff --git a/tmc-client/Cargo.toml b/crates/tmc-client/Cargo.toml similarity index 90% rename from tmc-client/Cargo.toml rename to crates/tmc-client/Cargo.toml index 6a10c4e9d31..869839f78aa 100644 --- a/tmc-client/Cargo.toml +++ b/crates/tmc-client/Cargo.toml @@ -7,8 +7,8 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-plugins = { path = "../tmc-langs-plugins" } -tmc-langs-util = { path = "../tmc-langs-util" } +tmc-langs-plugins.workspace = true +tmc-langs-util.workspace = true chrono = { version = "0.4.19", features = ["serde"] } dirs = "4.0.0" diff --git a/tmc-client/README.md b/crates/tmc-client/README.md similarity index 100% rename from tmc-client/README.md rename to crates/tmc-client/README.md diff --git a/tmc-client/src/error.rs b/crates/tmc-client/src/error.rs similarity index 100% rename from tmc-client/src/error.rs rename to crates/tmc-client/src/error.rs diff --git a/tmc-client/src/lib.rs b/crates/tmc-client/src/lib.rs similarity index 100% rename from tmc-client/src/lib.rs rename to crates/tmc-client/src/lib.rs diff --git a/tmc-client/src/request.rs b/crates/tmc-client/src/request.rs similarity index 100% rename from tmc-client/src/request.rs rename to crates/tmc-client/src/request.rs diff --git a/tmc-client/src/response.rs b/crates/tmc-client/src/response.rs similarity index 100% rename from tmc-client/src/response.rs rename to crates/tmc-client/src/response.rs diff --git a/tmc-client/src/tmc_client.rs b/crates/tmc-client/src/tmc_client.rs similarity index 100% rename from tmc-client/src/tmc_client.rs rename to crates/tmc-client/src/tmc_client.rs diff --git a/tmc-client/src/tmc_client/api_v8.rs b/crates/tmc-client/src/tmc_client/api_v8.rs similarity index 100% rename from tmc-client/src/tmc_client/api_v8.rs rename to crates/tmc-client/src/tmc_client/api_v8.rs diff --git a/tmc-client/tests/api_integration.rs b/crates/tmc-client/tests/api_integration.rs similarity index 100% rename from tmc-client/tests/api_integration.rs rename to crates/tmc-client/tests/api_integration.rs diff --git a/tmc-client/tests/data/part01-Part01_01.Sandbox.zip b/crates/tmc-client/tests/data/part01-Part01_01.Sandbox.zip similarity index 100% rename from tmc-client/tests/data/part01-Part01_01.Sandbox.zip rename to crates/tmc-client/tests/data/part01-Part01_01.Sandbox.zip diff --git a/tmc-langs-cli/.gitignore b/crates/tmc-langs-cli/.gitignore similarity index 100% rename from tmc-langs-cli/.gitignore rename to crates/tmc-langs-cli/.gitignore diff --git a/tmc-langs-cli/Cargo.toml b/crates/tmc-langs-cli/Cargo.toml similarity index 88% rename from tmc-langs-cli/Cargo.toml rename to crates/tmc-langs-cli/Cargo.toml index edce6401561..edba61d20a5 100644 --- a/tmc-langs-cli/Cargo.toml +++ b/crates/tmc-langs-cli/Cargo.toml @@ -9,8 +9,8 @@ rust-version.workspace = true default-run = "tmc-langs-cli" [dependencies] -tmc-langs = { path = "../tmc-langs" } -tmc-langs-util = { path = "../tmc-langs-util" } +tmc-langs.workspace = true +tmc-langs-util.workspace = true anyhow = "1.0.53" base64 = "0.13.0" diff --git a/tmc-langs-cli/README.md b/crates/tmc-langs-cli/README.md similarity index 100% rename from tmc-langs-cli/README.md rename to crates/tmc-langs-cli/README.md diff --git a/tmc-langs-cli/api/output-data-download-or-update.json b/crates/tmc-langs-cli/api/output-data-download-or-update.json similarity index 100% rename from tmc-langs-cli/api/output-data-download-or-update.json rename to crates/tmc-langs-cli/api/output-data-download-or-update.json diff --git a/tmc-langs-cli/api/output-data-error.json b/crates/tmc-langs-cli/api/output-data-error.json similarity index 100% rename from tmc-langs-cli/api/output-data-error.json rename to crates/tmc-langs-cli/api/output-data-error.json diff --git a/tmc-langs-cli/api/output-data-none.json b/crates/tmc-langs-cli/api/output-data-none.json similarity index 100% rename from tmc-langs-cli/api/output-data-none.json rename to crates/tmc-langs-cli/api/output-data-none.json diff --git a/tmc-langs-cli/api/status-update.json b/crates/tmc-langs-cli/api/status-update.json similarity index 100% rename from tmc-langs-cli/api/status-update.json rename to crates/tmc-langs-cli/api/status-update.json diff --git a/tmc-langs-cli/api/warnings.json b/crates/tmc-langs-cli/api/warnings.json similarity index 100% rename from tmc-langs-cli/api/warnings.json rename to crates/tmc-langs-cli/api/warnings.json diff --git a/tmc-langs-cli/src/app.rs b/crates/tmc-langs-cli/src/app.rs similarity index 100% rename from tmc-langs-cli/src/app.rs rename to crates/tmc-langs-cli/src/app.rs diff --git a/tmc-langs-cli/src/error.rs b/crates/tmc-langs-cli/src/error.rs similarity index 100% rename from tmc-langs-cli/src/error.rs rename to crates/tmc-langs-cli/src/error.rs diff --git a/tmc-langs-cli/src/lib.rs b/crates/tmc-langs-cli/src/lib.rs similarity index 100% rename from tmc-langs-cli/src/lib.rs rename to crates/tmc-langs-cli/src/lib.rs diff --git a/tmc-langs-cli/src/main.rs b/crates/tmc-langs-cli/src/main.rs similarity index 100% rename from tmc-langs-cli/src/main.rs rename to crates/tmc-langs-cli/src/main.rs diff --git a/tmc-langs-cli/src/output.rs b/crates/tmc-langs-cli/src/output.rs similarity index 100% rename from tmc-langs-cli/src/output.rs rename to crates/tmc-langs-cli/src/output.rs diff --git a/tmc-langs-framework/Cargo.toml b/crates/tmc-langs-framework/Cargo.toml similarity index 95% rename from tmc-langs-framework/Cargo.toml rename to crates/tmc-langs-framework/Cargo.toml index 03b363db5e2..eacab9f4a0a 100644 --- a/tmc-langs-framework/Cargo.toml +++ b/crates/tmc-langs-framework/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-util = { path = "../tmc-langs-util" } +tmc-langs-util.workspace = true fd-lock = "3.0.3" isolang = "2.1.0" diff --git a/tmc-langs-framework/README.md b/crates/tmc-langs-framework/README.md similarity index 100% rename from tmc-langs-framework/README.md rename to crates/tmc-langs-framework/README.md diff --git a/tmc-langs-framework/src/archive.rs b/crates/tmc-langs-framework/src/archive.rs similarity index 100% rename from tmc-langs-framework/src/archive.rs rename to crates/tmc-langs-framework/src/archive.rs diff --git a/tmc-langs-framework/src/command.rs b/crates/tmc-langs-framework/src/command.rs similarity index 100% rename from tmc-langs-framework/src/command.rs rename to crates/tmc-langs-framework/src/command.rs diff --git a/tmc-langs-framework/src/domain.rs b/crates/tmc-langs-framework/src/domain.rs similarity index 100% rename from tmc-langs-framework/src/domain.rs rename to crates/tmc-langs-framework/src/domain.rs diff --git a/tmc-langs-framework/src/error.rs b/crates/tmc-langs-framework/src/error.rs similarity index 100% rename from tmc-langs-framework/src/error.rs rename to crates/tmc-langs-framework/src/error.rs diff --git a/tmc-langs-framework/src/lib.rs b/crates/tmc-langs-framework/src/lib.rs similarity index 100% rename from tmc-langs-framework/src/lib.rs rename to crates/tmc-langs-framework/src/lib.rs diff --git a/tmc-langs-framework/src/meta_syntax.rs b/crates/tmc-langs-framework/src/meta_syntax.rs similarity index 100% rename from tmc-langs-framework/src/meta_syntax.rs rename to crates/tmc-langs-framework/src/meta_syntax.rs diff --git a/tmc-langs-framework/src/plugin.rs b/crates/tmc-langs-framework/src/plugin.rs similarity index 100% rename from tmc-langs-framework/src/plugin.rs rename to crates/tmc-langs-framework/src/plugin.rs diff --git a/tmc-langs-framework/src/policy.rs b/crates/tmc-langs-framework/src/policy.rs similarity index 100% rename from tmc-langs-framework/src/policy.rs rename to crates/tmc-langs-framework/src/policy.rs diff --git a/tmc-langs-framework/src/tmc_project_yml.rs b/crates/tmc-langs-framework/src/tmc_project_yml.rs similarity index 100% rename from tmc-langs-framework/src/tmc_project_yml.rs rename to crates/tmc-langs-framework/src/tmc_project_yml.rs diff --git a/tmc-langs-plugins/Cargo.toml b/crates/tmc-langs-plugins/Cargo.toml similarity index 56% rename from tmc-langs-plugins/Cargo.toml rename to crates/tmc-langs-plugins/Cargo.toml index 4781db8a305..6dd3785990e 100644 --- a/tmc-langs-plugins/Cargo.toml +++ b/crates/tmc-langs-plugins/Cargo.toml @@ -7,15 +7,15 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-framework = { path = "../tmc-langs-framework" } -tmc-langs-util = { path = "../tmc-langs-util" } +tmc-langs-framework.workspace = true +tmc-langs-util.workspace = true -tmc-langs-csharp = { path = "../plugins/csharp" } -tmc-langs-java = { path = "../plugins/java" } -tmc-langs-make = { path = "../plugins/make" } -tmc-langs-notests = { path = "../plugins/notests" } -tmc-langs-python3 = { path = "../plugins/python3" } -tmc-langs-r = { path = "../plugins/r" } +tmc-langs-csharp.workspace = true +tmc-langs-java.workspace = true +tmc-langs-make.workspace = true +tmc-langs-notests.workspace = true +tmc-langs-python3.workspace = true +tmc-langs-r.workspace = true impl-enum = "0.3.0" log = "0.4.14" diff --git a/tmc-langs-plugins/README.md b/crates/tmc-langs-plugins/README.md similarity index 100% rename from tmc-langs-plugins/README.md rename to crates/tmc-langs-plugins/README.md diff --git a/tmc-langs-plugins/src/archive.rs b/crates/tmc-langs-plugins/src/archive.rs similarity index 100% rename from tmc-langs-plugins/src/archive.rs rename to crates/tmc-langs-plugins/src/archive.rs diff --git a/tmc-langs-plugins/src/compression.rs b/crates/tmc-langs-plugins/src/compression.rs similarity index 100% rename from tmc-langs-plugins/src/compression.rs rename to crates/tmc-langs-plugins/src/compression.rs diff --git a/tmc-langs-plugins/src/error.rs b/crates/tmc-langs-plugins/src/error.rs similarity index 100% rename from tmc-langs-plugins/src/error.rs rename to crates/tmc-langs-plugins/src/error.rs diff --git a/tmc-langs-plugins/src/lib.rs b/crates/tmc-langs-plugins/src/lib.rs similarity index 100% rename from tmc-langs-plugins/src/lib.rs rename to crates/tmc-langs-plugins/src/lib.rs diff --git a/tmc-langs-plugins/tests/data/zip/compressed.zip b/crates/tmc-langs-plugins/tests/data/zip/compressed.zip similarity index 100% rename from tmc-langs-plugins/tests/data/zip/compressed.zip rename to crates/tmc-langs-plugins/tests/data/zip/compressed.zip diff --git a/tmc-langs-plugins/tests/data/zip/course-module-trivial.zip b/crates/tmc-langs-plugins/tests/data/zip/course-module-trivial.zip similarity index 100% rename from tmc-langs-plugins/tests/data/zip/course-module-trivial.zip rename to crates/tmc-langs-plugins/tests/data/zip/course-module-trivial.zip diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/.project b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/.project similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/.project rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/.project diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/.tmcproject.yml b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/.tmcproject.yml similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/.tmcproject.yml rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/.tmcproject.yml diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/pom.xml b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/pom.xml similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/pom.xml rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/pom.xml diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/src/main/java/AdaLovelace.java b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/src/main/java/AdaLovelace.java similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/src/main/java/AdaLovelace.java rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/src/main/java/AdaLovelace.java diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/src/test/java/AdaLovelaceTest.java b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/src/test/java/AdaLovelaceTest.java similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/src/test/java/AdaLovelaceTest.java rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/src/test/java/AdaLovelaceTest.java diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/target/classes/AdaLovelace.class b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/classes/AdaLovelace.class similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/target/classes/AdaLovelace.class rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/classes/AdaLovelace.class diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/target/stderr.txt b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/stderr.txt similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/target/stderr.txt rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/stderr.txt diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/target/stdout.txt b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/stdout.txt similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/target/stdout.txt rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/stdout.txt diff --git a/tmc-langs-plugins/tests/data/zip/exercise-name/target/test-classes/AdaLovelaceTest.class b/crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/test-classes/AdaLovelaceTest.class similarity index 100% rename from tmc-langs-plugins/tests/data/zip/exercise-name/target/test-classes/AdaLovelaceTest.class rename to crates/tmc-langs-plugins/tests/data/zip/exercise-name/target/test-classes/AdaLovelaceTest.class diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial.zip b/crates/tmc-langs-plugins/tests/data/zip/module-trivial.zip similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial.zip rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial.zip diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/.gitignore b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/.gitignore similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/.gitignore rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/.gitignore diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/build.xml b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/build.xml similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/build.xml rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/build.xml diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/lib/edu-test-utils-0.4.1.jar b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/lib/edu-test-utils-0.4.1.jar similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/lib/edu-test-utils-0.4.1.jar rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/lib/edu-test-utils-0.4.1.jar diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/lib/junit-4.10.jar b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/lib/junit-4.10.jar similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/lib/junit-4.10.jar rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/lib/junit-4.10.jar diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/manifest.mf b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/manifest.mf similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/manifest.mf rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/manifest.mf diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/build-impl.xml b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/build-impl.xml similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/build-impl.xml rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/build-impl.xml diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/genfiles.properties b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/genfiles.properties similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/genfiles.properties rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/genfiles.properties diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/project.properties b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/project.properties similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/project.properties rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/project.properties diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/project.xml b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/project.xml similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/project.xml rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/nbproject/project.xml diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/src/.gitkeep b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/src/.gitkeep similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/src/.gitkeep rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/src/.gitkeep diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/src/Trivial.java b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/src/Trivial.java similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/src/Trivial.java rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/src/Trivial.java diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/test/.gitkeep b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/test/.gitkeep similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/test/.gitkeep rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/test/.gitkeep diff --git a/tmc-langs-plugins/tests/data/zip/module-trivial/test/TrivialTest.java b/crates/tmc-langs-plugins/tests/data/zip/module-trivial/test/TrivialTest.java similarity index 100% rename from tmc-langs-plugins/tests/data/zip/module-trivial/test/TrivialTest.java rename to crates/tmc-langs-plugins/tests/data/zip/module-trivial/test/TrivialTest.java diff --git a/tmc-langs-plugins/tests/data/zip/no-src-entry.zip b/crates/tmc-langs-plugins/tests/data/zip/no-src-entry.zip similarity index 100% rename from tmc-langs-plugins/tests/data/zip/no-src-entry.zip rename to crates/tmc-langs-plugins/tests/data/zip/no-src-entry.zip diff --git a/tmc-langs-util/Cargo.toml b/crates/tmc-langs-util/Cargo.toml similarity index 100% rename from tmc-langs-util/Cargo.toml rename to crates/tmc-langs-util/Cargo.toml diff --git a/tmc-langs-util/README.md b/crates/tmc-langs-util/README.md similarity index 100% rename from tmc-langs-util/README.md rename to crates/tmc-langs-util/README.md diff --git a/tmc-langs-util/src/deserialize.rs b/crates/tmc-langs-util/src/deserialize.rs similarity index 100% rename from tmc-langs-util/src/deserialize.rs rename to crates/tmc-langs-util/src/deserialize.rs diff --git a/tmc-langs-util/src/error.rs b/crates/tmc-langs-util/src/error.rs similarity index 100% rename from tmc-langs-util/src/error.rs rename to crates/tmc-langs-util/src/error.rs diff --git a/tmc-langs-util/src/file_util.rs b/crates/tmc-langs-util/src/file_util.rs similarity index 100% rename from tmc-langs-util/src/file_util.rs rename to crates/tmc-langs-util/src/file_util.rs diff --git a/tmc-langs-util/src/file_util/lock_unix.rs b/crates/tmc-langs-util/src/file_util/lock_unix.rs similarity index 100% rename from tmc-langs-util/src/file_util/lock_unix.rs rename to crates/tmc-langs-util/src/file_util/lock_unix.rs diff --git a/tmc-langs-util/src/file_util/lock_windows.rs b/crates/tmc-langs-util/src/file_util/lock_windows.rs similarity index 100% rename from tmc-langs-util/src/file_util/lock_windows.rs rename to crates/tmc-langs-util/src/file_util/lock_windows.rs diff --git a/tmc-langs-util/src/lib.rs b/crates/tmc-langs-util/src/lib.rs similarity index 100% rename from tmc-langs-util/src/lib.rs rename to crates/tmc-langs-util/src/lib.rs diff --git a/tmc-langs-util/src/notification_reporter.rs b/crates/tmc-langs-util/src/notification_reporter.rs similarity index 100% rename from tmc-langs-util/src/notification_reporter.rs rename to crates/tmc-langs-util/src/notification_reporter.rs diff --git a/tmc-langs-util/src/parse_util.rs b/crates/tmc-langs-util/src/parse_util.rs similarity index 100% rename from tmc-langs-util/src/parse_util.rs rename to crates/tmc-langs-util/src/parse_util.rs diff --git a/tmc-langs-util/src/path_util.rs b/crates/tmc-langs-util/src/path_util.rs similarity index 100% rename from tmc-langs-util/src/path_util.rs rename to crates/tmc-langs-util/src/path_util.rs diff --git a/tmc-langs-util/src/progress_reporter.rs b/crates/tmc-langs-util/src/progress_reporter.rs similarity index 100% rename from tmc-langs-util/src/progress_reporter.rs rename to crates/tmc-langs-util/src/progress_reporter.rs diff --git a/tmc-langs/Cargo.toml b/crates/tmc-langs/Cargo.toml similarity index 86% rename from tmc-langs/Cargo.toml rename to crates/tmc-langs/Cargo.toml index e3b7695d9b6..c1d6a0dee4a 100644 --- a/tmc-langs/Cargo.toml +++ b/crates/tmc-langs/Cargo.toml @@ -7,10 +7,10 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-client = { path = "../tmc-client" } -tmc-langs-plugins = { path = "../tmc-langs-plugins" } -tmc-langs-framework = { path = "../tmc-langs-framework" } -tmc-langs-util = { path = "../tmc-langs-util" } +tmc-client.workspace = true +tmc-langs-plugins.workspace = true +tmc-langs-framework.workspace = true +tmc-langs-util.workspace = true base64 = "0.13.0" dirs = "4.0.0" diff --git a/tmc-langs/README.md b/crates/tmc-langs/README.md similarity index 100% rename from tmc-langs/README.md rename to crates/tmc-langs/README.md diff --git a/tmc-langs/src/config.rs b/crates/tmc-langs/src/config.rs similarity index 100% rename from tmc-langs/src/config.rs rename to crates/tmc-langs/src/config.rs diff --git a/tmc-langs/src/config/credentials.rs b/crates/tmc-langs/src/config/credentials.rs similarity index 100% rename from tmc-langs/src/config/credentials.rs rename to crates/tmc-langs/src/config/credentials.rs diff --git a/tmc-langs/src/config/projects_config.rs b/crates/tmc-langs/src/config/projects_config.rs similarity index 100% rename from tmc-langs/src/config/projects_config.rs rename to crates/tmc-langs/src/config/projects_config.rs diff --git a/tmc-langs/src/config/tmc_config.rs b/crates/tmc-langs/src/config/tmc_config.rs similarity index 100% rename from tmc-langs/src/config/tmc_config.rs rename to crates/tmc-langs/src/config/tmc_config.rs diff --git a/tmc-langs/src/course_refresher.rs b/crates/tmc-langs/src/course_refresher.rs similarity index 100% rename from tmc-langs/src/course_refresher.rs rename to crates/tmc-langs/src/course_refresher.rs diff --git a/tmc-langs/src/data.rs b/crates/tmc-langs/src/data.rs similarity index 100% rename from tmc-langs/src/data.rs rename to crates/tmc-langs/src/data.rs diff --git a/tmc-langs/src/error.rs b/crates/tmc-langs/src/error.rs similarity index 100% rename from tmc-langs/src/error.rs rename to crates/tmc-langs/src/error.rs diff --git a/tmc-langs/src/lib.rs b/crates/tmc-langs/src/lib.rs similarity index 100% rename from tmc-langs/src/lib.rs rename to crates/tmc-langs/src/lib.rs diff --git a/tmc-langs/src/submission_packaging.rs b/crates/tmc-langs/src/submission_packaging.rs similarity index 100% rename from tmc-langs/src/submission_packaging.rs rename to crates/tmc-langs/src/submission_packaging.rs diff --git a/tmc-langs/src/submission_processing.rs b/crates/tmc-langs/src/submission_processing.rs similarity index 100% rename from tmc-langs/src/submission_processing.rs rename to crates/tmc-langs/src/submission_processing.rs diff --git a/tmc-langs/tests/data/MakeExercise.zip b/crates/tmc-langs/tests/data/MakeExercise.zip similarity index 100% rename from tmc-langs/tests/data/MakeExercise.zip rename to crates/tmc-langs/tests/data/MakeExercise.zip diff --git a/tmc-langs/tests/data/MavenExercise.zip b/crates/tmc-langs/tests/data/MavenExercise.zip similarity index 100% rename from tmc-langs/tests/data/MavenExercise.zip rename to crates/tmc-langs/tests/data/MavenExercise.zip diff --git a/tmc-langs/tests/data/MavenStub.zip b/crates/tmc-langs/tests/data/MavenStub.zip similarity index 100% rename from tmc-langs/tests/data/MavenStub.zip rename to crates/tmc-langs/tests/data/MavenStub.zip diff --git a/tmc-langs/tests/data/PythonExercise.zip b/crates/tmc-langs/tests/data/PythonExercise.zip similarity index 100% rename from tmc-langs/tests/data/PythonExercise.zip rename to crates/tmc-langs/tests/data/PythonExercise.zip diff --git a/tmc-langs/tests/data/some_course/MakeExercise/Makefile b/crates/tmc-langs/tests/data/some_course/MakeExercise/Makefile similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/Makefile rename to crates/tmc-langs/tests/data/some_course/MakeExercise/Makefile diff --git a/tmc-langs/tests/data/some_course/MakeExercise/src/Makefile b/crates/tmc-langs/tests/data/some_course/MakeExercise/src/Makefile similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/src/Makefile rename to crates/tmc-langs/tests/data/some_course/MakeExercise/src/Makefile diff --git a/tmc-langs/tests/data/some_course/MakeExercise/src/main.c b/crates/tmc-langs/tests/data/some_course/MakeExercise/src/main.c similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/src/main.c rename to crates/tmc-langs/tests/data/some_course/MakeExercise/src/main.c diff --git a/tmc-langs/tests/data/some_course/MakeExercise/src/source.c b/crates/tmc-langs/tests/data/some_course/MakeExercise/src/source.c similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/src/source.c rename to crates/tmc-langs/tests/data/some_course/MakeExercise/src/source.c diff --git a/tmc-langs/tests/data/some_course/MakeExercise/src/source.h b/crates/tmc-langs/tests/data/some_course/MakeExercise/src/source.h similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/src/source.h rename to crates/tmc-langs/tests/data/some_course/MakeExercise/src/source.h diff --git a/tmc-langs/tests/data/some_course/MakeExercise/test/Makefile b/crates/tmc-langs/tests/data/some_course/MakeExercise/test/Makefile similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/test/Makefile rename to crates/tmc-langs/tests/data/some_course/MakeExercise/test/Makefile diff --git a/tmc-langs/tests/data/some_course/MakeExercise/test/checkhelp.c b/crates/tmc-langs/tests/data/some_course/MakeExercise/test/checkhelp.c similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/test/checkhelp.c rename to crates/tmc-langs/tests/data/some_course/MakeExercise/test/checkhelp.c diff --git a/tmc-langs/tests/data/some_course/MakeExercise/test/test b/crates/tmc-langs/tests/data/some_course/MakeExercise/test/test similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/test/test rename to crates/tmc-langs/tests/data/some_course/MakeExercise/test/test diff --git a/tmc-langs/tests/data/some_course/MakeExercise/test/test_source.c b/crates/tmc-langs/tests/data/some_course/MakeExercise/test/test_source.c similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/test/test_source.c rename to crates/tmc-langs/tests/data/some_course/MakeExercise/test/test_source.c diff --git a/tmc-langs/tests/data/some_course/MakeExercise/test/tmc-check.c b/crates/tmc-langs/tests/data/some_course/MakeExercise/test/tmc-check.c similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/test/tmc-check.c rename to crates/tmc-langs/tests/data/some_course/MakeExercise/test/tmc-check.c diff --git a/tmc-langs/tests/data/some_course/MakeExercise/test/tmc-check.h b/crates/tmc-langs/tests/data/some_course/MakeExercise/test/tmc-check.h similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/test/tmc-check.h rename to crates/tmc-langs/tests/data/some_course/MakeExercise/test/tmc-check.h diff --git a/tmc-langs/tests/data/some_course/MakeExercise/test/tmc_available_points.txt b/crates/tmc-langs/tests/data/some_course/MakeExercise/test/tmc_available_points.txt similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/test/tmc_available_points.txt rename to crates/tmc-langs/tests/data/some_course/MakeExercise/test/tmc_available_points.txt diff --git a/tmc-langs/tests/data/some_course/MakeExercise/test/tmc_test_results.xml b/crates/tmc-langs/tests/data/some_course/MakeExercise/test/tmc_test_results.xml similarity index 100% rename from tmc-langs/tests/data/some_course/MakeExercise/test/tmc_test_results.xml rename to crates/tmc-langs/tests/data/some_course/MakeExercise/test/tmc_test_results.xml diff --git a/tmc-langs/tests/data/some_course/MavenExercise/.classpath b/crates/tmc-langs/tests/data/some_course/MavenExercise/.classpath similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/.classpath rename to crates/tmc-langs/tests/data/some_course/MavenExercise/.classpath diff --git a/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.core.resources.prefs b/crates/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.core.resources.prefs similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.core.resources.prefs rename to crates/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.core.resources.prefs diff --git a/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.jdt.apt.core.prefs b/crates/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.jdt.apt.core.prefs similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.jdt.apt.core.prefs rename to crates/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.jdt.apt.core.prefs diff --git a/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.jdt.core.prefs b/crates/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.jdt.core.prefs rename to crates/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.jdt.core.prefs diff --git a/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.m2e.core.prefs b/crates/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.m2e.core.prefs similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.m2e.core.prefs rename to crates/tmc-langs/tests/data/some_course/MavenExercise/.settings/org.eclipse.m2e.core.prefs diff --git a/tmc-langs/tests/data/some_course/MavenExercise/__MACOSX/some mac file b/crates/tmc-langs/tests/data/some_course/MavenExercise/__MACOSX/some mac file similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/__MACOSX/some mac file rename to crates/tmc-langs/tests/data/some_course/MavenExercise/__MACOSX/some mac file diff --git a/tmc-langs/tests/data/some_course/MavenExercise/desktop.ini b/crates/tmc-langs/tests/data/some_course/MavenExercise/desktop.ini similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/desktop.ini rename to crates/tmc-langs/tests/data/some_course/MavenExercise/desktop.ini diff --git a/tmc-langs/tests/data/some_course/MavenExercise/pom.xml b/crates/tmc-langs/tests/data/some_course/MavenExercise/pom.xml similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/pom.xml rename to crates/tmc-langs/tests/data/some_course/MavenExercise/pom.xml diff --git a/tmc-langs/tests/data/some_course/MavenExercise/src/main/java/SimpleStuff.java b/crates/tmc-langs/tests/data/some_course/MavenExercise/src/main/java/SimpleStuff.java similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/src/main/java/SimpleStuff.java rename to crates/tmc-langs/tests/data/some_course/MavenExercise/src/main/java/SimpleStuff.java diff --git a/tmc-langs/tests/data/some_course/MavenExercise/src/test/java/SimpleHiddenTest.java b/crates/tmc-langs/tests/data/some_course/MavenExercise/src/test/java/SimpleHiddenTest.java similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/src/test/java/SimpleHiddenTest.java rename to crates/tmc-langs/tests/data/some_course/MavenExercise/src/test/java/SimpleHiddenTest.java diff --git a/tmc-langs/tests/data/some_course/MavenExercise/src/test/java/SimpleTest.java b/crates/tmc-langs/tests/data/some_course/MavenExercise/src/test/java/SimpleTest.java similarity index 100% rename from tmc-langs/tests/data/some_course/MavenExercise/src/test/java/SimpleTest.java rename to crates/tmc-langs/tests/data/some_course/MavenExercise/src/test/java/SimpleTest.java diff --git a/tmc-langs/tests/data/some_course/PythonExercise/__init__.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/__init__.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/__init__.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/__init__.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/src/__init__.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/src/__init__.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/src/__init__.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/src/__init__.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/src/__main__.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/src/__main__.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/src/__main__.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/src/__main__.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/src/greeter.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/src/greeter.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/src/greeter.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/src/greeter.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/src/lastiruuma.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/src/lastiruuma.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/src/lastiruuma.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/src/lastiruuma.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/src/matkalaukku.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/src/matkalaukku.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/src/matkalaukku.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/src/matkalaukku.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/src/tavara.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/src/tavara.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/src/tavara.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/src/tavara.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/test/__init__.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/test/__init__.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/test/__init__.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/test/__init__.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/test/test_greeter.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/test/test_greeter.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/test/test_greeter.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/test/test_greeter.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/test/test_lastiruuma.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/test/test_lastiruuma.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/test/test_lastiruuma.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/test/test_lastiruuma.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/test/test_matkalaukku.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/test/test_matkalaukku.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/test/test_matkalaukku.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/test/test_matkalaukku.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/test/test_tavara.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/test/test_tavara.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/test/test_tavara.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/test/test_tavara.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/__init__.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__init__.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/__init__.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__init__.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/__main__.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__main__.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/__main__.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__main__.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/__init__.cpython-38.pyc b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/__init__.cpython-38.pyc similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/__init__.cpython-38.pyc rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/__init__.cpython-38.pyc diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/__main__.cpython-38.pyc b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/__main__.cpython-38.pyc similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/__main__.cpython-38.pyc rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/__main__.cpython-38.pyc diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/points.cpython-38.pyc b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/points.cpython-38.pyc similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/points.cpython-38.pyc rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/points.cpython-38.pyc diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/result.cpython-38.pyc b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/result.cpython-38.pyc similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/result.cpython-38.pyc rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/result.cpython-38.pyc diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/runner.cpython-38.pyc b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/runner.cpython-38.pyc similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/runner.cpython-38.pyc rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/__pycache__/runner.cpython-38.pyc diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/points.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/points.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/points.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/points.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/result.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/result.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/result.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/result.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/runner.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/runner.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/runner.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/runner.py diff --git a/tmc-langs/tests/data/some_course/PythonExercise/tmc/utils.py b/crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/utils.py similarity index 100% rename from tmc-langs/tests/data/some_course/PythonExercise/tmc/utils.py rename to crates/tmc-langs/tests/data/some_course/PythonExercise/tmc/utils.py From c4fc480f3a1d6e7ceacc2ca56ae458902f98e4f9 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Fri, 30 Sep 2022 18:56:21 +0300 Subject: [PATCH 07/15] Added Dockerfile --- CONTRIBUTING.md | 12 ++++++++++-- docker/Dockerfile | 28 ++++++++++++++++++++++++++++ docker/Dockerfile.dockerignore | 4 ++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 docker/Dockerfile create mode 100644 docker/Dockerfile.dockerignore diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2a4c33b6870..b27ae4aa88a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ cargo build If you have any troubles building the project, please do make an issue! -## Testing +## Testing without Docker Install [zstd 1.5.2](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. @@ -24,7 +24,7 @@ Install [.NET 6.0](https://dotnet.microsoft.com/download). Install [check](https://libcheck.github.io/check/) (works with at least 0.14 and 0.15), [valgrind](https://valgrind.org/) and `libsubunit0` (or equivalent for your distribution). -Install [R](https://www.r-project.org/), [devtools](https://devtools.r-lib.org/) by running `install.packages("devtools")` in `R` and [tmc-r-tester](https://github.com/testmycode/tmc-rstudio) by running `devtools::install_github("testmycode/tmc-r-tester/tmcRtestrunner", build = FALSE)` in `R`. `devtools` has several dependencies that need to be installed. For Ubuntu, they can be installed with +Install [R](https://www.r-project.org/), [devtools](https://devtools.r-lib.org/) by running `R -e 'install.packages("devtools")'` and [tmc-r-tester](https://github.com/testmycode/tmc-rstudio) by running `R -e 'devtools::install_github("testmycode/tmc-r-tester/tmcRtestrunner", build = FALSE)'`. `devtools` has several dependencies that need to be installed. For Ubuntu, they can be installed with ```bash sudo apt install libcurl-dev libxml2-dev libopenssl-dev gcc-c++ libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev @@ -36,6 +36,14 @@ With the dependencies instaled, the tests can be run with cargo test ``` +## Testing with Docker +```bash +export DOCKER_BUILDKIT=1 +docker build . -f docker/Dockerfile -t tmc-langs-rust +docker run --rm -it tmc-langs-rust bash +cargo test +``` + ## Formatting and linting 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. diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000000..299d5766783 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,28 @@ +FROM rust:slim-buster + +# C# https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian +RUN apt update \ + && apt install -y wget \ + && wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ + && dpkg -i packages-microsoft-prod.deb \ + && rm packages-microsoft-prod.deb + +# install deps +RUN apt update \ + && apt install -y \ + # core libraries + libzstd-dev \ + # languages + npm \ + python3 \ + openjdk-11-jdk \ + dotnet-sdk-6.0 \ + check valgrind \ + r-base r-cran-devtools \ + # https://github.com/testmycode/tmc-r-tester/ + && R -e 'devtools::install_github("testmycode/tmc-r-tester/tmcRtestrunner", build = FALSE)' + +COPY . /build +WORKDIR /build + +RUN cargo check --tests --all-features diff --git a/docker/Dockerfile.dockerignore b/docker/Dockerfile.dockerignore new file mode 100644 index 00000000000..46b9c232cbe --- /dev/null +++ b/docker/Dockerfile.dockerignore @@ -0,0 +1,4 @@ +**/.git +**/target +**/node_modules +**/*.node From 654c0187fa17af19e7c3f25f65e9560d4d17a239 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Mon, 3 Oct 2022 06:00:48 +0300 Subject: [PATCH 08/15] Fixed test --- crates/bindings/tmc-langs-node/jest/tmc.test.ts | 5 ++--- crates/tmc-langs-cli/src/app.rs | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bindings/tmc-langs-node/jest/tmc.test.ts b/crates/bindings/tmc-langs-node/jest/tmc.test.ts index f6188f308a7..4f2bdd3ece6 100644 --- a/crates/bindings/tmc-langs-node/jest/tmc.test.ts +++ b/crates/bindings/tmc-langs-node/jest/tmc.test.ts @@ -174,9 +174,8 @@ test("gets exercise packaging configuration", async () => { const dir = await mockExercise(); const config = tmc.getExercisePackagingConfiguration(dir); - expect(config.student_file_paths[0]).toEqual("src"); - expect(config.exercise_file_paths).toContain("test"); - expect(config.exercise_file_paths).toContain("tmc"); + expect(config.student_file_paths).toContain("src/main.py"); + expect(config.exercise_file_paths).toContain("test/test.py"); }); test("lists local course exercises", async () => { diff --git a/crates/tmc-langs-cli/src/app.rs b/crates/tmc-langs-cli/src/app.rs index a1005c6226b..4f2235cfac2 100644 --- a/crates/tmc-langs-cli/src/app.rs +++ b/crates/tmc-langs-cli/src/app.rs @@ -15,6 +15,7 @@ use tmc_langs::{ #[derive(Parser)] #[clap( + name = env!("CARGO_PKG_NAME"), version, author, about, From 383a62cb22830c5d2f8c377115b0929975185271 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Tue, 4 Oct 2022 04:03:41 +0300 Subject: [PATCH 09/15] Added anyhow backtrace --- Cargo.lock | 48 +++++++++++++++++++++++++++++++++ crates/tmc-langs-cli/Cargo.toml | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index d53a260ed57..0168dc5b06f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,15 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -58,6 +67,9 @@ name = "anyhow" version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" +dependencies = [ + "backtrace", +] [[package]] name = "assert-json-diff" @@ -194,6 +206,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.13.0" @@ -721,6 +748,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" + [[package]] name = "glob" version = "0.2.11" @@ -1260,6 +1293,15 @@ dependencies = [ "url", ] +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.15.0" @@ -1567,6 +1609,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + [[package]] name = "rustc-hash" version = "1.1.0" diff --git a/crates/tmc-langs-cli/Cargo.toml b/crates/tmc-langs-cli/Cargo.toml index edba61d20a5..39c5103b916 100644 --- a/crates/tmc-langs-cli/Cargo.toml +++ b/crates/tmc-langs-cli/Cargo.toml @@ -12,7 +12,7 @@ default-run = "tmc-langs-cli" tmc-langs.workspace = true tmc-langs-util.workspace = true -anyhow = "1.0.53" +anyhow = { version = "1.0.53", features = ["backtrace"] } base64 = "0.13.0" clap = { version = "4.0.7", features = ["derive"] } dirs = "4.0.0" From 8ae486c283ca1d3878e175fa118a5ce9b167eced Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Tue, 4 Oct 2022 04:05:12 +0300 Subject: [PATCH 10/15] Update workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e461ba73da..08036865448 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,7 +73,7 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | Rscript -e 'install.packages(c("testthat", "jsonlite", "R.utils"))' - Rscript -e 'install.packages("plugins/r/tests/tmcRtestrunner", repos=NULL, type="source")' + Rscript -e 'install.packages("crates/plugins/r/tests/tmcRtestrunner", repos=NULL, type="source")' - name: Run tests run: cargo test --no-fail-fast From ebd5151862e8d5d78a881add6c323174f24abc72 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Tue, 11 Oct 2022 10:54:15 +0300 Subject: [PATCH 11/15] Add instructions for building a binary in Docker --- CONTRIBUTING.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b27ae4aa88a..b79425b7f83 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ cargo build If you have any troubles building the project, please do make an issue! -## Testing without Docker +## Testing Install [zstd 1.5.2](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. @@ -36,7 +36,14 @@ With the dependencies instaled, the tests can be run with cargo test ``` -## Testing with Docker +## Building and testing with Docker +Build the binary in Docker and copy it to the current directory (this can be useful to create a binary linked with an older glibc): +```bash +export DOCKER_BUILDKIT=1 +docker build . -f docker/Dockerfile -t tmc-langs-rust +docker run --rm -v $PWD:/build/out tmc-langs-rust bash -c "cargo build && cp /build/target/debug/tmc-langs-cli /build/out/" +``` +Run tests in Docker: ```bash export DOCKER_BUILDKIT=1 docker build . -f docker/Dockerfile -t tmc-langs-rust From 995799c928c69504fc3fec6bad160001aefccdb6 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Mon, 24 Oct 2022 07:16:43 +0300 Subject: [PATCH 12/15] Updated dependencies --- Cargo.lock | 356 +++++++++++++----- crates/bindings/tmc-langs-node/Cargo.toml | 11 +- crates/plugins/csharp/Cargo.toml | 8 +- crates/plugins/java/Cargo.toml | 8 +- crates/plugins/make/Cargo.toml | 4 +- crates/plugins/notests/Cargo.toml | 4 +- crates/plugins/python3/Cargo.toml | 4 +- crates/plugins/r/Cargo.toml | 4 +- crates/tmc-client/Cargo.toml | 8 +- crates/tmc-client/src/response.rs | 60 ++- crates/tmc-client/src/tmc_client.rs | 5 +- crates/tmc-langs-cli/Cargo.toml | 8 +- crates/tmc-langs-cli/src/lib.rs | 4 +- crates/tmc-langs-cli/src/output.rs | 9 +- crates/tmc-langs-framework/Cargo.toml | 10 +- crates/tmc-langs-framework/src/archive.rs | 4 +- crates/tmc-langs-framework/src/domain.rs | 20 +- .../src/tmc_project_yml.rs | 12 +- crates/tmc-langs-plugins/Cargo.toml | 4 +- crates/tmc-langs-util/Cargo.toml | 5 +- .../src/notification_reporter.rs | 2 + .../tmc-langs-util/src/progress_reporter.rs | 1 + crates/tmc-langs/Cargo.toml | 16 +- crates/tmc-langs/src/config/tmc_config.rs | 7 +- crates/tmc-langs/src/course_refresher.rs | 10 +- crates/tmc-langs/src/data.rs | 10 +- crates/tmc-langs/src/lib.rs | 4 +- crates/tmc-langs/src/submission_packaging.rs | 6 +- 28 files changed, 384 insertions(+), 220 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0168dc5b06f..3f76f2674b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -64,9 +64,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" dependencies = [ "backtrace", ] @@ -223,15 +223,15 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64ct" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2b2456fd614d856680dcd9fcc660a51a820fa09daef2e49772b56a193c8474" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" [[package]] name = "bitflags" @@ -273,9 +273,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "byteorder" @@ -379,9 +379,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.7" +version = "4.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1af219c3e254a8b4649d6ddaef886b2015089f35f2ac5e1db31410c0566ab8" +checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" dependencies = [ "atty", "bitflags", @@ -394,9 +394,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.7" +version = "4.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd114ae53ce5a0670f43d2f169c1cd26c69b4896b0c121900cf1e4d06d67316c" +checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" dependencies = [ "heck 0.4.0", "proc-macro-error", @@ -414,6 +414,16 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "colored" version = "2.0.0" @@ -483,6 +493,50 @@ dependencies = [ "typenum", ] +[[package]] +name = "cxx" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "digest" version = "0.9.0" @@ -540,9 +594,9 @@ checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] name = "dunce" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453440c271cf5577fd2a40e4942540cb7d0d2f85e27c8d07dd0023c925a67541" +checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" [[package]] name = "dyn-clone" @@ -616,19 +670,19 @@ checksum = "e11dcc7e4d79a8c89b9ab4c6f5c30b1fc4a83c420792da3542fd31179ed5f517" dependencies = [ "cfg-if", "rustix", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] name = "filetime" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -664,24 +718,24 @@ checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" [[package]] name = "futures-channel" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-io" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-lite" @@ -700,21 +754,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-util" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-core", "futures-io", @@ -737,9 +791,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "js-sys", @@ -903,17 +957,28 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" +checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" dependencies = [ "android_system_properties", "core-foundation-sys", + "iana-time-zone-haiku", "js-sys", "wasm-bindgen", "winapi", ] +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "idna" version = "0.3.0" @@ -957,9 +1022,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" +checksum = "e6e481ccbe3dea62107216d0d1138bb8ad8e5e5c43009a098bd1990272c497b0" [[package]] name = "ipnet" @@ -978,9 +1043,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "j4rs" @@ -1059,9 +1124,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.134" +version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] name = "libloading" @@ -1073,6 +1138,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + [[package]] name = "linux-raw-sys" version = "0.0.46" @@ -1149,7 +1223,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1393,9 +1467,9 @@ checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "polling" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899b00b9c8ab553c743b3e11e87c5c7d423b2a2de229ba95b24a756344748011" +checksum = "ab4609a838d88b73d8238967b60dd115cc08d38e2bbaf51ee1e4b695f89122e2" dependencies = [ "autocfg", "cfg-if", @@ -1437,9 +1511,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] @@ -1601,9 +1675,9 @@ dependencies = [ [[package]] name = "rpassword" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b763cb66df1c928432cc35053f8bd4cec3335d8559fc16010017d16b3c1680" +checksum = "20c9f5d2a0c3e2ea729ab3706d22217177770654c3ef5056b68b69d07332d3f5" dependencies = [ "libc", "winapi", @@ -1623,23 +1697,23 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.35.11" +version = "0.35.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb2fda4666def1433b1b05431ab402e42a1084285477222b72d6c564c417cef" +checksum = "985947f9b6423159c4726323f373be0a21bdb514c5af06a849cb3d2dce2d01e8" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] name = "rustls" -version = "0.20.6" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ "log", "ring", @@ -1673,9 +1747,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1847b767a3d62d95cbf3d8a9f0e421cf57a0d8aa4f411d4b16525afb0284d4ed" +checksum = "2a5fb6c61f29e723026dc8e923d94c694313212abbecbbe5f55a7748eec5b307" dependencies = [ "chrono", "dyn-clone", @@ -1686,9 +1760,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4d7e1b012cb3d9129567661a63755ea4b8a7386d339dc945ae187e403c6743" +checksum = "f188d036977451159430f3b8dc82ec76364a42b7e289c2b18a9a18f4470058e9" dependencies = [ "proc-macro2", "quote", @@ -1696,6 +1770,12 @@ dependencies = [ "syn", ] +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + [[package]] name = "sct" version = "0.7.0" @@ -1723,9 +1803,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.145" +version = "1.0.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" +checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" dependencies = [ "serde_derive", ] @@ -1744,9 +1824,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.145" +version = "1.0.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" +checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" dependencies = [ "proc-macro2", "quote", @@ -1766,9 +1846,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" dependencies = [ "itoa", "ryu", @@ -1798,9 +1878,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.13" +version = "0.9.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8613d593412a0deb7bbd8de9d908efff5a0cb9ccd8f62c641e7b2ed2f57291d1" +checksum = "6d232d893b10de3eb7258ff01974d6ee20663d8e833263c99409d4b13a0209da" dependencies = [ "indexmap", "itoa", @@ -1888,7 +1968,20 @@ dependencies = [ "atty", "colored", "log", - "time 0.3.14", + "time 0.3.15", + "winapi", +] + +[[package]] +name = "simple_logger" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc20708d703a44b96b3b700578a85b6fe887fc63ab20315757026bb8a12faaad" +dependencies = [ + "atty", + "colored", + "log", + "time 0.3.15", "winapi", ] @@ -1909,9 +2002,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "smol" @@ -2001,9 +2094,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.101" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", @@ -2097,9 +2190,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b" +checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" dependencies = [ "itoa", "libc", @@ -2146,7 +2239,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "simple_logger", + "simple_logger 3.0.0", "tempfile", "thiserror", "tmc-langs-plugins", @@ -2180,7 +2273,7 @@ dependencies = [ "serde_yaml", "sha2 0.10.6", "shellwords", - "simple_logger", + "simple_logger 3.0.0", "smol", "tar", "tempfile", @@ -2203,7 +2296,7 @@ version = "0.26.0" dependencies = [ "anyhow", "base64", - "clap 4.0.7", + "clap 4.0.18", "dirs 4.0.0", "env_logger", "log", @@ -2212,7 +2305,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "simple_logger", + "simple_logger 3.0.0", "smol", "structopt", "tempfile", @@ -2220,6 +2313,7 @@ dependencies = [ "tmc-langs", "tmc-langs-util", "toml", + "ts-rs", "url", "walkdir", ] @@ -2233,7 +2327,7 @@ dependencies = [ "once_cell", "serde", "serde_json", - "simple_logger", + "simple_logger 3.0.0", "tempfile", "thiserror", "tmc-langs-framework", @@ -2255,7 +2349,7 @@ dependencies = [ "schemars", "serde", "serde_yaml", - "simple_logger", + "simple_logger 3.0.0", "subprocess", "tar", "tempfile", @@ -2278,7 +2372,7 @@ dependencies = [ "once_cell", "serde", "serde_json", - "simple_logger", + "simple_logger 3.0.0", "tar", "tempfile", "thiserror", @@ -2298,7 +2392,7 @@ dependencies = [ "serde", "serde-xml-rs", "serde_yaml", - "simple_logger", + "simple_logger 3.0.0", "tempfile", "thiserror", "tmc-langs-framework", @@ -2318,7 +2412,7 @@ dependencies = [ "once_cell", "serde", "serde_json", - "simple_logger", + "simple_logger 2.3.0", "thiserror", "tmc-langs", "tmc-server-mock", @@ -2330,7 +2424,7 @@ name = "tmc-langs-notests" version = "0.1.0" dependencies = [ "log", - "simple_logger", + "simple_logger 3.0.0", "tempfile", "tmc-langs-framework", "tmc-langs-util", @@ -2343,7 +2437,7 @@ version = "0.1.0" dependencies = [ "impl-enum", "log", - "simple_logger", + "simple_logger 3.0.0", "tar", "tempfile", "thiserror", @@ -2374,7 +2468,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.6", - "simple_logger", + "simple_logger 3.0.0", "tempfile", "thiserror", "tmc-langs-framework", @@ -2390,7 +2484,7 @@ dependencies = [ "log", "serde", "serde_json", - "simple_logger", + "simple_logger 3.0.0", "tempfile", "thiserror", "tmc-langs-framework", @@ -2411,10 +2505,11 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_yaml", - "simple_logger", + "simple_logger 3.0.0", "tempfile", "thiserror", "toml", + "ts-rs", "type-map", "walkdir", "winapi", @@ -2487,9 +2582,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "pin-project-lite", @@ -2498,9 +2593,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", ] @@ -2514,16 +2609,17 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "ts-rs" version = "6.2.0" -source = "git+https://github.com/Heliozoa/ts-rs/?rev=f78e0c43b62266a49a227e20733aca6467970f13#f78e0c43b62266a49a227e20733aca6467970f13" +source = "git+https://github.com/Heliozoa/ts-rs.git?rev=7869099baa0fbeb155792ac986dbfc4c6d94136a#7869099baa0fbeb155792ac986dbfc4c6d94136a" dependencies = [ "thiserror", + "toml", "ts-rs-macros", ] [[package]] name = "ts-rs-macros" version = "6.2.0" -source = "git+https://github.com/Heliozoa/ts-rs/?rev=f78e0c43b62266a49a227e20733aca6467970f13#f78e0c43b62266a49a227e20733aca6467970f13" +source = "git+https://github.com/Heliozoa/ts-rs.git?rev=7869099baa0fbeb155792ac986dbfc4c6d94136a#7869099baa0fbeb155792ac986dbfc4c6d94136a" dependencies = [ "Inflector", "proc-macro2", @@ -2564,9 +2660,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-normalization" @@ -2805,43 +2901,100 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "winreg" version = "0.10.1" @@ -2868,8 +3021,9 @@ checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" [[package]] name = "zip" -version = "0.6.2" -source = "git+https://github.com/zip-rs/zip.git?rev=bb230ef56adc13436d1fcdfaa489249d119c498f#bb230ef56adc13436d1fcdfaa489249d119c498f" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537ce7411d25e54e8ae21a7ce0b15840e7bfcff15b51d697ec3266cc76bdf080" dependencies = [ "aes", "byteorder", @@ -2881,7 +3035,7 @@ dependencies = [ "hmac", "pbkdf2", "sha1", - "time 0.3.14", + "time 0.3.15", "zstd", ] diff --git a/crates/bindings/tmc-langs-node/Cargo.toml b/crates/bindings/tmc-langs-node/Cargo.toml index 1503653d31d..79e2e606b2d 100644 --- a/crates/bindings/tmc-langs-node/Cargo.toml +++ b/crates/bindings/tmc-langs-node/Cargo.toml @@ -17,19 +17,22 @@ default-features = false features = ["napi-6", "default-panic-hook"] [dependencies] -tmc-langs = { workspace = true, features = ["ts"] } +tmc-langs = { workspace = true, features = ["ts-rs"] } base64 = "0.13.0" env_logger = "0.9.0" serde = "1.0.136" serde_json = "1.0.78" thiserror = "1.0.30" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ "serde-compat", -], rev = "f78e0c43b62266a49a227e20733aca6467970f13" } +] } [dev-dependencies] log = "0.4.14" once_cell = "1.9.0" simple_logger = "2.1.0" -tmc-server-mock .workspace = true +tmc-server-mock.workspace = true + +[features] +ts-rs = ["tmc-langs/ts-rs"] diff --git a/crates/plugins/csharp/Cargo.toml b/crates/plugins/csharp/Cargo.toml index b7b8f5e8041..638b082c74d 100644 --- a/crates/plugins/csharp/Cargo.toml +++ b/crates/plugins/csharp/Cargo.toml @@ -7,8 +7,8 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-framework .workspace = true -tmc-langs-util .workspace = true +tmc-langs-framework.workspace = true +tmc-langs-util.workspace = true dirs = "4.0.0" log = "0.4.14" @@ -16,9 +16,9 @@ serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.78" thiserror = "1.0.30" walkdir = "2.3.2" -zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zip = "0.6.3" [dev-dependencies] once_cell = "1.9.0" -simple_logger = "2.1.0" +simple_logger = "3.0.0" tempfile = "3.3.0" diff --git a/crates/plugins/java/Cargo.toml b/crates/plugins/java/Cargo.toml index ae4a92c03a5..0e32ff00b51 100644 --- a/crates/plugins/java/Cargo.toml +++ b/crates/plugins/java/Cargo.toml @@ -7,8 +7,8 @@ license.workspace = true rust-version.workspace = true [dependencies] -tmc-langs-framework .workspace = true -tmc-langs-util .workspace = true +tmc-langs-framework.workspace = true +tmc-langs-util.workspace = true dirs = "4.0.0" flate2 = "1.0.22" @@ -23,5 +23,5 @@ thiserror = "1.0.30" walkdir = "2.3.2" [dev-dependencies] -simple_logger = "2.1.0" -zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +simple_logger = "3.0.0" +zip = "0.6.3" diff --git a/crates/plugins/make/Cargo.toml b/crates/plugins/make/Cargo.toml index a3a976976fa..4dbffa30266 100644 --- a/crates/plugins/make/Cargo.toml +++ b/crates/plugins/make/Cargo.toml @@ -17,9 +17,9 @@ serde = { version = "1.0.136", features = ["derive"] } serde_yaml = "0.9.10" serde-xml-rs = "0.6.0" thiserror = "1.0.30" -zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zip = "0.6.3" [dev-dependencies] -simple_logger = "2.1.0" +simple_logger = "3.0.0" tempfile = "3.3.0" walkdir = "2.3.2" diff --git a/crates/plugins/notests/Cargo.toml b/crates/plugins/notests/Cargo.toml index b32591e9daf..1e260cad2b5 100644 --- a/crates/plugins/notests/Cargo.toml +++ b/crates/plugins/notests/Cargo.toml @@ -11,8 +11,8 @@ tmc-langs-framework.workspace = true tmc-langs-util.workspace = true log = "0.4.14" -zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zip = "0.6.3" [dev-dependencies] -simple_logger = "2.1.0" +simple_logger = "3.0.0" tempfile = "3.3.0" diff --git a/crates/plugins/python3/Cargo.toml b/crates/plugins/python3/Cargo.toml index 1eacabadc80..ddaff218d5e 100644 --- a/crates/plugins/python3/Cargo.toml +++ b/crates/plugins/python3/Cargo.toml @@ -22,8 +22,8 @@ serde_json = "1.0.78" sha2 = "0.10.1" thiserror = "1.0.30" walkdir = "2.3.2" -zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zip = "0.6.3" [dev-dependencies] -simple_logger = "2.1.0" +simple_logger = "3.0.0" tempfile = "3.3.0" diff --git a/crates/plugins/r/Cargo.toml b/crates/plugins/r/Cargo.toml index 191c3db68a3..d72f4bea21a 100644 --- a/crates/plugins/r/Cargo.toml +++ b/crates/plugins/r/Cargo.toml @@ -14,9 +14,9 @@ log = "0.4.14" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.78" thiserror = "1.0.30" -zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zip = "0.6.3" [dev-dependencies] -simple_logger = "2.1.0" +simple_logger = "3.0.0" tempfile = "3.3.0" walkdir = "2.3.2" diff --git a/crates/tmc-client/Cargo.toml b/crates/tmc-client/Cargo.toml index 869839f78aa..74cb1158111 100644 --- a/crates/tmc-client/Cargo.toml +++ b/crates/tmc-client/Cargo.toml @@ -29,16 +29,16 @@ serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.78" tempfile = "3.3.0" thiserror = "1.0.30" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ "serde-compat", -], rev = "f78e0c43b62266a49a227e20733aca6467970f13", optional = true } +], optional = true } url = "2.2.2" walkdir = "2.3.2" [dev-dependencies] dotenv = "0.15.0" mockito = "0.31.0" -simple_logger = "2.1.0" +simple_logger = "3.0.0" [features] -ts = ["ts-rs"] +ts-rs = ["dep:ts-rs", "tmc-langs-util/ts-rs"] diff --git a/crates/tmc-client/src/response.rs b/crates/tmc-client/src/response.rs index b69ad8685e5..77c7a4b4ca8 100644 --- a/crates/tmc-client/src/response.rs +++ b/crates/tmc-client/src/response.rs @@ -11,8 +11,6 @@ use serde::{ use std::{fmt, str::FromStr}; use thiserror::Error; use tmc_langs_plugins::StyleValidationResult; -#[cfg(feature = "ts")] -use ts_rs::TS; /// Represents an error response from tmc-server #[derive(Debug, Error, Deserialize)] @@ -49,7 +47,7 @@ pub struct User { /// get /api/v8/org.json /// get /api/v8/org/{organization_slug}.json #[derive(Debug, Serialize, Deserialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct Organization { pub name: String, pub information: String, @@ -60,7 +58,7 @@ pub struct Organization { /// get /api/v8/core/org/{organization_slug}/courses #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct Course { pub id: u32, pub name: String, @@ -80,7 +78,7 @@ pub struct Course { /// get /api/v8/courses/{course_id} /// get /api/v8/org/{organization_slug}/courses/{course_name} #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct CourseData { pub name: String, pub hide_after: Option, @@ -88,7 +86,7 @@ pub struct CourseData { pub cache_version: Option, pub spreadsheet_key: Option, pub hidden_if_registered_after: Option, - #[cfg_attr(feature = "ts", ts(type = "string | null"))] + #[cfg_attr(feature = "ts-rs", ts(type = "string | null"))] pub refreshed_at: Option>, pub locked_exercise_points_visible: bool, pub description: Option, @@ -126,10 +124,10 @@ struct CourseDetailsInner { /// get /api/v8/core/courses/{course_id} #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] -// we never take these structs as inputs from TS so it's ok to ignore from -#[cfg_attr(feature = "ts", ts(ignore_serde_attr = "from"))] #[serde(from = "CourseDetailsWrapper")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +// we never take these structs as inputs from TS so it's ok to ignore from +#[cfg_attr(feature = "ts-rs", ts(ignore_serde_attr = "from"))] pub struct CourseDetails { #[serde(flatten)] pub course: Course, @@ -148,7 +146,7 @@ impl From for CourseDetails { } #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct Exercise { pub id: u32, pub name: String, @@ -182,7 +180,7 @@ pub struct Exercise { /// get /api/v8/courses/{course_id}/exercises #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct CourseExercise { pub id: u32, pub available_points: Vec, @@ -209,7 +207,7 @@ pub struct CourseDataExercise { } #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct ExercisePoint { pub id: u32, pub exercise_id: u32, @@ -245,7 +243,7 @@ pub struct AwardedPoint { /// get /api/v8/core/exercises/{exercise_id} #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct ExerciseDetails { pub course_name: String, pub course_id: u32, @@ -284,26 +282,26 @@ pub struct ExercisesDetails { /// get api/v8/exercises/{exercise_id}/users/{user_id}/submissions /// get api/v8/exercises/{exercise_id}/users/current/submissions #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct Submission { pub id: u32, pub user_id: u32, pub pretest_error: Option, - #[cfg_attr(feature = "ts", ts(type = "string"))] + #[cfg_attr(feature = "ts-rs", ts(type = "string"))] pub created_at: DateTime, pub exercise_name: String, pub course_id: u32, pub processed: bool, pub all_tests_passed: bool, pub points: Option, - #[cfg_attr(feature = "ts", ts(type = "string | null"))] + #[cfg_attr(feature = "ts-rs", ts(type = "string | null"))] pub processing_tried_at: Option>, - #[cfg_attr(feature = "ts", ts(type = "string | null"))] + #[cfg_attr(feature = "ts-rs", ts(type = "string | null"))] pub processing_began_at: Option>, - #[cfg_attr(feature = "ts", ts(type = "string | null"))] + #[cfg_attr(feature = "ts-rs", ts(type = "string | null"))] pub processing_completed_at: Option>, pub times_sent_to_sandbox: u32, - #[cfg_attr(feature = "ts", ts(type = "string"))] + #[cfg_attr(feature = "ts-rs", ts(type = "string"))] pub processing_attempts_started_at: DateTime, pub params_json: Option, pub requires_review: bool, @@ -318,13 +316,13 @@ pub struct Submission { } #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct ExerciseSubmission { pub exercise_name: String, pub id: u32, pub user_id: u32, pub course_id: u32, - #[cfg_attr(feature = "ts", ts(type = "string"))] + #[cfg_attr(feature = "ts-rs", ts(type = "string"))] pub created_at: DateTime, pub all_tests_passed: bool, pub points: Option, @@ -339,7 +337,7 @@ pub struct ExerciseSubmission { /// post /api/v8/core/exercises/{exercise_id}/submissions #[derive(Debug, Deserialize, Serialize, JsonSchema, Clone)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct NewSubmission { /// https://tmc.mooc.fi/api/v8/core/submissions/{submission_id} pub show_submission_url: String, @@ -372,7 +370,7 @@ pub enum SandboxStatus { } #[derive(Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct SubmissionFinished { pub api_version: u32, pub all_tests_passed: Option, @@ -404,7 +402,7 @@ pub struct SubmissionFinished { } #[derive(Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[serde(rename_all = "lowercase")] pub enum SubmissionStatus { Processing, @@ -416,14 +414,14 @@ pub enum SubmissionStatus { /// post /api/v8/core/submissions/{submission_id}/feedback #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct SubmissionFeedbackResponse { pub api_version: u32, pub status: SubmissionStatus, } #[derive(Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct TestCase { pub name: String, pub successful: bool, @@ -433,7 +431,7 @@ pub struct TestCase { } #[derive(Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct SubmissionFeedbackQuestion { pub id: u32, pub question: String, @@ -441,7 +439,7 @@ pub struct SubmissionFeedbackQuestion { } #[derive(Debug, PartialEq, Eq, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum SubmissionFeedbackKind { Text, IntRange { lower: u32, upper: u32 }, @@ -513,7 +511,7 @@ impl<'de> Visitor<'de> for SubmissionFeedbackKindVisitor { /// get /api/v8/core/courses/{course_id}/reviews #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct Review { pub submission_id: u32, pub exercise_name: String, @@ -527,9 +525,9 @@ pub struct Review { pub url: String, /// /api/v8/core/courses/{course_id}/reviews/{review_id} pub update_url: String, - #[cfg_attr(feature = "ts", ts(type = "string"))] + #[cfg_attr(feature = "ts-rs", ts(type = "string"))] pub created_at: DateTime, - #[cfg_attr(feature = "ts", ts(type = "string"))] + #[cfg_attr(feature = "ts-rs", ts(type = "string"))] pub updated_at: DateTime, } diff --git a/crates/tmc-client/src/tmc_client.rs b/crates/tmc-client/src/tmc_client.rs index d5bbd6b8cc4..8a146435d1c 100644 --- a/crates/tmc-client/src/tmc_client.rs +++ b/crates/tmc-client/src/tmc_client.rs @@ -21,8 +21,6 @@ use std::{ }; use tmc_langs_plugins::{Compression, Language}; use tmc_langs_util::progress_reporter; -#[cfg(feature = "ts")] -use ts_rs::TS; /// Authentication token. pub type Token = @@ -32,6 +30,7 @@ pub type Token = #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] #[serde(tag = "client-update-data-kind")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum ClientUpdateData { ExerciseDownload { id: u32, path: PathBuf }, PostedSubmission(NewSubmission), @@ -39,7 +38,7 @@ pub enum ClientUpdateData { /// Updated exercises. #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct UpdateResult { pub created: Vec, pub updated: Vec, diff --git a/crates/tmc-langs-cli/Cargo.toml b/crates/tmc-langs-cli/Cargo.toml index 39c5103b916..82d4befb3d7 100644 --- a/crates/tmc-langs-cli/Cargo.toml +++ b/crates/tmc-langs-cli/Cargo.toml @@ -28,9 +28,15 @@ structopt = "0.3.26" tempfile = "3.3.0" thiserror = "1.0.30" toml = "0.5.8" +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ + "serde-compat", +], optional = true } url = "2.2.2" walkdir = "2.3.2" [dev-dependencies] -simple_logger = "2.1.0" +simple_logger = "3.0.0" tempfile = "3.3.0" + +[features] +ts-rs = ["dep:ts-rs", "tmc-langs/ts-rs", "tmc-langs-util/ts-rs"] diff --git a/crates/tmc-langs-cli/src/lib.rs b/crates/tmc-langs-cli/src/lib.rs index ffc074c8a45..0f05dcecc63 100644 --- a/crates/tmc-langs-cli/src/lib.rs +++ b/crates/tmc-langs-cli/src/lib.rs @@ -82,7 +82,7 @@ fn run_inner() -> Result<(), ()> { let causes: Vec = e.chain().map(|e| format!("Caused by: {}", e)).collect(); let error_output = OutputKind::OutputData(Box::new(OutputData { status: Status::Finished, - message: e.to_string(), + message: format!("{e:?}"), // debug formatting to print backtrace from anyhow result: OutputResult::Error, data: Some(DataKind::Error { kind: Kind::Generic, @@ -196,7 +196,7 @@ fn error_message_special_casing(e: &anyhow::Error) -> String { return cnf.to_string(); } } - e.to_string() + format!("{e:?}") // debug formatting to print backtrace from anyhow } /// Goes through the error chain and returns the error output file path if a sandbox test error is found diff --git a/crates/tmc-langs-cli/src/output.rs b/crates/tmc-langs-cli/src/output.rs index ad5edf31758..a0db21ae62c 100644 --- a/crates/tmc-langs-cli/src/output.rs +++ b/crates/tmc-langs-cli/src/output.rs @@ -16,6 +16,7 @@ use tmc_langs_util::progress_reporter::StatusUpdate; #[derive(Debug, Serialize)] #[serde(rename_all = "kebab-case")] #[serde(tag = "output-kind")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum OutputKind { /// Data that is output at the end of a command. OutputData(Box), @@ -50,6 +51,7 @@ impl OutputKind { #[derive(Debug, Serialize)] #[serde(rename_all = "kebab-case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct OutputData { pub status: Status, pub message: String, @@ -60,6 +62,7 @@ pub struct OutputData { #[derive(Debug, Serialize)] #[serde(rename_all = "kebab-case")] #[serde(tag = "output-data-kind", content = "output-data")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum DataKind { Error { kind: Kind, @@ -88,7 +91,7 @@ pub enum DataKind { Organization(Organization), Organizations(Vec), Reviews(Vec), - Token(Token), + Token(#[cfg_attr(feature = "ts-rs", ts(type = "unknown"))] Token), NewSubmission(NewSubmission), SubmissionFeedbackResponse(SubmissionFeedbackResponse), SubmissionFinished(SubmissionFinished), @@ -99,6 +102,7 @@ pub enum DataKind { #[derive(Debug, Serialize)] #[serde(rename_all = "kebab-case")] #[serde(tag = "update-data-kind")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum StatusUpdateData { ClientUpdateData(StatusUpdate), None(StatusUpdate<()>), @@ -106,6 +110,7 @@ pub enum StatusUpdateData { #[derive(Debug, Serialize)] #[serde(rename_all = "kebab-case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum Status { /// The command was ran without fatal errors Finished, @@ -115,6 +120,7 @@ pub enum Status { #[derive(Debug, Serialize)] #[serde(rename_all = "kebab-case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum OutputResult { LoggedIn, LoggedOut, @@ -125,6 +131,7 @@ pub enum OutputResult { #[derive(Debug, Serialize)] #[serde(rename_all = "kebab-case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum Kind { /// For all other errors Generic, diff --git a/crates/tmc-langs-framework/Cargo.toml b/crates/tmc-langs-framework/Cargo.toml index eacab9f4a0a..2d32fc8e4d4 100644 --- a/crates/tmc-langs-framework/Cargo.toml +++ b/crates/tmc-langs-framework/Cargo.toml @@ -21,17 +21,17 @@ schemars = "0.8.8" subprocess = "0.2.8" tar = "0.4.38" tempfile = "3.3.0" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ "serde-compat", -], rev = "f78e0c43b62266a49a227e20733aca6467970f13", optional = true } +], optional = true } thiserror = "1.0.30" walkdir = "2.3.2" -zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zip = "0.6.3" zstd = "0.11.2" [dev-dependencies] -simple_logger = "2.1.0" +simple_logger = "3.0.0" tempfile = "3.3.0" [features] -ts = ["ts-rs"] +ts-rs = ["dep:ts-rs", "tmc-langs-util/ts-rs"] diff --git a/crates/tmc-langs-framework/src/archive.rs b/crates/tmc-langs-framework/src/archive.rs index 781fac1eaca..a933a7d1110 100644 --- a/crates/tmc-langs-framework/src/archive.rs +++ b/crates/tmc-langs-framework/src/archive.rs @@ -9,8 +9,6 @@ use std::{ path::{Path, PathBuf}, str::FromStr, }; -#[cfg(feature = "ts")] -use ts_rs::TS; /// Wrapper unifying the API of all the different compression formats supported by langs. /// Unfortunately the API is more complicated due to tar only supporting iterating through the files one by one, @@ -211,7 +209,7 @@ impl<'a, T: Read> Read for Entry<'a, T> { /// Supported compression methods. #[derive(Debug, Clone, Copy, Deserialize)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum Compression { /// .tar #[serde(rename = "tar")] diff --git a/crates/tmc-langs-framework/src/domain.rs b/crates/tmc-langs-framework/src/domain.rs index a46328e5f99..8d8baaa05ca 100644 --- a/crates/tmc-langs-framework/src/domain.rs +++ b/crates/tmc-langs-framework/src/domain.rs @@ -6,12 +6,10 @@ use std::{ collections::{HashMap, HashSet}, path::PathBuf, }; -#[cfg(feature = "ts")] -use ts_rs::TS; /// A description of an exercise's test case. #[derive(Debug, Deserialize, Serialize, JsonSchema, PartialEq, Eq, Hash)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct TestDesc { /// The full name of the test. /// @@ -32,7 +30,7 @@ impl TestDesc { /// The result of a single test case. #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct TestResult { pub name: String, pub successful: bool, @@ -45,7 +43,7 @@ pub struct TestResult { /// A description of an exercise. #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct ExerciseDesc { /// The name of the exercise to be shown to the user. /// Does not necessarily match or even contain the directory name. @@ -62,8 +60,8 @@ impl ExerciseDesc { /// The result of running an exercise's test suite against a submission. #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] #[serde(rename_all = "camelCase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct RunResult { /// The overall status of a test run. pub status: RunStatus, @@ -90,7 +88,7 @@ impl RunResult { /// The overall status of a test run. #[derive(Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[serde(rename_all = "SCREAMING_SNAKE_CASE")] pub enum RunStatus { /// The submission and tests compiled and all tests passed. @@ -110,7 +108,7 @@ pub enum RunStatus { /// Represents configuration based on which submission may be packaged. #[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct ExercisePackagingConfiguration { /// Student folders or files which are copied from submission. pub student_file_paths: HashSet, @@ -132,7 +130,7 @@ impl ExercisePackagingConfiguration { /// Determines how style errors are handled. #[derive(Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[serde(rename_all = "UPPERCASE")] pub enum StyleValidationStrategy { Fail, @@ -142,7 +140,7 @@ pub enum StyleValidationStrategy { /// A style validation error. #[derive(Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[serde(rename_all = "camelCase")] pub struct StyleValidationError { pub column: u32, @@ -153,8 +151,8 @@ pub struct StyleValidationError { /// The result of a style check. #[derive(Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] #[serde(rename_all = "camelCase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct StyleValidationResult { pub strategy: StyleValidationStrategy, pub validation_errors: Option>>, diff --git a/crates/tmc-langs-framework/src/tmc_project_yml.rs b/crates/tmc-langs-framework/src/tmc_project_yml.rs index b2ae64b0805..c9f49a4a6ba 100644 --- a/crates/tmc-langs-framework/src/tmc_project_yml.rs +++ b/crates/tmc-langs-framework/src/tmc_project_yml.rs @@ -11,13 +11,11 @@ use std::{ path::{Path, PathBuf}, }; use tmc_langs_util::{deserialize, file_util, FileError}; -#[cfg(feature = "ts")] -use ts_rs::TS; /// Extra data from a `.tmcproject.yml` file. // NOTE: when adding fields, remember to update the merge function as well #[derive(Debug, Serialize, Deserialize, Default, Clone)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct TmcProjectYml { #[serde(default)] #[serde(skip_serializing_if = "Vec::is_empty")] @@ -36,7 +34,7 @@ pub struct TmcProjectYml { pub tests_timeout_ms: Option, #[serde(rename = "no-tests")] - #[cfg_attr(feature = "ts", ts(skip))] + #[cfg_attr(feature = "ts-rs", ts(skip))] #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] pub no_tests: Option, @@ -127,7 +125,7 @@ impl TmcProjectYml { /// Minimum Python version requirement. /// TODO: if patch is Some minor is also guaranteed to be Some etc. encode this in the type system #[derive(Debug, Default, Clone, Copy, Serialize)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct PythonVer { pub major: Option, pub minor: Option, @@ -186,9 +184,9 @@ impl<'de> Deserialize<'de> for PythonVer { /// Contents of the no-tests field. #[derive(Debug, Serialize, Deserialize, Clone)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] // we never take these structs as inputs from TS so it's ok to ignore from -#[cfg_attr(feature = "ts", ts(ignore_serde_attr = "from"))] +#[cfg_attr(feature = "ts-rs", ts(ignore_serde_attr = "from"))] #[serde(from = "NoTestsWrapper")] pub struct NoTests { pub flag: bool, diff --git a/crates/tmc-langs-plugins/Cargo.toml b/crates/tmc-langs-plugins/Cargo.toml index 6dd3785990e..18335f87431 100644 --- a/crates/tmc-langs-plugins/Cargo.toml +++ b/crates/tmc-langs-plugins/Cargo.toml @@ -22,9 +22,9 @@ log = "0.4.14" tar = "0.4.38" thiserror = "1.0.30" walkdir = "2.3.2" -zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zip = "0.6.3" zstd = "0.11.2" [dev-dependencies] -simple_logger = "2.1.0" +simple_logger = "3.0.0" tempfile = "3.3.0" diff --git a/crates/tmc-langs-util/Cargo.toml b/crates/tmc-langs-util/Cargo.toml index e5be603c52b..c7ec6141d7f 100644 --- a/crates/tmc-langs-util/Cargo.toml +++ b/crates/tmc-langs-util/Cargo.toml @@ -18,6 +18,9 @@ serde_yaml = "0.9.10" tempfile = "3.3.0" thiserror = "1.0.30" toml = "0.5.8" +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ + "serde-compat", +], optional = true } type-map = "0.5.0" walkdir = "2.3.2" @@ -25,4 +28,4 @@ walkdir = "2.3.2" winapi = "0.3.9" [dev-dependencies] -simple_logger = "2.1.0" +simple_logger = "3.0.0" diff --git a/crates/tmc-langs-util/src/notification_reporter.rs b/crates/tmc-langs-util/src/notification_reporter.rs index 5d0ffed73fd..b6ceae0e16d 100644 --- a/crates/tmc-langs-util/src/notification_reporter.rs +++ b/crates/tmc-langs-util/src/notification_reporter.rs @@ -22,6 +22,7 @@ pub fn notify(notification: Notification) { #[derive(Debug, Serialize)] #[serde(rename_all = "kebab-case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct Notification { notification_kind: NotificationKind, message: String, @@ -29,6 +30,7 @@ pub struct Notification { #[derive(Debug, Serialize)] #[serde(rename_all = "lowercase")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum NotificationKind { Warning, Info, diff --git a/crates/tmc-langs-util/src/progress_reporter.rs b/crates/tmc-langs-util/src/progress_reporter.rs index 146887b5fb2..a546177bfad 100644 --- a/crates/tmc-langs-util/src/progress_reporter.rs +++ b/crates/tmc-langs-util/src/progress_reporter.rs @@ -8,6 +8,7 @@ use type_map::concurrent::TypeMap; /// The format for all status updates. May contain some data. #[derive(Debug, Serialize)] #[serde(rename_all = "kebab-case")] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct StatusUpdate { pub finished: bool, pub message: String, diff --git a/crates/tmc-langs/Cargo.toml b/crates/tmc-langs/Cargo.toml index c1d6a0dee4a..3b0dc07812c 100644 --- a/crates/tmc-langs/Cargo.toml +++ b/crates/tmc-langs/Cargo.toml @@ -35,12 +35,13 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.30" toml = "0.5.8" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs/", features = [ +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ "serde-compat", -], rev = "f78e0c43b62266a49a227e20733aca6467970f13", optional = true } + "toml-impl", +], optional = true } url = "2.2.2" walkdir = "2.3.2" -zip = { git = "https://github.com/zip-rs/zip.git", rev = "bb230ef56adc13436d1fcdfaa489249d119c498f" } # use from git until zip releases a version with zstd 0.11 +zip = "0.6.3" zstd = "0.11.2" [target.'cfg(unix)'.dependencies] @@ -49,8 +50,13 @@ nix = "0.25.0" [dev-dependencies] chrono = "0.4.19" mockito = "0.31.0" -simple_logger = "2.1.0" +simple_logger = "3.0.0" tempfile = "3.3.0" [features] -ts = ["ts-rs", "tmc-client/ts", "tmc-langs-framework/ts"] +ts-rs = [ + "dep:ts-rs", + "tmc-client/ts-rs", + "tmc-langs-framework/ts-rs", + "tmc-langs-util/ts-rs", +] diff --git a/crates/tmc-langs/src/config/tmc_config.rs b/crates/tmc-langs/src/config/tmc_config.rs index ea0a82e2016..045f9648b5d 100644 --- a/crates/tmc-langs/src/config/tmc_config.rs +++ b/crates/tmc-langs/src/config/tmc_config.rs @@ -10,17 +10,15 @@ use std::{ }; use tmc_langs_util::{deserialize, file_util, FileError}; use toml::{value::Table, Value}; -#[cfg(feature = "ts")] -use ts_rs::TS; /// The main configuration file. A separate one is used for each client. #[derive(Debug, Serialize, Deserialize)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct TmcConfig { #[serde(alias = "projects-dir")] pub projects_dir: PathBuf, #[serde(flatten)] - #[cfg_attr(feature = "ts", ts(skip))] + #[cfg_attr(feature = "ts-rs", ts(skip))] pub table: Table, } @@ -185,6 +183,7 @@ impl TmcConfig { /// A setting in a TmcConfig file. #[derive(Debug, Serialize, Clone)] #[serde(untagged)] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub enum ConfigValue<'a> { Value(Option>), Path(Cow<'a, Path>), diff --git a/crates/tmc-langs/src/course_refresher.rs b/crates/tmc-langs/src/course_refresher.rs index 4ae2b914184..19b86e6c3bf 100644 --- a/crates/tmc-langs/src/course_refresher.rs +++ b/crates/tmc-langs/src/course_refresher.rs @@ -12,8 +12,6 @@ use std::{ use tmc_langs_framework::{TmcCommand, TmcProjectYml}; use tmc_langs_plugins::PluginType; use tmc_langs_util::{deserialize, file_util}; -#[cfg(feature = "ts")] -use ts_rs::TS; use walkdir::WalkDir; #[cfg(unix)] @@ -22,10 +20,10 @@ pub type ModeBits = nix::sys::stat::mode_t; /// Data from a finished course refresh. #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct RefreshData { pub new_cache_path: PathBuf, - #[cfg_attr(feature = "ts", ts(type = "object"))] + #[cfg_attr(feature = "ts-rs", ts(type = "object"))] pub course_options: Mapping, pub exercises: Vec, } @@ -33,7 +31,7 @@ pub struct RefreshData { /// An exercise from a finished course refresh. #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct RefreshExercise { name: String, checksum: String, @@ -41,7 +39,7 @@ pub struct RefreshExercise { #[serde(skip)] path: PathBuf, sandbox_image: String, - #[cfg_attr(feature = "ts", ts(type = "TmcProjectYml | null"))] + #[cfg_attr(feature = "ts-rs", ts(type = "TmcProjectYml | null"))] tmcproject_yml: Option, } diff --git a/crates/tmc-langs/src/data.rs b/crates/tmc-langs/src/data.rs index a0ccf589519..01868f7fd78 100644 --- a/crates/tmc-langs/src/data.rs +++ b/crates/tmc-langs/src/data.rs @@ -9,13 +9,11 @@ use std::{ path::PathBuf, }; use tmc_client::response::{CourseData, CourseDetails, CourseExercise}; -#[cfg(feature = "ts")] -use ts_rs::TS; /// Exercise inside the projects directory. #[derive(Debug, Serialize, JsonSchema)] #[serde(rename_all = "kebab-case")] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct LocalExercise { pub exercise_slug: String, pub exercise_path: PathBuf, @@ -176,7 +174,7 @@ pub enum DownloadTargetKind { #[derive(Debug, Clone, Serialize, JsonSchema)] #[serde(rename_all = "kebab-case")] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct ExerciseDownload { pub id: u32, pub course_slug: String, @@ -185,7 +183,7 @@ pub struct ExerciseDownload { } #[derive(Debug, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct CombinedCourseData { pub details: CourseDetails, pub exercises: Vec, @@ -193,7 +191,7 @@ pub struct CombinedCourseData { } #[derive(Debug, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct DownloadOrUpdateCourseExercisesResult { pub downloaded: Vec, pub skipped: Vec, diff --git a/crates/tmc-langs/src/lib.rs b/crates/tmc-langs/src/lib.rs index f23e6763347..a84dea4aec2 100644 --- a/crates/tmc-langs/src/lib.rs +++ b/crates/tmc-langs/src/lib.rs @@ -63,13 +63,11 @@ pub use tmc_langs_util::{ notification_reporter, progress_reporter, }; use toml::Value as TomlValue; -#[cfg(feature = "ts")] -use ts_rs::TS; use url::Url; use walkdir::WalkDir; #[derive(Debug, Serialize, JsonSchema)] -#[cfg_attr(feature = "ts", derive(TS))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct UpdatedExercise { pub id: u32, } diff --git a/crates/tmc-langs/src/submission_packaging.rs b/crates/tmc-langs/src/submission_packaging.rs index 461e77781b4..4ad6d4be2dc 100644 --- a/crates/tmc-langs/src/submission_packaging.rs +++ b/crates/tmc-langs/src/submission_packaging.rs @@ -16,9 +16,7 @@ use zip::{write::FileOptions, ZipWriter}; static MUTEX: Lazy> = Lazy::new(|| Mutex::new(())); -/// Note: Used by tmc-server. Prepares a submission for further processing. -/// The clone path is assumed to be a directory with the exercise name as the directory name, -/// and the course name as its parent, ex. "anything/some_course/some_exercise" +/// Prepares a submission for further processing. pub fn prepare_submission( (submission_archive, submission_compression): (&Path, Compression), target_path: &Path, @@ -28,7 +26,7 @@ pub fn prepare_submission( stub_archive: Option<(&Path, Compression)>, output_format: Compression, ) -> Result<(), LangsError> { - // workaround for unknown issues when prepare_submission is ran multiple times in parallel + // FIXME: workaround for unknown issues when prepare_submission is ran multiple times in parallel let _m = MUTEX.lock().map_err(|_| LangsError::MutexError)?; log::debug!("preparing submission for {}", submission_archive.display()); From e207993c814bc7ede65f4fc4fccc13550529cc62 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Mon, 24 Oct 2022 08:45:32 +0300 Subject: [PATCH 13/15] Generated bindings to CLI output type --- Cargo.lock | 4 +- crates/bindings/tmc-langs-node/Cargo.toml | 2 +- crates/tmc-client/Cargo.toml | 2 +- crates/tmc-langs-cli/Cargo.toml | 2 +- crates/tmc-langs-cli/bindings.d.ts | 102 ++++++++++++++++++ crates/tmc-langs-cli/src/lib.rs | 125 +++++++++++----------- crates/tmc-langs-cli/src/output.rs | 78 ++++++++++++-- crates/tmc-langs-framework/Cargo.toml | 2 +- crates/tmc-langs-util/Cargo.toml | 2 +- crates/tmc-langs/Cargo.toml | 2 +- 10 files changed, 242 insertions(+), 79 deletions(-) create mode 100644 crates/tmc-langs-cli/bindings.d.ts diff --git a/Cargo.lock b/Cargo.lock index 3f76f2674b8..48f8e5e70a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2609,7 +2609,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "ts-rs" version = "6.2.0" -source = "git+https://github.com/Heliozoa/ts-rs.git?rev=7869099baa0fbeb155792ac986dbfc4c6d94136a#7869099baa0fbeb155792ac986dbfc4c6d94136a" +source = "git+https://github.com/Heliozoa/ts-rs.git?rev=d1eeeabc857b824f3cdaec97270c33d3cf0eda35#d1eeeabc857b824f3cdaec97270c33d3cf0eda35" dependencies = [ "thiserror", "toml", @@ -2619,7 +2619,7 @@ dependencies = [ [[package]] name = "ts-rs-macros" version = "6.2.0" -source = "git+https://github.com/Heliozoa/ts-rs.git?rev=7869099baa0fbeb155792ac986dbfc4c6d94136a#7869099baa0fbeb155792ac986dbfc4c6d94136a" +source = "git+https://github.com/Heliozoa/ts-rs.git?rev=d1eeeabc857b824f3cdaec97270c33d3cf0eda35#d1eeeabc857b824f3cdaec97270c33d3cf0eda35" dependencies = [ "Inflector", "proc-macro2", diff --git a/crates/bindings/tmc-langs-node/Cargo.toml b/crates/bindings/tmc-langs-node/Cargo.toml index 79e2e606b2d..e923cbbb532 100644 --- a/crates/bindings/tmc-langs-node/Cargo.toml +++ b/crates/bindings/tmc-langs-node/Cargo.toml @@ -24,7 +24,7 @@ env_logger = "0.9.0" serde = "1.0.136" serde_json = "1.0.78" thiserror = "1.0.30" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "d1eeeabc857b824f3cdaec97270c33d3cf0eda35", features = [ "serde-compat", ] } diff --git a/crates/tmc-client/Cargo.toml b/crates/tmc-client/Cargo.toml index 74cb1158111..7b66142d6fb 100644 --- a/crates/tmc-client/Cargo.toml +++ b/crates/tmc-client/Cargo.toml @@ -29,7 +29,7 @@ serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.78" tempfile = "3.3.0" thiserror = "1.0.30" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "d1eeeabc857b824f3cdaec97270c33d3cf0eda35", features = [ "serde-compat", ], optional = true } url = "2.2.2" diff --git a/crates/tmc-langs-cli/Cargo.toml b/crates/tmc-langs-cli/Cargo.toml index 82d4befb3d7..ccbb8fe00c8 100644 --- a/crates/tmc-langs-cli/Cargo.toml +++ b/crates/tmc-langs-cli/Cargo.toml @@ -28,7 +28,7 @@ structopt = "0.3.26" tempfile = "3.3.0" thiserror = "1.0.30" toml = "0.5.8" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "d1eeeabc857b824f3cdaec97270c33d3cf0eda35", features = [ "serde-compat", ], optional = true } url = "2.2.2" diff --git a/crates/tmc-langs-cli/bindings.d.ts b/crates/tmc-langs-cli/bindings.d.ts new file mode 100644 index 00000000000..392aa6269e1 --- /dev/null +++ b/crates/tmc-langs-cli/bindings.d.ts @@ -0,0 +1,102 @@ +export type CliOutput = { "output-kind": "output-data" } & OutputData | { "output-kind": "status-update" } & StatusUpdateData | { "output-kind": "notification" } & Notification; + +export interface OutputData { status: Status, message: string, result: OutputResult, data: DataKind | null, } + +export type StatusUpdateData = { "update-data-kind": "client-update-data" } & StatusUpdate | { "update-data-kind": "none" } & StatusUpdate; + +export interface Notification { "notification-kind": NotificationKind, message: string, } + +export type Status = "finished" | "crashed"; + +export type OutputResult = "logged-in" | "logged-out" | "not-logged-in" | "error" | "executed-command"; + +export type ClientUpdateData = { "client-update-data-kind": "exercise-download", id: number, path: string, } | { "client-update-data-kind": "posted-submission" } & NewSubmission; + +export interface StatusUpdate { finished: boolean, message: string, "percent-done": number, time: bigint, data: T | null, } + +export type NotificationKind = "warning" | "info"; + +export type DataKind = { "output-data-kind": "error", "output-data": { kind: Kind, trace: Array, } } | { "output-data-kind": "validation", "output-data": StyleValidationResult } | { "output-data-kind": "available-points", "output-data": Array } | { "output-data-kind": "exercises", "output-data": Array } | { "output-data-kind": "exercise-packaging-configuration", "output-data": ExercisePackagingConfiguration } | { "output-data-kind": "local-exercises", "output-data": Array } | { "output-data-kind": "refresh-result", "output-data": RefreshData } | { "output-data-kind": "test-result", "output-data": RunResult } | { "output-data-kind": "exercise-desc", "output-data": ExerciseDesc } | { "output-data-kind": "updated-exercises", "output-data": Array } | { "output-data-kind": "exercise-download", "output-data": DownloadOrUpdateCourseExercisesResult } | { "output-data-kind": "combined-course-data", "output-data": CombinedCourseData } | { "output-data-kind": "course-details", "output-data": CourseDetails } | { "output-data-kind": "course-exercises", "output-data": Array } | { "output-data-kind": "course-data", "output-data": CourseData } | { "output-data-kind": "courses", "output-data": Array } | { "output-data-kind": "exercise-details", "output-data": ExerciseDetails } | { "output-data-kind": "submissions", "output-data": Array } | { "output-data-kind": "update-result", "output-data": UpdateResult } | { "output-data-kind": "organization", "output-data": Organization } | { "output-data-kind": "organizations", "output-data": Array } | { "output-data-kind": "reviews", "output-data": Array } | { "output-data-kind": "token", "output-data": unknown } | { "output-data-kind": "new-submission", "output-data": NewSubmission } | { "output-data-kind": "submission-feedback-response", "output-data": SubmissionFeedbackResponse } | { "output-data-kind": "submission-finished", "output-data": SubmissionFinished } | { "output-data-kind": "config-value", "output-data": ConfigValue } | { "output-data-kind": "tmc-config", "output-data": TmcConfig }; + +export interface NewSubmission { show_submission_url: string, paste_url: string, submission_url: string, } + +export type Kind = "generic" | "forbidden" | "not-logged-in" | "connection-error" | "obsolete-client" | "invalid-token" | { "failed-exercise-download": { completed: Array, skipped: Array, failed: Array<[ExerciseDownload, Array]>, } }; + +export interface StyleValidationResult { strategy: StyleValidationStrategy, validationErrors: Record> | null, } + +export interface ExerciseDownload { id: number, "course-slug": string, "exercise-slug": string, path: string, } + +export type StyleValidationStrategy = "FAIL" | "WARN" | "DISABLED"; + +export interface StyleValidationError { column: number, line: number, message: string, sourceName: string, } + +export interface ExercisePackagingConfiguration { student_file_paths: Array, exercise_file_paths: Array, } + +export interface LocalExercise { "exercise-slug": string, "exercise-path": string, } + +export interface RefreshData { "new-cache-path": string, "course-options": object, exercises: Array, } + +export interface RunResult { status: RunStatus, testResults: Array, logs: Record, } + +export interface ExerciseDesc { name: string, tests: Array, } + +export interface RefreshExercise { name: string, checksum: string, points: Array, "sandbox-image": string, "tmcproject-yml": TmcProjectYml | null, } + +export type RunStatus = "PASSED" | "TESTS_FAILED" | "COMPILE_FAILED" | "TESTRUN_INTERRUPTED" | "GENERIC_ERROR"; + +export interface TestResult { name: string, successful: boolean, points: Array, message: string, exception: Array, } + +export interface TestDesc { name: string, points: Array, } + +export interface TmcProjectYml { extra_student_files: Array, extra_exercise_files: Array, force_update: Array, tests_timeout_ms?: bigint, fail_on_valgrind_error?: boolean, minimum_python_version?: PythonVer, sandbox_image?: string, } + +export interface UpdatedExercise { id: number, } + +export interface DownloadOrUpdateCourseExercisesResult { downloaded: Array, skipped: Array, failed?: Array<[ExerciseDownload, Array]>, } + +export interface CombinedCourseData { details: CourseDetails, exercises: Array, settings: CourseData, } + +export interface CourseDetails { id: number, name: string, title: string, description: string | null, details_url: string, unlock_url: string, reviews_url: string, comet_url: string, spyware_urls: Array, unlockables: Array, exercises: Array, } + +export interface CourseExercise { id: number, available_points: Array, awarded_points: Array, name: string, publish_time: string | null, solution_visible_after: string | null, deadline: string | null, soft_deadline: string | null, disabled: boolean, unlocked: boolean, } + +export interface CourseData { name: string, hide_after: string | null, hidden: boolean, cache_version: number | null, spreadsheet_key: string | null, hidden_if_registered_after: string | null, refreshed_at: string | null, locked_exercise_points_visible: boolean, description: string | null, paste_visibility: number | null, formal_name: string | null, certificate_downloadable: boolean | null, certificate_unlock_spec: string | null, organization_id: number | null, disabled_status: string | null, title: string | null, material_url: string | null, course_template_id: number | null, hide_submission_results: boolean, external_scoreboard_url: string | null, organization_slug: string | null, } + +export interface Course { id: number, name: string, title: string, description: string | null, details_url: string, unlock_url: string, reviews_url: string, comet_url: string, spyware_urls: Array, } + +export interface ExerciseDetails { course_name: string, course_id: number, code_review_requests_enabled: boolean, run_tests_locally_action_enabled: boolean, exercise_name: string, exercise_id: number, unlocked_at: string | null, deadline: string | null, submissions: Array, } + +export interface Submission { id: number, user_id: number, pretest_error: string | null, created_at: string, exercise_name: string, course_id: number, processed: boolean, all_tests_passed: boolean, points: string | null, processing_tried_at: string | null, processing_began_at: string | null, processing_completed_at: string | null, times_sent_to_sandbox: number, processing_attempts_started_at: string, params_json: string | null, requires_review: boolean, requests_review: boolean, reviewed: boolean, message_for_reviewer: string, newer_submission_reviewed: boolean, review_dismissed: boolean, paste_available: boolean, message_for_paste: string, paste_key: string | null, } + +export interface UpdateResult { created: Array, updated: Array, } + +export interface Organization { name: string, information: string, slug: string, logo_path: string, pinned: boolean, } + +export interface Review { submission_id: number, exercise_name: string, id: number, marked_as_read: boolean, reviewer_name: string, review_body: string, points: Array, points_not_awarded: Array, url: string, update_url: string, created_at: string, updated_at: string, } + +export interface Exercise { id: number, name: string, locked: boolean, deadline_description: string | null, deadline: string | null, soft_deadline: string | null, soft_deadline_description: string | null, checksum: string, return_url: string, zip_url: string, returnable: boolean, requires_review: boolean, attempted: boolean, completed: boolean, reviewed: boolean, all_review_points_given: boolean, memory_limit: number | null, runtime_params: Array, valgrind_strategy: string | null, code_review_requests_enabled: boolean, run_tests_locally_action_enabled: boolean, latest_submission_url: string | null, latest_submission_id: number | null, solution_zip_url: string | null, } + +export interface ExerciseSubmission { exercise_name: string, id: number, user_id: number, course_id: number, created_at: string, all_tests_passed: boolean, points: string | null, submitted_zip_url: string, paste_url: string | null, processing_time: number | null, reviewed: boolean, requests_review: boolean, } + +export interface ExercisePoint { id: number, exercise_id: number, name: string, requires_review: boolean, } + +export interface Exercise { id: number, name: string, locked: boolean, deadline_description: string | null, deadline: string | null, soft_deadline: string | null, soft_deadline_description: string | null, checksum: string, return_url: string, zip_url: string, returnable: boolean, requires_review: boolean, attempted: boolean, completed: boolean, reviewed: boolean, all_review_points_given: boolean, memory_limit: number | null, runtime_params: Array, valgrind_strategy: string | null, code_review_requests_enabled: boolean, run_tests_locally_action_enabled: boolean, latest_submission_url: string | null, latest_submission_id: number | null, solution_zip_url: string | null, } + +export interface PythonVer { major: number | null, minor: number | null, patch: number | null, } + +export interface TmcConfig { projects_dir: string, } + +export type ConfigValue = unknown | null | string; + +export interface SubmissionFinished { api_version: number, all_tests_passed: boolean | null, user_id: number, login: string, course: string, exercise_name: string, status: SubmissionStatus, points: Array, valgrind: string | null, submission_url: string, solution_url: string | null, submitted_at: string, processing_time: number | null, reviewed: boolean, requests_review: boolean, paste_url: string | null, message_for_paste: string | null, missing_review_points: Array, test_cases: Array | null, feedback_questions: Array | null, feedback_answer_url: string | null, error: string | null, validations: StyleValidationResult | null, } + +export interface SubmissionFeedbackResponse { api_version: number, status: SubmissionStatus, } + +export type SubmissionStatus = "processing" | "fail" | "ok" | "error" | "hidden"; + +export interface SubmissionFeedbackQuestion { id: number, question: string, kind: SubmissionFeedbackKind, } + +export interface TestCase { name: string, successful: boolean, message: string | null, exception: Array | null, detailed_message: string | null, } + +export type SubmissionFeedbackKind = "Text" | { "IntRange": { lower: number, upper: number, } }; + diff --git a/crates/tmc-langs-cli/src/lib.rs b/crates/tmc-langs-cli/src/lib.rs index 0f05dcecc63..23f2eafbc4b 100644 --- a/crates/tmc-langs-cli/src/lib.rs +++ b/crates/tmc-langs-cli/src/lib.rs @@ -8,7 +8,7 @@ mod output; use self::{ error::{DownloadsFailedError, InvalidTokenError, SandboxTestError}, - output::{DataKind, Kind, OutputData, OutputKind, OutputResult, Status, StatusUpdateData}, + output::{CliOutput, DataKind, Kind, OutputData, OutputResult, Status, StatusUpdateData}, }; use crate::app::{Locale, Opt}; use anyhow::{Context, Result}; @@ -59,7 +59,7 @@ pub fn run() { } else { "Process panicked unexpectedly without an error message".to_string() }; - let output = OutputKind::OutputData(Box::new(OutputData { + let output = CliOutput::OutputData(Box::new(OutputData { status: Status::Crashed, message: error_message, result: OutputResult::Error, @@ -80,7 +80,7 @@ fn run_inner() -> Result<(), ()> { Err(e) => { // CLI was called incorrectly let causes: Vec = e.chain().map(|e| format!("Caused by: {}", e)).collect(); - let error_output = OutputKind::OutputData(Box::new(OutputData { + let error_output = CliOutput::OutputData(Box::new(OutputData { status: Status::Finished, message: format!("{e:?}"), // debug formatting to print backtrace from anyhow result: OutputResult::Error, @@ -96,19 +96,19 @@ fn run_inner() -> Result<(), ()> { let pretty = matches.pretty; notification_reporter::init(Box::new(move |warning| { - let warning_output = OutputKind::Notification(warning); + let warning_output = CliOutput::Notification(warning); if let Err(err) = print_output(&warning_output, pretty) { log::error!("printing warning failed: {}", err); } })); progress_reporter::subscribe::<(), _>(move |update| { - let output = OutputKind::StatusUpdate(StatusUpdateData::None(update)); + let output = CliOutput::StatusUpdate(StatusUpdateData::None(update)); let _r = print_output(&output, pretty); }); progress_reporter::subscribe::(move |update| { - let output = OutputKind::StatusUpdate(StatusUpdateData::ClientUpdateData(update)); + let output = CliOutput::StatusUpdate(StatusUpdateData::ClientUpdateData(update)); let _r = print_output(&output, pretty); }); @@ -118,7 +118,7 @@ fn run_inner() -> Result<(), ()> { let message = error_message_special_casing(&e); let kind = solve_error_kind(&e); let sandbox_path = check_sandbox_err(&e); - let error_output = OutputKind::OutputData(Box::new(OutputData { + let error_output = CliOutput::OutputData(Box::new(OutputData { status: Status::Finished, message, result: OutputResult::Error, @@ -222,13 +222,13 @@ fn run_app(matches: Opt) -> Result<()> { file_util::lock!(exercise_path); let check_result = run_checkstyle_write_results(&exercise_path, output_path.as_deref(), locale)?; - OutputKind::finished_with_data("ran checkstyle", check_result.map(DataKind::Validation)) + CliOutput::finished_with_data("ran checkstyle", check_result.map(DataKind::Validation)) } Command::Clean { exercise_path } => { file_util::lock!(exercise_path); tmc_langs::clean(&exercise_path)?; - OutputKind::finished(format!("cleaned exercise at {}", exercise_path.display())) + CliOutput::finished(format!("cleaned exercise at {}", exercise_path.display())) } Command::CompressProject { @@ -239,7 +239,7 @@ fn run_app(matches: Opt) -> Result<()> { } => { file_util::lock!(exercise_path); tmc_langs::compress_project_to(&exercise_path, &output_path, compression, naive)?; - OutputKind::finished(format!( + CliOutput::finished(format!( "compressed project from {} to {}", exercise_path.display(), output_path.display() @@ -266,7 +266,7 @@ fn run_app(matches: Opt) -> Result<()> { tmc_langs::extract_project(Cursor::new(data), &output_path, compression, true, naive)?; - OutputKind::finished(format!( + CliOutput::finished(format!( "extracted project from {} to {}", archive_path.display(), output_path.display() @@ -276,7 +276,7 @@ fn run_app(matches: Opt) -> Result<()> { Command::FastAvailablePoints { exercise_path } => { file_util::lock!(exercise_path); let points = tmc_langs::get_available_points(&exercise_path)?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( format!("found {} available points", points.len()), DataKind::AvailablePoints(points), ) @@ -297,7 +297,7 @@ fn run_app(matches: Opt) -> Result<()> { if let Some(output_path) = output_path { write_result_to_file_as_json(&exercises, &output_path, matches.pretty, None)?; } - OutputKind::finished_with_data( + CliOutput::finished_with_data( format!("found exercises at {}", exercise_path.display()), DataKind::Exercises(exercises), ) @@ -318,7 +318,7 @@ fn run_app(matches: Opt) -> Result<()> { if let Some(output_path) = output_path { write_result_to_file_as_json(&config, &output_path, matches.pretty, None)?; } - OutputKind::finished_with_data( + CliOutput::finished_with_data( format!( "created exercise packaging config from {}", exercise_path.display(), @@ -333,7 +333,7 @@ fn run_app(matches: Opt) -> Result<()> { let local_exercises = tmc_langs::list_local_course_exercises(client_name, &course_slug)?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( format!("listed local exercises for {}", course_slug), DataKind::LocalExercises(local_exercises), ) @@ -350,7 +350,7 @@ fn run_app(matches: Opt) -> Result<()> { exercise_path.display(), ) })?; - OutputKind::finished(format!( + CliOutput::finished(format!( "prepared solutions for {} at {}", exercise_path.display(), output_path.display() @@ -368,7 +368,7 @@ fn run_app(matches: Opt) -> Result<()> { exercise_path.display(), ) })?; - OutputKind::finished(format!( + CliOutput::finished(format!( "prepared stubs for {} at {}", exercise_path.display(), output_path.display() @@ -426,7 +426,7 @@ fn run_app(matches: Opt) -> Result<()> { stub_archive_path.as_deref().map(|p| (p, stub_compression)), output_format, )?; - OutputKind::finished(format!( + CliOutput::finished(format!( "prepared submission for {} at {}", submission_path.display(), output_path.display() @@ -448,7 +448,7 @@ fn run_app(matches: Opt) -> Result<()> { cache_root, ) .with_context(|| format!("Failed to refresh course {}", course_name))?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( format!("refreshed course {}", course_name), DataKind::RefreshResult(refresh_result), ) @@ -506,7 +506,7 @@ fn run_app(matches: Opt) -> Result<()> { )?; } - OutputKind::finished_with_data( + CliOutput::finished_with_data( format!("ran tests for {}", exercise_path.display()), DataKind::TestResult(test_result), ) @@ -546,7 +546,7 @@ fn run_app(matches: Opt) -> Result<()> { write_result_to_file_as_json(&scan_result, &output_path, matches.pretty, None)?; } - OutputKind::finished_with_data( + CliOutput::finished_with_data( format!("scanned exercise at {}", exercise_path.display()), DataKind::ExerciseDesc(scan_result), ) @@ -556,7 +556,7 @@ fn run_app(matches: Opt) -> Result<()> { Ok(()) } -fn run_core(client_name: &str, client_version: &str, core: Core) -> Result { +fn run_core(client_name: &str, client_version: &str, core: Core) -> Result { let root_url = env::var("TMC_LANGS_ROOT_URL") .unwrap_or_else(|_| "https://tmc.mooc.fi/".to_string()) .parse() @@ -593,7 +593,7 @@ fn run_core_inner( core: Core, mut client: TmcClient, credentials: &mut Option, -) -> Result { +) -> Result { let output = match core { Core::CheckExerciseUpdates => { let projects_dir = tmc_langs::get_projects_dir(client_name)?; @@ -603,7 +603,7 @@ fn run_core_inner( .map(|id| UpdatedExercise { id }) .collect::>(); - OutputKind::finished_with_data( + CliOutput::finished_with_data( "updated exercises", DataKind::UpdatedExercises(updated_exercises), ) @@ -616,7 +616,7 @@ fn run_core_inner( client .download_model_solution(exercise_id, &target) .context("Failed to download model solution")?; - OutputKind::finished("downloaded model solution") + CliOutput::finished("downloaded model solution") } Core::DownloadOldSubmission { @@ -632,7 +632,7 @@ fn run_core_inner( submission_id, save_old_state, )?; - OutputKind::finished("extracted project") + CliOutput::finished("extracted project") } Core::DownloadOrUpdateCourseExercises { @@ -664,7 +664,7 @@ fn run_core_inner( failed: Some(failed), }, }; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "downloaded or updated exercises", DataKind::ExerciseDownload(data), ) @@ -673,7 +673,7 @@ fn run_core_inner( Core::GetCourseData { course_id } => { let data = tmc_langs::get_course_data(&client, course_id) .context("Failed to get course data")?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "fetched course data", DataKind::CombinedCourseData(Box::new(data)), ) @@ -683,7 +683,7 @@ fn run_core_inner( let details = client .get_course_details(course_id) .context("Failed to get course details")?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "fetched course details", DataKind::CourseDetails(details), ) @@ -693,7 +693,7 @@ fn run_core_inner( let exercises = client .get_course_exercises(course_id) .context("Failed to get course")?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "fetched course exercises", DataKind::CourseExercises(exercises), ) @@ -703,24 +703,21 @@ fn run_core_inner( let settings = client .get_course(course_id) .context("Failed to get course")?; - OutputKind::finished_with_data( - "fetched course settings", - DataKind::CourseData(settings), - ) + CliOutput::finished_with_data("fetched course settings", DataKind::CourseData(settings)) } Core::GetCourses { organization } => { let courses = client .list_courses(&organization) .context("Failed to get courses")?; - OutputKind::finished_with_data("fetched courses", DataKind::Courses(courses)) + CliOutput::finished_with_data("fetched courses", DataKind::Courses(courses)) } Core::GetExerciseDetails { exercise_id } => { let course = client .get_exercise_details(exercise_id) .context("Failed to get course")?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "fetched exercise details", DataKind::ExerciseDetails(course), ) @@ -730,7 +727,7 @@ fn run_core_inner( let submissions = client .get_exercise_submissions_for_current_user(exercise_id) .context("Failed to get submissions")?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "fetched exercise submissions", DataKind::Submissions(submissions), ) @@ -754,7 +751,7 @@ fn run_core_inner( let update_result = client .get_exercise_updates(course_id, checksums) .context("Failed to get exercise updates")?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "fetched exercise updates", DataKind::UpdateResult(update_result), ) @@ -764,33 +761,33 @@ fn run_core_inner( let org = client .get_organization(&organization) .context("Failed to get organization")?; - OutputKind::finished_with_data("fetched organization", DataKind::Organization(org)) + CliOutput::finished_with_data("fetched organization", DataKind::Organization(org)) } Core::GetOrganizations => { let orgs = client .get_organizations() .context("Failed to get organizations")?; - OutputKind::finished_with_data("fetched organizations", DataKind::Organizations(orgs)) + CliOutput::finished_with_data("fetched organizations", DataKind::Organizations(orgs)) } Core::GetUnreadReviews { course_id } => { let reviews = client .get_unread_reviews(course_id) .context("Failed to get unread reviews")?; - OutputKind::finished_with_data("fetched unread reviews", DataKind::Reviews(reviews)) + CliOutput::finished_with_data("fetched unread reviews", DataKind::Reviews(reviews)) } Core::LoggedIn => { if let Some(credentials) = credentials { - OutputKind::OutputData(Box::new(OutputData { + CliOutput::OutputData(Box::new(OutputData { status: Status::Finished, message: "currently logged in".to_string(), result: OutputResult::LoggedIn, data: Some(DataKind::Token(credentials.token())), })) } else { - OutputKind::OutputData(Box::new(OutputData { + CliOutput::OutputData(Box::new(OutputData { status: Status::Finished, message: "currently not logged in".to_string(), result: OutputResult::NotLoggedIn, @@ -831,7 +828,7 @@ fn run_core_inner( // create token file Credentials::save(client_name, token)?; - OutputKind::OutputData(Box::new(OutputData { + CliOutput::OutputData(Box::new(OutputData { status: Status::Finished, message: "logged in".to_string(), result: OutputResult::LoggedIn, @@ -843,7 +840,7 @@ fn run_core_inner( if let Some(credentials) = credentials.take() { credentials.remove()?; } - OutputKind::OutputData(Box::new(OutputData { + CliOutput::OutputData(Box::new(OutputData { status: Status::Finished, message: "logged out".to_string(), result: OutputResult::LoggedOut, @@ -858,7 +855,7 @@ fn run_core_inner( client .mark_review_as_read(course_id, review_id) .context("Failed to mark review as read")?; - OutputKind::finished("marked review as read") + CliOutput::finished("marked review as read") } Core::Paste { @@ -872,7 +869,7 @@ fn run_core_inner( let new_submission = client .paste(exercise_id, &submission_path, paste_message, locale) .context("Failed to get paste with comment")?; - OutputKind::finished_with_data("sent paste", DataKind::NewSubmission(new_submission)) + CliOutput::finished_with_data("sent paste", DataKind::NewSubmission(new_submission)) } Core::RequestCodeReview { @@ -890,7 +887,7 @@ fn run_core_inner( Some(locale), ) .context("Failed to request code review")?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "requested code review", DataKind::NewSubmission(new_submission), ) @@ -907,7 +904,7 @@ fn run_core_inner( client.submit(exercise_id, &exercise_path, None)?; } tmc_langs::reset(&client, exercise_id, &exercise_path)?; - OutputKind::finished("reset exercise") + CliOutput::finished("reset exercise") } Core::SendFeedback { @@ -939,7 +936,7 @@ fn run_core_inner( } else { panic!("validation error") }; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "sent feedback", DataKind::SubmissionFeedbackResponse(response), ) @@ -958,7 +955,7 @@ fn run_core_inner( .context("Failed to submit")?; if dont_block { - OutputKind::finished_with_data( + CliOutput::finished_with_data( "submit exercise", DataKind::NewSubmission(new_submission), ) @@ -968,7 +965,7 @@ fn run_core_inner( let submission_finished = client .wait_for_submission_at(submission_url) .context("Failed while waiting for submissions")?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "submit exercise", DataKind::SubmissionFinished(submission_finished), ) @@ -978,7 +975,7 @@ fn run_core_inner( Core::UpdateExercises => { let projects_dir = tmc_langs::get_projects_dir(client_name)?; let data = tmc_langs::update_exercises(&client, &projects_dir)?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "downloaded or updated exercises", DataKind::ExerciseDownload(data), ) @@ -988,7 +985,7 @@ fn run_core_inner( let submission_finished = client .wait_for_submission(submission_id) .context("Failed while waiting for submissions")?; - OutputKind::finished_with_data( + CliOutput::finished_with_data( "finished waiting for submission", DataKind::SubmissionFinished(submission_finished), ) @@ -997,16 +994,16 @@ fn run_core_inner( Ok(output) } -fn run_settings(client_name: &str, settings: Settings) -> Result { +fn run_settings(client_name: &str, settings: Settings) -> Result { let output = match settings { Settings::Get { setting } => { let value = tmc_langs::get_setting(client_name, &setting)?; - OutputKind::finished_with_data("retrieved value", DataKind::ConfigValue(value)) + CliOutput::finished_with_data("retrieved value", DataKind::ConfigValue(value)) } Settings::List => { let tmc_config = tmc_langs::get_settings(client_name)?; - OutputKind::finished_with_data("retrieved settings", DataKind::TmcConfig(tmc_config)) + CliOutput::finished_with_data("retrieved settings", DataKind::TmcConfig(tmc_config)) } Settings::Migrate { @@ -1026,19 +1023,19 @@ fn run_settings(client_name: &str, settings: Settings) -> Result { &exercise_checksum, &exercise_path, )?; - OutputKind::finished("migrated exercise") + CliOutput::finished("migrated exercise") } Settings::MoveProjectsDir { dir } => { let config_path = TmcConfig::get_location(client_name)?; let tmc_config = TmcConfig::load(client_name, &config_path)?; tmc_langs::move_projects_dir(tmc_config, &config_path, dir)?; - OutputKind::finished("moved project directory") + CliOutput::finished("moved project directory") } Settings::Reset => { tmc_langs::reset_settings(client_name)?; - OutputKind::finished("reset settings") + CliOutput::finished("reset settings") } Settings::Set { key, json, base64 } => { @@ -1049,24 +1046,24 @@ fn run_settings(client_name: &str, settings: Settings) -> Result { deserialize::json_from_str(&json)? }; tmc_langs::set_setting(client_name, &key, &json)?; - OutputKind::finished("set setting") + CliOutput::finished("set setting") } Settings::Unset { setting } => { tmc_langs::unset_setting(client_name, &setting)?; - OutputKind::finished("unset setting") + CliOutput::finished("unset setting") } }; Ok(output) } -fn print_output(output: &OutputKind, pretty: bool) -> Result { +fn print_output(output: &CliOutput, pretty: bool) -> Result { print_output_with_file(output, pretty, None) } #[allow(clippy::print_stdout)] // this is the only function that should output to stdout/stderr across tmc-langs fn print_output_with_file( - output: &OutputKind, + output: &CliOutput, pretty: bool, path: Option, ) -> Result { diff --git a/crates/tmc-langs-cli/src/output.rs b/crates/tmc-langs-cli/src/output.rs index a0db21ae62c..5c61f0e126b 100644 --- a/crates/tmc-langs-cli/src/output.rs +++ b/crates/tmc-langs-cli/src/output.rs @@ -17,7 +17,7 @@ use tmc_langs_util::progress_reporter::StatusUpdate; #[serde(rename_all = "kebab-case")] #[serde(tag = "output-kind")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] -pub enum OutputKind { +pub enum CliOutput { /// Data that is output at the end of a command. OutputData(Box), /// Status update output as a command progresses. @@ -26,7 +26,7 @@ pub enum OutputKind { Notification(Notification), } -impl OutputKind { +impl CliOutput { pub fn finished_with_data( message: impl Into, data: impl Into>, @@ -172,7 +172,7 @@ mod test { #[test] fn output_data_none() { - let output_data = OutputKind::OutputData(Box::new(OutputData { + let output_data = CliOutput::OutputData(Box::new(OutputData { status: Status::Finished, message: "output with no data".to_string(), result: OutputResult::ExecutedCommand, @@ -185,7 +185,7 @@ mod test { #[test] fn output_data_error() { - let output_data = OutputKind::OutputData(Box::new(OutputData { + let output_data = CliOutput::OutputData(Box::new(OutputData { status: Status::Finished, message: "errored!".to_string(), result: OutputResult::Error, @@ -201,7 +201,7 @@ mod test { #[test] fn output_data_dl() { - let output_data = OutputKind::OutputData(Box::new(OutputData { + let output_data = CliOutput::OutputData(Box::new(OutputData { status: Status::Finished, message: "downloaded things".to_string(), result: OutputResult::ExecutedCommand, @@ -239,7 +239,7 @@ mod test { #[test] fn status_update() { let status_update = - OutputKind::StatusUpdate(StatusUpdateData::ClientUpdateData(StatusUpdate { + CliOutput::StatusUpdate(StatusUpdateData::ClientUpdateData(StatusUpdate { data: Some(ClientUpdateData::ExerciseDownload { id: 1234, path: PathBuf::from("some path"), @@ -256,9 +256,73 @@ mod test { #[test] fn notification() { - let status_update = OutputKind::Notification(Notification::warning("some warning")); + let status_update = CliOutput::Notification(Notification::warning("some warning")); let actual = serde_json::to_string_pretty(&status_update).unwrap(); let expected = read_api_file("warnings.json"); assert_eq!(actual, expected); } } + +#[test] +#[ignore] +#[cfg(feature = "ts-rs")] +fn generate_output_definition() { + use tmc_langs::*; + + let mut f = std::fs::File::create("./bindings.d.ts").unwrap(); + ts_rs::export_to!( + &mut f, + CliOutput, + OutputData, + StatusUpdateData, + Notification, + Status, + OutputResult, + ClientUpdateData, + StatusUpdate<()>, + notification_reporter::NotificationKind, + DataKind, + NewSubmission, + Kind, + StyleValidationResult, + ExerciseDownload, + StyleValidationStrategy, + StyleValidationError, + ExercisePackagingConfiguration, + LocalExercise, + RefreshData, + RunResult, + ExerciseDesc, + RefreshExercise, + RunStatus, + TestResult, + TestDesc, + TmcProjectYml, + UpdatedExercise, + DownloadOrUpdateCourseExercisesResult, + CombinedCourseData, + CourseDetails, + CourseExercise, + CourseData, + Course, + ExerciseDetails, + Submission, + UpdateResult, + Organization, + Review, + Exercise, + ExerciseSubmission, + ExercisePoint, + Exercise, + PythonVer, + TmcConfig, + ConfigValue, + SubmissionFinished, + SubmissionFeedbackResponse, + SubmissionStatus, + SubmissionFeedbackQuestion, + TestCase, + SubmissionFeedbackKind, + ) + .unwrap(); +} diff --git a/crates/tmc-langs-framework/Cargo.toml b/crates/tmc-langs-framework/Cargo.toml index 2d32fc8e4d4..d37e0977fae 100644 --- a/crates/tmc-langs-framework/Cargo.toml +++ b/crates/tmc-langs-framework/Cargo.toml @@ -21,7 +21,7 @@ schemars = "0.8.8" subprocess = "0.2.8" tar = "0.4.38" tempfile = "3.3.0" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "d1eeeabc857b824f3cdaec97270c33d3cf0eda35", features = [ "serde-compat", ], optional = true } thiserror = "1.0.30" diff --git a/crates/tmc-langs-util/Cargo.toml b/crates/tmc-langs-util/Cargo.toml index c7ec6141d7f..2c574c51335 100644 --- a/crates/tmc-langs-util/Cargo.toml +++ b/crates/tmc-langs-util/Cargo.toml @@ -18,7 +18,7 @@ serde_yaml = "0.9.10" tempfile = "3.3.0" thiserror = "1.0.30" toml = "0.5.8" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "d1eeeabc857b824f3cdaec97270c33d3cf0eda35", features = [ "serde-compat", ], optional = true } type-map = "0.5.0" diff --git a/crates/tmc-langs/Cargo.toml b/crates/tmc-langs/Cargo.toml index 3b0dc07812c..ee915657e06 100644 --- a/crates/tmc-langs/Cargo.toml +++ b/crates/tmc-langs/Cargo.toml @@ -35,7 +35,7 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.30" toml = "0.5.8" -ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "7869099baa0fbeb155792ac986dbfc4c6d94136a", features = [ +ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "d1eeeabc857b824f3cdaec97270c33d3cf0eda35", features = [ "serde-compat", "toml-impl", ], optional = true } From 62f57658500ea7b35f482cec620119a09617fbe7 Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Mon, 24 Oct 2022 08:48:29 +0300 Subject: [PATCH 14/15] Remove duplicate --- crates/tmc-langs-cli/bindings.d.ts | 2 -- crates/tmc-langs-cli/src/output.rs | 1 - 2 files changed, 3 deletions(-) diff --git a/crates/tmc-langs-cli/bindings.d.ts b/crates/tmc-langs-cli/bindings.d.ts index 392aa6269e1..cfe942c0404 100644 --- a/crates/tmc-langs-cli/bindings.d.ts +++ b/crates/tmc-langs-cli/bindings.d.ts @@ -80,8 +80,6 @@ export interface ExerciseSubmission { exercise_name: string, id: number, user_id export interface ExercisePoint { id: number, exercise_id: number, name: string, requires_review: boolean, } -export interface Exercise { id: number, name: string, locked: boolean, deadline_description: string | null, deadline: string | null, soft_deadline: string | null, soft_deadline_description: string | null, checksum: string, return_url: string, zip_url: string, returnable: boolean, requires_review: boolean, attempted: boolean, completed: boolean, reviewed: boolean, all_review_points_given: boolean, memory_limit: number | null, runtime_params: Array, valgrind_strategy: string | null, code_review_requests_enabled: boolean, run_tests_locally_action_enabled: boolean, latest_submission_url: string | null, latest_submission_id: number | null, solution_zip_url: string | null, } - export interface PythonVer { major: number | null, minor: number | null, patch: number | null, } export interface TmcConfig { projects_dir: string, } diff --git a/crates/tmc-langs-cli/src/output.rs b/crates/tmc-langs-cli/src/output.rs index 5c61f0e126b..23bca372e97 100644 --- a/crates/tmc-langs-cli/src/output.rs +++ b/crates/tmc-langs-cli/src/output.rs @@ -313,7 +313,6 @@ fn generate_output_definition() { Exercise, ExerciseSubmission, ExercisePoint, - Exercise, PythonVer, TmcConfig, ConfigValue, From 953f3af9a3fe540ae4b1d4e90be117f12c495eac Mon Sep 17 00:00:00 2001 From: Heliozoa Date: Mon, 7 Nov 2022 10:24:12 +0200 Subject: [PATCH 15/15] 0.27.0 --- CONTRIBUTING.md | 6 +- Cargo.lock | 26 +++---- Cargo.toml | 1 + crates/bindings/tmc-langs-node/Cargo.toml | 2 +- crates/bindings/tmc-langs-node/src/helpers.rs | 14 ++++ crates/bindings/tmc-langs-node/src/lib.rs | 10 ++- crates/helpers/tmc-server-mock/Cargo.toml | 2 +- crates/plugins/csharp/Cargo.toml | 2 +- crates/plugins/java/Cargo.toml | 2 +- crates/plugins/make/Cargo.toml | 2 +- crates/plugins/notests/Cargo.toml | 2 +- crates/plugins/python3/Cargo.toml | 2 +- crates/plugins/r/Cargo.toml | 2 +- crates/tmc-client/Cargo.toml | 2 +- crates/tmc-langs-cli/Cargo.toml | 2 +- crates/tmc-langs-cli/src/app.rs | 3 + crates/tmc-langs-cli/src/lib.rs | 13 +++- crates/tmc-langs-framework/Cargo.toml | 2 +- crates/tmc-langs-framework/src/plugin.rs | 14 ++-- crates/tmc-langs-plugins/Cargo.toml | 2 +- crates/tmc-langs-plugins/src/lib.rs | 2 +- crates/tmc-langs-util/Cargo.toml | 2 +- crates/tmc-langs-util/src/file_util.rs | 6 +- crates/tmc-langs/src/lib.rs | 8 ++- crates/tmc-langs/src/submission_packaging.rs | 71 +++++++++++++++---- docker-build.sh | 5 ++ docker/Dockerfile | 19 +++-- 27 files changed, 159 insertions(+), 65 deletions(-) create mode 100644 docker-build.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b79425b7f83..ec1358df98b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,13 +37,17 @@ cargo test ``` ## Building and testing with Docker + Build the binary in Docker and copy it to the current directory (this can be useful to create a binary linked with an older glibc): + ```bash export DOCKER_BUILDKIT=1 docker build . -f docker/Dockerfile -t tmc-langs-rust -docker run --rm -v $PWD:/build/out tmc-langs-rust bash -c "cargo build && cp /build/target/debug/tmc-langs-cli /build/out/" +docker run --rm -v "$PWD":/build/out tmc-langs-rust bash -c "cargo build && cp /build/target/debug/tmc-langs-cli /build/out/" ``` + Run tests in Docker: + ```bash export DOCKER_BUILDKIT=1 docker build . -f docker/Dockerfile -t tmc-langs-rust diff --git a/Cargo.lock b/Cargo.lock index 48f8e5e70a6..30260072238 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2223,7 +2223,7 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tmc-client" -version = "0.1.0" +version = "0.27.0" dependencies = [ "chrono", "dirs 4.0.0", @@ -2292,7 +2292,7 @@ dependencies = [ [[package]] name = "tmc-langs-cli" -version = "0.26.0" +version = "0.27.0" dependencies = [ "anyhow", "base64", @@ -2320,7 +2320,7 @@ dependencies = [ [[package]] name = "tmc-langs-csharp" -version = "0.1.0" +version = "0.27.0" dependencies = [ "dirs 4.0.0", "log", @@ -2338,7 +2338,7 @@ dependencies = [ [[package]] name = "tmc-langs-framework" -version = "0.1.0" +version = "0.27.0" dependencies = [ "fd-lock", "isolang", @@ -2363,7 +2363,7 @@ dependencies = [ [[package]] name = "tmc-langs-java" -version = "0.1.0" +version = "0.27.0" dependencies = [ "dirs 4.0.0", "flate2", @@ -2384,7 +2384,7 @@ dependencies = [ [[package]] name = "tmc-langs-make" -version = "0.1.0" +version = "0.27.0" dependencies = [ "log", "once_cell", @@ -2403,7 +2403,7 @@ dependencies = [ [[package]] name = "tmc-langs-node" -version = "0.1.0" +version = "0.27.0" dependencies = [ "base64", "env_logger", @@ -2421,7 +2421,7 @@ dependencies = [ [[package]] name = "tmc-langs-notests" -version = "0.1.0" +version = "0.27.0" dependencies = [ "log", "simple_logger 3.0.0", @@ -2433,7 +2433,7 @@ dependencies = [ [[package]] name = "tmc-langs-plugins" -version = "0.1.0" +version = "0.27.0" dependencies = [ "impl-enum", "log", @@ -2456,7 +2456,7 @@ dependencies = [ [[package]] name = "tmc-langs-python3" -version = "0.1.0" +version = "0.27.0" dependencies = [ "dunce", "hex", @@ -2479,7 +2479,7 @@ dependencies = [ [[package]] name = "tmc-langs-r" -version = "0.1.0" +version = "0.27.0" dependencies = [ "log", "serde", @@ -2495,7 +2495,7 @@ dependencies = [ [[package]] name = "tmc-langs-util" -version = "0.1.0" +version = "0.27.0" dependencies = [ "fd-lock", "log", @@ -2517,7 +2517,7 @@ dependencies = [ [[package]] name = "tmc-server-mock" -version = "0.1.0" +version = "0.27.0" dependencies = [ "mockito", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 68d35322097..4baca837624 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ members = [ resolver = "2" [workspace.package] +version = "0.27.0" authors = [ "University of Helsinki ", "Daniel Martinez ", diff --git a/crates/bindings/tmc-langs-node/Cargo.toml b/crates/bindings/tmc-langs-node/Cargo.toml index e923cbbb532..2ac9bb262af 100644 --- a/crates/bindings/tmc-langs-node/Cargo.toml +++ b/crates/bindings/tmc-langs-node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-node" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true description = "Bindings to the tmc-langs library for Node" diff --git a/crates/bindings/tmc-langs-node/src/helpers.rs b/crates/bindings/tmc-langs-node/src/helpers.rs index 7fa9c502271..e48682f3eb3 100644 --- a/crates/bindings/tmc-langs-node/src/helpers.rs +++ b/crates/bindings/tmc-langs-node/src/helpers.rs @@ -99,6 +99,20 @@ macro_rules! parse_args { parse_arg!($cx, $ty8, 8), ); }; + ($cx: ident, $id0: ident : $ty0: path, $id1: ident : $ty1: path, $id2: ident : $ty2: path, $id3: ident : $ty3: path, $id4: ident : $ty4: path, $id5: ident : $ty5: path, $id6: ident : $ty6: path, $id7: ident : $ty7: path, $id8: ident : $ty8: path, $id9: ident : $ty9: path) => { + let ($id0, $id1, $id2, $id3, $id4, $id5, $id6, $id7, $id8, $id9) = ( + parse_arg!($cx, $ty0, 0), + parse_arg!($cx, $ty1, 1), + parse_arg!($cx, $ty2, 2), + parse_arg!($cx, $ty3, 3), + parse_arg!($cx, $ty4, 4), + parse_arg!($cx, $ty5, 5), + parse_arg!($cx, $ty6, 6), + parse_arg!($cx, $ty7, 7), + parse_arg!($cx, $ty8, 8), + parse_arg!($cx, $ty9, 9), + ); + }; } pub fn convert_err(cx: &mut FunctionContext, e: E) -> Throw { diff --git a/crates/bindings/tmc-langs-node/src/lib.rs b/crates/bindings/tmc-langs-node/src/lib.rs index 0f23f46e84e..14356b02858 100644 --- a/crates/bindings/tmc-langs-node/src/lib.rs +++ b/crates/bindings/tmc-langs-node/src/lib.rs @@ -14,7 +14,8 @@ use std::{ use thiserror::Error; use tmc_langs::{ file_util, ClientError, Compression, Credentials, DownloadOrUpdateCourseExercisesResult, - FeedbackAnswer, LangsError, Language, NewSubmission, SubmissionFinished, TmcClient, TmcConfig, + FeedbackAnswer, LangsError, Language, NewSubmission, PrepareSubmission, SubmissionFinished, + TmcClient, TmcConfig, }; #[derive(Debug, Error)] @@ -185,6 +186,7 @@ fn prepare_submission(mut cx: FunctionContext) -> JsResult { stub_compression: Compression, submission_path: PathBuf, submission_compression: Compression, + extract_submission_naively: bool, tmc_param: Vec<(String, Vec)>, top_level_dir_name: Option ); @@ -210,7 +212,11 @@ fn prepare_submission(mut cx: FunctionContext) -> JsResult { }; let res = tmc_langs::prepare_submission( - (&submission_path, submission_compression), + PrepareSubmission { + archive: &submission_path, + compression: submission_compression, + extract_naively: extract_submission_naively, + }, &output_path, top_level_dir_name, tmc_params, diff --git a/crates/helpers/tmc-server-mock/Cargo.toml b/crates/helpers/tmc-server-mock/Cargo.toml index a88384b4b7a..da157d374bd 100644 --- a/crates/helpers/tmc-server-mock/Cargo.toml +++ b/crates/helpers/tmc-server-mock/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-server-mock" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/plugins/csharp/Cargo.toml b/crates/plugins/csharp/Cargo.toml index 638b082c74d..d1540077d73 100644 --- a/crates/plugins/csharp/Cargo.toml +++ b/crates/plugins/csharp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-csharp" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/plugins/java/Cargo.toml b/crates/plugins/java/Cargo.toml index 0e32ff00b51..c0528bc2a63 100644 --- a/crates/plugins/java/Cargo.toml +++ b/crates/plugins/java/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-java" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/plugins/make/Cargo.toml b/crates/plugins/make/Cargo.toml index 4dbffa30266..c25e7be5972 100644 --- a/crates/plugins/make/Cargo.toml +++ b/crates/plugins/make/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-make" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/plugins/notests/Cargo.toml b/crates/plugins/notests/Cargo.toml index 1e260cad2b5..7112881b20f 100644 --- a/crates/plugins/notests/Cargo.toml +++ b/crates/plugins/notests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-notests" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/plugins/python3/Cargo.toml b/crates/plugins/python3/Cargo.toml index ddaff218d5e..acc4c117333 100644 --- a/crates/plugins/python3/Cargo.toml +++ b/crates/plugins/python3/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-python3" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/plugins/r/Cargo.toml b/crates/plugins/r/Cargo.toml index d72f4bea21a..3d2cdc2126c 100644 --- a/crates/plugins/r/Cargo.toml +++ b/crates/plugins/r/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-r" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/tmc-client/Cargo.toml b/crates/tmc-client/Cargo.toml index 7b66142d6fb..a4752dd42ef 100644 --- a/crates/tmc-client/Cargo.toml +++ b/crates/tmc-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-client" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/tmc-langs-cli/Cargo.toml b/crates/tmc-langs-cli/Cargo.toml index ccbb8fe00c8..11d1fd4d7fb 100644 --- a/crates/tmc-langs-cli/Cargo.toml +++ b/crates/tmc-langs-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-cli" -version = "0.26.0" +version.workspace = true authors.workspace = true edition.workspace = true description = "CLI client for TMC" diff --git a/crates/tmc-langs-cli/src/app.rs b/crates/tmc-langs-cli/src/app.rs index 4f2235cfac2..f11c8599911 100644 --- a/crates/tmc-langs-cli/src/app.rs +++ b/crates/tmc-langs-cli/src/app.rs @@ -182,6 +182,9 @@ pub enum Command { /// Compression algorithm used for the submission. #[clap(long, default_value_t = Compression::Zip)] submission_compression: Compression, + /// If set, the submission is extracted without trying to find a project directory inside it. This can be useful if the submission is minimal and doesn't contain enough files to detect the project. + #[clap(long)] + extract_submission_naively: bool, /// A key-value pair in the form key=value to be written into .tmcparams. If multiple pairs with the same key are given, the values are collected into an array. #[clap(long)] tmc_param: Vec, diff --git a/crates/tmc-langs-cli/src/lib.rs b/crates/tmc-langs-cli/src/lib.rs index 23f2eafbc4b..e57d483f450 100644 --- a/crates/tmc-langs-cli/src/lib.rs +++ b/crates/tmc-langs-cli/src/lib.rs @@ -65,7 +65,8 @@ pub fn run() { result: OutputResult::Error, data: None, })); - print_output(&output, false).expect("this should never fail"); + let pretty = std::env::args().find(|arg| arg == "--pretty").is_some(); + print_output(&output, pretty).expect("this should never fail"); quit::with_code(1); } @@ -89,7 +90,8 @@ fn run_inner() -> Result<(), ()> { trace: causes, }), })); - print_output(&error_output, false).expect("failed to print output"); + let pretty = std::env::args().find(|arg| arg == "--pretty").is_some(); + print_output(&error_output, pretty).expect("failed to print output"); return Err(()); } }; @@ -383,6 +385,7 @@ fn run_app(matches: Opt) -> Result<()> { stub_compression, submission_path, submission_compression, + extract_submission_naively, tmc_param, top_level_dir_name, } => { @@ -418,7 +421,11 @@ fn run_app(matches: Opt) -> Result<()> { } tmc_langs::prepare_submission( - (&submission_path, submission_compression), + tmc_langs::PrepareSubmission { + archive: &submission_path, + compression: submission_compression, + extract_naively: extract_submission_naively, + }, &output_path, top_level_dir_name, tmc_params, diff --git a/crates/tmc-langs-framework/Cargo.toml b/crates/tmc-langs-framework/Cargo.toml index d37e0977fae..9bab8d444f0 100644 --- a/crates/tmc-langs-framework/Cargo.toml +++ b/crates/tmc-langs-framework/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-framework" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/tmc-langs-framework/src/plugin.rs b/crates/tmc-langs-framework/src/plugin.rs index 9156876e0fc..8e55b6a95bd 100644 --- a/crates/tmc-langs-framework/src/plugin.rs +++ b/crates/tmc-langs-framework/src/plugin.rs @@ -210,14 +210,15 @@ pub trait LanguagePlugin { /// Overwrites all files. fn extract_student_files( compressed_project: impl Read + Seek, + compression: Compression, target_location: &Path, ) -> Result<(), TmcError> { log::debug!("Extracting student files to {}", target_location.display()); - let mut zip_archive = Archive::zip(compressed_project)?; + let mut archive = Archive::new(compressed_project, compression)?; // find the exercise root directory inside the archive - let project_dir = Self::find_project_dir_in_archive(&mut zip_archive)?; + let project_dir = Self::find_project_dir_in_archive(&mut archive)?; log::debug!("Project directory in archive: {}", project_dir.display()); // extract config file if any @@ -225,13 +226,13 @@ pub trait LanguagePlugin { let tmc_project_yml_path = tmc_project_yml_path .to_str() .ok_or_else(|| TmcError::ProjectDirInvalidUtf8(project_dir.clone()))?; - if let Ok(mut file) = zip_archive.by_path(tmc_project_yml_path) { + if let Ok(mut file) = archive.by_path(tmc_project_yml_path) { let target_path = target_location.join(".tmcproject.yml"); file_util::read_to_file(&mut file, target_path)?; } let policy = Self::StudentFilePolicy::new(target_location)?; - let mut iter = zip_archive.iter()?; + let mut iter = archive.iter()?; loop { let next = iter.with_next::<(), _>(|mut file| { // get the path where the file should be extracted @@ -767,6 +768,7 @@ def f(): MockPlugin::extract_student_files( std::io::Cursor::new(zip), + Compression::Zip, &temp.path().join("extracted"), ) .unwrap(); @@ -790,6 +792,7 @@ def f(): MockPlugin::extract_student_files( std::io::Cursor::new(zip), + Compression::Zip, &temp.path().join("extracted"), ) .unwrap(); @@ -825,6 +828,7 @@ def f(): MockPlugin::extract_student_files( std::io::Cursor::new(zip), + Compression::Zip, &temp.path().join("extracted"), ) .unwrap(); @@ -1077,7 +1081,7 @@ force_update: .unwrap(); let buf = zw.finish().unwrap(); - MockPlugin::extract_student_files(buf, temp.path()).unwrap(); + MockPlugin::extract_student_files(buf, Compression::Zip, temp.path()).unwrap(); assert!(temp.path().join("src/file").exists()); } } diff --git a/crates/tmc-langs-plugins/Cargo.toml b/crates/tmc-langs-plugins/Cargo.toml index 18335f87431..0446e318345 100644 --- a/crates/tmc-langs-plugins/Cargo.toml +++ b/crates/tmc-langs-plugins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-plugins" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/tmc-langs-plugins/src/lib.rs b/crates/tmc-langs-plugins/src/lib.rs index 7c92ec6836e..74e4d95464c 100644 --- a/crates/tmc-langs-plugins/src/lib.rs +++ b/crates/tmc-langs-plugins/src/lib.rs @@ -104,7 +104,7 @@ pub fn get_exercise_packaging_configuration( pub fn clean(&self, path: &Path) -> Result<(), TmcError> pub fn get_exercise_packaging_configuration(config: TmcProjectYml) -> Result pub fn extract_project(compressed_project: impl std::io::Read + std::io::Seek, target_location: &Path, compression: Compression, clean: bool) -> Result<(), TmcError> - pub fn extract_student_files(compressed_project: impl std::io::Read + std::io::Seek, target_location: &Path) -> Result<(), TmcError> + pub fn extract_student_files(compressed_project: impl std::io::Read + std::io::Seek, compression: Compression, target_location: &Path) -> Result<(), TmcError> pub fn scan_exercise(&self, path: &Path, exercise_name: String) -> Result pub fn run_tests(&self, path: &Path) -> Result pub fn check_code_style(&self, path: &Path, locale: Language) -> Result, TmcError> diff --git a/crates/tmc-langs-util/Cargo.toml b/crates/tmc-langs-util/Cargo.toml index 2c574c51335..aa7df946062 100644 --- a/crates/tmc-langs-util/Cargo.toml +++ b/crates/tmc-langs-util/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tmc-langs-util" -version = "0.1.0" +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/tmc-langs-util/src/file_util.rs b/crates/tmc-langs-util/src/file_util.rs index 63056c5070e..b38debc22eb 100644 --- a/crates/tmc-langs-util/src/file_util.rs +++ b/crates/tmc-langs-util/src/file_util.rs @@ -218,7 +218,7 @@ pub fn copy, Q: AsRef>(source: P, target: Q) -> Result<(), if source.is_file() { if target.is_dir() { - log::debug!( + log::trace!( "copying into dir {} -> {}", source.display(), target.display() @@ -235,7 +235,7 @@ pub fn copy, Q: AsRef>(source: P, target: Q) -> Result<(), source: e, })?; } else { - log::debug!("copying file {} -> {}", source.display(), target.display()); + log::trace!("copying file {} -> {}", source.display(), target.display()); if let Some(parent) = target.parent() { if !parent.exists() { create_dir_all(parent)?; @@ -248,7 +248,7 @@ pub fn copy, Q: AsRef>(source: P, target: Q) -> Result<(), })?; } } else { - log::debug!( + log::trace!( "recursively copying {} -> {}", source.display(), target.display() diff --git a/crates/tmc-langs/src/lib.rs b/crates/tmc-langs/src/lib.rs index a84dea4aec2..f47c152dfa1 100644 --- a/crates/tmc-langs/src/lib.rs +++ b/crates/tmc-langs/src/lib.rs @@ -21,7 +21,7 @@ pub use crate::{ ExerciseDownload, LocalExercise, TmcParams, }, error::{LangsError, ParamError}, - submission_packaging::prepare_submission, + submission_packaging::{prepare_submission, PrepareSubmission}, submission_processing::prepare_solution, }; use hmac::{Hmac, Mac}; @@ -167,7 +167,7 @@ pub fn download_old_submission( log::debug!("downloaded old submission"); // extract submission - extract_student_files(Cursor::new(buf), output_path)?; + extract_student_files(Cursor::new(buf), Compression::Zip, output_path)?; log::debug!("extracted project"); Ok(()) } @@ -403,6 +403,7 @@ pub fn download_or_update_course_exercises( client.download_old_submission(*submission_id, &mut buf)?; if let Err(err) = plugin.extract_student_files( Cursor::new(buf), + Compression::Zip, &download_target.target.path, ) { log::error!( @@ -904,6 +905,7 @@ pub fn scan_exercise(path: &Path, exercise_name: String) -> Result Result<(), LangsError> { log::debug!( @@ -912,7 +914,7 @@ pub fn extract_student_files( ); if let Ok(plugin) = tmc_langs_plugins::get_language_plugin(target_location) { - plugin.extract_student_files(compressed_project, target_location)?; + plugin.extract_student_files(compressed_project, compression, target_location)?; } else { log::debug!( "no matching language plugin found for {}, overwriting", diff --git a/crates/tmc-langs/src/submission_packaging.rs b/crates/tmc-langs/src/submission_packaging.rs index 4ad6d4be2dc..6d24e7be5ba 100644 --- a/crates/tmc-langs/src/submission_packaging.rs +++ b/crates/tmc-langs/src/submission_packaging.rs @@ -1,6 +1,6 @@ //! Submission packaging. -use crate::{data::TmcParams, error::LangsError, Compression}; +use crate::{data::TmcParams, error::LangsError, extract_project_overwrite, Compression}; use once_cell::sync::Lazy; use std::{ io::{Cursor, Write}, @@ -16,9 +16,15 @@ use zip::{write::FileOptions, ZipWriter}; static MUTEX: Lazy> = Lazy::new(|| Mutex::new(())); +pub struct PrepareSubmission<'a> { + pub archive: &'a Path, + pub compression: Compression, + pub extract_naively: bool, +} + /// Prepares a submission for further processing. pub fn prepare_submission( - (submission_archive, submission_compression): (&Path, Compression), + submission: PrepareSubmission, target_path: &Path, toplevel_dir_name: Option, tmc_params: TmcParams, @@ -28,7 +34,7 @@ pub fn prepare_submission( ) -> Result<(), LangsError> { // FIXME: workaround for unknown issues when prepare_submission is ran multiple times in parallel let _m = MUTEX.lock().map_err(|_| LangsError::MutexError)?; - log::debug!("preparing submission for {}", submission_archive.display()); + log::debug!("preparing submission for {}", submission.archive.display()); let plugin = tmc_langs_plugins::get_language_plugin(stub_clone_path)?; @@ -59,6 +65,7 @@ pub fn prepare_submission( }) }, &extract_dest_path, + false, )?; } else { // else, copy clone path @@ -90,8 +97,12 @@ pub fn prepare_submission( // extract student files from submission over base log::debug!("extracting student files"); - let file = file_util::open_file(submission_archive)?; - plugin.extract_student_files(file, &extract_dest_path)?; + let file = file_util::open_file(submission.archive)?; + if submission.extract_naively { + extract_project_overwrite(file, &extract_dest_path, submission.compression)?; + } else { + plugin.extract_student_files(file, submission.compression, &extract_dest_path)?; + } // extract ide files log::debug!("extracting ide files"); @@ -107,8 +118,8 @@ pub fn prepare_submission( ]; extract_with_filter( &plugin, - submission_archive, - submission_compression, + submission.archive, + submission.compression, |path| { path.components().all(|c| { c.as_os_str() @@ -118,6 +129,7 @@ pub fn prepare_submission( }) }, &extract_dest_path, + submission.extract_naively, )?; // write tmc params @@ -229,16 +241,21 @@ fn extract_with_filter bool>( compression: Compression, exclude_filter: F, dest: &Path, + naive: bool, ) -> Result<(), LangsError> { let file = file_util::open_file(archive)?; let mut zip = Archive::new(file, compression)?; - let project_dir_in_stub = plugin.find_project_dir_in_archive(&mut zip)?; + let project_dir_in_archive = if naive { + PathBuf::new() + } else { + plugin.find_project_dir_in_archive(&mut zip)? + }; let mut iter = zip.iter()?; loop { let next = iter.with_next::<(), _>(|mut file| { if file.is_file() { - if let Ok(path) = file.path()?.strip_prefix(&project_dir_in_stub) { + if let Ok(path) = file.path()?.strip_prefix(&project_dir_in_archive) { if exclude_filter(path) { // path component on ignore list return Ok(Continue(())); @@ -294,7 +311,11 @@ mod test { .insert_array("param_two", vec!["value_two", "value_three"]) .unwrap(); prepare_submission( - (Path::new(zip), Compression::Zip), + PrepareSubmission { + archive: Path::new(zip), + compression: Compression::Zip, + extract_naively: false, + }, &output_archive, None, tmc_params, @@ -391,7 +412,11 @@ mod test { assert!(!output.exists()); prepare_submission( - (Path::new(MAVEN_ZIP), Compression::Zip), + PrepareSubmission { + archive: Path::new(MAVEN_ZIP), + compression: Compression::Zip, + extract_naively: false, + }, &output, Some("toplevel".to_string()), TmcParams::new(), @@ -426,7 +451,11 @@ mod test { assert!(!output.exists()); prepare_submission( - (Path::new(MAVEN_ZIP), Compression::Zip), + PrepareSubmission { + archive: Path::new(MAVEN_ZIP), + compression: Compression::Zip, + extract_naively: false, + }, &output, None, TmcParams::new(), @@ -460,7 +489,11 @@ mod test { assert!(!output.exists()); prepare_submission( - (Path::new(MAVEN_ZIP), Compression::Zip), + PrepareSubmission { + archive: Path::new(MAVEN_ZIP), + compression: Compression::Zip, + extract_naively: false, + }, &output, None, TmcParams::new(), @@ -487,7 +520,11 @@ mod test { assert!(!output.exists()); prepare_submission( - (Path::new(MAVEN_ZIP), Compression::Zip), + PrepareSubmission { + archive: Path::new(MAVEN_ZIP), + compression: Compression::Zip, + extract_naively: false, + }, &output, Some("toplevel".to_string()), TmcParams::new(), @@ -517,7 +554,11 @@ mod test { assert!(!output_arch.exists()); prepare_submission( - (Path::new(MAVEN_ZIP), Compression::Zip), + PrepareSubmission { + archive: Path::new(MAVEN_ZIP), + compression: Compression::Zip, + extract_naively: false, + }, &output_arch, None, TmcParams::new(), diff --git a/docker-build.sh b/docker-build.sh new file mode 100644 index 00000000000..df127efcae6 --- /dev/null +++ b/docker-build.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +export DOCKER_BUILDKIT=1 +docker build . -f docker/Dockerfile -t tmc-langs-rust +docker run --rm -v "$PWD":/build/out tmc-langs-rust bash -c "cargo build && cp /build/target/debug/tmc-langs-cli /build/out/" diff --git a/docker/Dockerfile b/docker/Dockerfile index 299d5766783..00fbcb1ac34 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,12 +1,10 @@ -FROM rust:slim-buster - +FROM rust:slim-buster AS base # C# https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian RUN apt update \ && apt install -y wget \ && wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ && dpkg -i packages-microsoft-prod.deb \ && rm packages-microsoft-prod.deb - # install deps RUN apt update \ && apt install -y \ @@ -21,8 +19,17 @@ RUN apt update \ r-base r-cran-devtools \ # https://github.com/testmycode/tmc-r-tester/ && R -e 'devtools::install_github("testmycode/tmc-r-tester/tmcRtestrunner", build = FALSE)' - -COPY . /build +RUN cargo install cargo-chef --locked WORKDIR /build -RUN cargo check --tests --all-features +FROM base AS chef +COPY . . +RUN cargo chef prepare --recipe-path recipe.json + +FROM base AS builder +COPY --from=chef /build/recipe.json recipe.json +# Build dependencies - this is the caching Docker layer! +RUN cargo chef cook --recipe-path recipe.json +# Build application +COPY . . +RUN cargo build