forked from DOMjudge/domjudge
-
Notifications
You must be signed in to change notification settings - Fork 0
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
2 changed files
with
39 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
# nothing to compile |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
|
||
# Scala compile wrapper-script for 'compile.sh'. | ||
# See that script for syntax and more info. | ||
# | ||
# This script requires that scala is installed in the chroot. | ||
|
||
DEST="$1" ; shift | ||
MEMLIMIT="$1" ; shift | ||
MAINSOURCE="$1" | ||
|
||
scalac "$@" | ||
EXITCODE=$? | ||
[ "$EXITCODE" -ne 0 ] && exit $EXITCODE | ||
|
||
MAINCLASS="${ENTRY_POINT:-$(basename "$MAINSOURCE" .scala)}" | ||
|
||
# Report the entry point, so it can be saved, e.g. for later replay: | ||
if [ -z "$ENTRY_POINT" ]; then | ||
echo "Info: detected entry_point: $MAINCLASS" | ||
fi | ||
|
||
cat > "$DEST" <<EOF | ||
#!/bin/sh | ||
# Generated shell-script to execute scala interpreter on source. | ||
# Detect dirname and change dir to prevent class not found errors. | ||
if [ "\${0%/*}" != "\$0" ]; then | ||
cd "\${0%/*}" | ||
fi | ||
exec scala '$MAINCLASS' "\$@" | ||
EOF | ||
|
||
chmod a+x "$DEST" | ||
|
||
exit 0 |