feat: runner: framework: add golang support
This commit is contained in:
parent
b595ec95ba
commit
8bf0c0d0a7
7
resource/runner/framework/template/default/go.Makefile
Normal file
7
resource/runner/framework/template/default/go.Makefile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
include ${TEMPLATE}/go.mk ${TEMPLATE}/Judger.mk
|
||||||
|
|
||||||
|
compile:
|
||||||
|
@$(GO) build $(GO_BUILD_FLAGS) -o $(PREFIX)/user/$(USER_PROG).out $(PREFIX)/user/$(USER_PROG).$(LANG)
|
||||||
|
|
||||||
|
judge:
|
||||||
|
$($(CMP)) $(PREFIX)/data/input/$(TEST_NUM).input $(PREFIX)/user/$(TEST_NUM).out.usr $(PREFIX)/data/output/$(TEST_NUM).output $(PREFIX)/user/$(TEST_NUM).judge -appes
|
2
resource/runner/framework/template/go.mk
Normal file
2
resource/runner/framework/template/go.mk
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
GO=/usr/local/go/bin/go
|
||||||
|
GO_BUILD_FLAGS=-trimpath
|
@ -2,7 +2,8 @@ FROM docker.io/library/ubuntu:22.04
|
|||||||
WORKDIR /woj/
|
WORKDIR /woj/
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN apt-get update && apt-get upgrade -y && apt-get install -y gcc g++ clang make cmake autoconf m4 libtool gperf git parallel python3 && apt-get clean && rm -rf /var/lib/apt/lists
|
RUN apt-get update && apt-get upgrade -y && apt-get install -y gcc g++ clang make cmake autoconf m4 libtool gperf git parallel python3 wget && apt-get clean && rm -rf /var/lib/apt/lists
|
||||||
|
RUN wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz && rm go1.21.5.linux-amd64.tar.gz
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
RUN mkdir -p /woj/framework && mkdir -p /woj/problem
|
RUN mkdir -p /woj/framework && mkdir -p /woj/problem
|
||||||
|
Loading…
Reference in New Issue
Block a user