feat: runner: framework: add golang support

This commit is contained in:
Paul Pan 2024-01-01 22:20:38 +08:00
parent b595ec95ba
commit 8bf0c0d0a7
Signed by: Paul
GPG Key ID: D639BDF5BA578AF4
3 changed files with 11 additions and 1 deletions

View 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

View File

@ -0,0 +1,2 @@
GO=/usr/local/go/bin/go
GO_BUILD_FLAGS=-trimpath

View File

@ -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