Add provides key to some languages

Provides key allows 1 package to provide multiple languages

Expect an API update to work with these new packages
This commit is contained in:
Thomas Hobson 2021-04-25 13:11:33 +12:00
parent 3b25ec4386
commit ccc1e4c08b
No known key found for this signature in database
GPG Key ID: 9F1FD9D87950DB6F
5 changed files with 37 additions and 10 deletions

View File

@ -3,21 +3,21 @@
# Put instructions to compile source code, remove this file if the language does not require this stage
case "${PISTON_ALIAS}" in
gcc | c)
case "${PISTON_LANGUAGE}" in
c)
rename 's/$/\.c/' "$@" # Add .c extension
gcc -std=c11 *.c -lm
;;
g++ | c++ | cpp)
c++)
rename 's/$/\.cpp/' "$@" # Add .cpp extension
g++ -std=c++17 *.cpp
;;
gdc | d)
d)
rename 's/$/\.d/' "$@" # Add .d extension
gdc *.d
;;
*)
echo "How did you get here? (${PISTON_ALIAS})"
echo "How did you get here? (${PISTON_LANGUAGE})"
exit 1
;;
esac

View File

@ -1,5 +1,18 @@
{
"language": "gcc",
"version": "10.2.0",
"aliases": ["c", "g++", "c++", "cpp", "gdc", "d"]
"provides": [
{
"language":"c",
"aliases": ["gcc"]
},
{
"language": "c++",
"aliases": ["cpp", "g++"]
},
{
"language": "d",
"aliases": ["gdc"]
}
]
}

View File

@ -3,7 +3,7 @@
# Put instructions to compile source code, remove this file if the language does not require this stage
case "${PISTON_ALIAS}" in
case "${PISTON_LANGUAGE}" in
nasm)
nasm -f elf32 -o binary.o "$@"
ld -m elf_i386 binary.o -o binary
@ -13,7 +13,7 @@ case "${PISTON_ALIAS}" in
ld -m elf_x86_64 binary.o -o binary
;;
*)
echo "How did you get here? (${PISTON_ALIAS})"
echo "How did you get here? (${PISTON_LANGUAGE})"
exit 1
;;
esac

View File

@ -1,5 +1,14 @@
{
"language": "nasm",
"version": "2.15.5",
"aliases": ["nasm64"]
"provides": [
{
"language": "nasm",
"aliases": ["asm", "nasm32"]
},
{
"language": "nasm64",
"aliases": ["asm64"]
}
]
}

View File

@ -1,5 +1,10 @@
{
"language": "node",
"version": "15.10.0",
"aliases": ["node-javascript", "node-js", "javascript", "js"]
"provides": [
{
"language": "javascript",
"aliases": ["node-javascript", "node-js", "javascript", "js"]
}
]
}