From 14bb325f0d36859f9ce9eded79d963ba5a6e0e55 Mon Sep 17 00:00:00 2001 From: MeiK Date: Tue, 2 Feb 2021 15:52:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=AD=E8=A8=80=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.template.yaml | 11 +++++++++++ proto/river.proto | 1 + src/config.rs | 1 + src/main.rs | 1 + 4 files changed, 14 insertions(+) diff --git a/config.template.yaml b/config.template.yaml index d52fd49..783d3c3 100644 --- a/config.template.yaml +++ b/config.template.yaml @@ -5,38 +5,49 @@ languages: compile_cmd: /usr/bin/gcc main.c -o a.out -Wall -O2 -std=c99 --static code_file: main.c run_cmd: ./a.out + version: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 Cpp: compile_cmd: /usr/bin/g++ main.cpp -O2 -Wall --static -o a.out --std=gnu++17 code_file: main.cpp run_cmd: ./a.out + version: g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 Python: compile_cmd: /usr/bin/python3.8 -m compileall main.py code_file: main.py run_cmd: /usr/bin/python3.8 main.py + version: Python 3.8.5 Rust: compile_cmd: /root/.cargo/bin/rustc main.rs -o a.out -C opt-level=2 code_file: main.rs run_cmd: ./a.out + version: rustc 1.49.0 (e1884a8e3 2020-12-29) Node: compile_cmd: /usr/bin/node /plugins/node/validate.js main.js code_file: main.js run_cmd: /usr/bin/node main.js + version: v14.15.4 TypeScript: compile_cmd: /usr/bin/tsc -p /tsconfig.json code_file: main.ts run_cmd: /usr/bin/node main.js + version: v9.1.1 Go: compile_cmd: /usr/bin/go build -o a.out main.go code_file: main.go run_cmd: ./a.out + version: go version go1.15.6 linux/amd64 Java: compile_cmd: /usr/bin/javac Main.java code_file: Main.java run_cmd: /usr/bin/java -cp . Main + version: |- + openjdk 11.0.9.1 2020-11-04 + OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04) + OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing) diff --git a/proto/river.proto b/proto/river.proto index 89a92a5..6c5a3b2 100644 --- a/proto/river.proto +++ b/proto/river.proto @@ -13,6 +13,7 @@ message LanguageItem { string language = 1; string compile = 2; string run = 3; + string version = 4; } message LanguageConfigResponse { diff --git a/src/config.rs b/src/config.rs index 32118a9..eb736e9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -21,6 +21,7 @@ pub struct LanguageConf { pub compile_cmd: String, pub code_file: String, pub run_cmd: String, + pub version: String, } #[derive(Debug, PartialEq, Serialize, Deserialize)] diff --git a/src/main.rs b/src/main.rs index c6ac9a5..163a00a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -116,6 +116,7 @@ impl River for RiverService { language: String::from(key), compile: String::from(&value.compile_cmd), run: String::from(&value.run_cmd), + version: String::from(&value.version), }); } let response = LanguageConfigResponse {