-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
92 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
#! /bin/bash | ||
# Copyright (c) 2019-2023 Alexander Chernov <[email protected]> | ||
# Copyright (c) 2019-2024 Alexander Chernov <[email protected]> | ||
|
||
# A script for compilation of C# programs using the dotnet compiler. | ||
# Usage: dotnet-cs in-file out-file | ||
|
||
# using EJUDGE_FLAGS we may pass additional flags | ||
|
||
prefix="@prefix@" | ||
|
||
LANG_CONFIG_DIR="@lang_config_dir@" | ||
|
@@ -41,6 +39,28 @@ unset LANGUAGE | |
export DOTNET_NOLOGO=true | ||
export DOTNET_CLI_TELEMETRY_OPTOUT=true | ||
|
||
if [ "$EJUDGE_HAS_PROJECT" = 1 ] | ||
then | ||
if [ x"${EJUDGE_SOLUTION_FILE}" = x ] | ||
then | ||
echo "EJUDGE_SOLUTION_FILE must be specified" >&2 | ||
exit 1 | ||
fi | ||
mv "$1" "${EJUDGE_SOLUTION_FILE}.cs" | ||
|
||
if ! "${DOTNETRUN}" build -c Release | ||
then | ||
echo "Compilation failed." >&2 | ||
exit 1 | ||
fi | ||
if ! mv bin/Release/${DOTNETTARGET}/solution.dll "$2" | ||
then | ||
echo "Compilation output is missing" >&2 | ||
exit 1 | ||
fi | ||
exit 0 | ||
fi | ||
|
||
TEMPLATE_DIR="${prefix}/share/ejudge/template" | ||
TEMPLATE_FILE="${TEMPLATE_DIR}/dotnet-cs.tbz" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/sh | ||
# Copyright (c) 2001-2023 Alexander Chernov <[email protected]> | ||
#! /bin/bash | ||
# Copyright (c) 2001-2024 Alexander Chernov <[email protected]> | ||
|
||
# using EJUDGE_FLAGS we may pass additional flags | ||
|
||
|
@@ -34,4 +34,17 @@ unset LC_ALL | |
unset LC_MESSAGES | ||
unset LANGUAGE | ||
|
||
if [ "${EJUDGE_COMPILE_MASK}" != "" ] | ||
then | ||
if [ "${EJUDGE_SOLUTION_FILE}" != "" ] | ||
then | ||
if ! mv "$1" "${EJUDGE_SOLUTION_FILE}.cpp" | ||
then | ||
echo "failed to rename $1 to $EJUDGE_SOLUTION_FILE" >&2 | ||
exit 1 | ||
fi | ||
exec "${GPPRUN}" ${EJUDGE_FLAGS} ${EJUDGE_COMPILE_MASK} -o "$2" -lm ${EJUDGE_LIBS} | ||
fi | ||
fi | ||
|
||
exec "${GPPRUN}" ${EJUDGE_FLAGS} "$1" -o "$2" -lm ${EJUDGE_LIBS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
#!/bin/sh | ||
# Copyright (c) 2017 Alexander Chernov <[email protected]> | ||
#! /bin/bash | ||
# Copyright (c) 2017-2024 Alexander Chernov <[email protected]> | ||
|
||
# This is a `compilation' script for the JavaScript (NodeJS) language. | ||
# The idea is to append "#!${NODEPATH}" string | ||
# to the beginning of the file. | ||
# Usage: node <input> <output> | ||
# Usage: node <input> <output> [<property-file>] | ||
|
||
# using EJUDGE_FLAGS we may pass additional flags | ||
|
||
LANG_CONFIG_DIR="@lang_config_dir@" | ||
LANG_CONFIG_DIR="/home/judges/compile/conf/lang.d" | ||
[ "${EJUDGE_LANG_CONFIG}" = "" ] && EJUDGE_LANG_CONFIG="${LANG_CONFIG_DIR}/node.cfg" | ||
|
||
if [ -f "${EJUDGE_LANG_CONFIG}" ] | ||
|
@@ -25,7 +20,44 @@ then | |
exit 1 | ||
fi | ||
|
||
echo "#! ${NODEPATH} ${EJUDGE_FLAGS}" > $2 | ||
if [ x"${EJUDGE_EXE_PROPERTIES}" = x1 ] | ||
then | ||
extra_args="" | ||
if [ "${EJUDGE_RUN_FLAGS}" != "" ] | ||
then | ||
for x in ${EJUDGE_RUN_FLAGS} | ||
do | ||
extra_args="$extra_args",'"'$x'"' | ||
done | ||
fi | ||
if [ x"${EJUDGE_ARCHIVE}" = x1 ] | ||
then | ||
if [ x"${EJUDGE_SOLUTION_FILE}" = x ] | ||
then | ||
echo "EJUDGE_SOLUTION_FILE must be specified" >&2 | ||
exit 1 | ||
fi | ||
if [ x"${EJUDGE_START_FILE}" = x ] | ||
then | ||
echo "EJUDGE_START_FILE must be specified" >&2 | ||
exit 1 | ||
fi | ||
mv "$1" "${EJUDGE_SOLUTION_FILE}.js" | ||
tar cfz "$2" . | ||
echo '{ "is_archive": true, "start_cmd": "'${NODEPATH}'", "start_args": ["'${NODEPATH}'"'${extra_args}',"'${EJUDGE_START_FILE}'.js"] }' > "$3" | ||
ls -l . | ||
cat $3 | ||
exit 0 | ||
fi | ||
|
||
prop_file="$3" | ||
echo '{ "start_cmd": "'${NODEPATH}'", "start_args": ["'${NODEPATH}'"'${extra_args}']}' > "$prop_file" | ||
cp -p "$1" "$2" | ||
chmod +x "$2" | ||
exit 0 | ||
fi | ||
|
||
echo "#! ${NODEPATH}" > $2 | ||
echo >> $2 | ||
cat $1 >> $2 | ||
chmod +x $2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#! /bin/bash | ||
# Copyright (c) 2017-2023 Alexander Chernov <[email protected]> | ||
# Copyright (c) 2017-2024 Alexander Chernov <[email protected]> | ||
|
||
# using EJUDGE_FLAGS we may pass additional flags | ||
|
||
|
@@ -66,4 +66,15 @@ unset LC_ALL | |
unset LC_MESSAGES | ||
unset LANGUAGE | ||
|
||
if [ "${EJUDGE_START_FILE}" != "" ] | ||
then | ||
if [ x"${EJUDGE_SOLUTION_FILE}" = x ] | ||
then | ||
echo "EJUDGE_SOLUTION_FILE must be specified" >&2 | ||
exit 1 | ||
fi | ||
mv "$1" "${EJUDGE_SOLUTION_FILE}.rs" | ||
exec "${RUSTRUN}" ${EJUDGE_FLAGS} "${EJUDGE_START_FILE}.rs" ${EJUDGE_LIBS} -o "$2" | ||
fi | ||
|
||
exec "${RUSTRUN}" ${EJUDGE_FLAGS} "$1" ${EJUDGE_LIBS} -o "$2" |