add piston nix pkg for groovy

This commit is contained in:
Dan Vargas 2022-02-11 15:22:57 -07:00
parent 2bc7155895
commit 226eca1fb9
8 changed files with 56 additions and 52 deletions

View file

@ -1,14 +0,0 @@
#!/bin/bash
# Groovy depends on JDK8+
mkdir -p java
cd java
curl "https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz" -o java.tar.gz
tar xzf java.tar.gz --strip-components=1
rm java.tar.gz
cd ..
# Download Groovy binaries
curl -L "https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-3.0.7.zip" -o groovy.zip
unzip -q groovy.zip
rm groovy.zip

View file

@ -1,17 +0,0 @@
#!/bin/bash
# Compile groovy scripts into a separate "classes" directory
# NOTE: - Main file MUST be a groovy script
# - not supporting object class entry points as of now
groovyc -d classes "$@"
# Create the Manifest and include groovy jars:
# NOTE: - main class will be the first file ('.' becomes '_' and without the extension)
# - groovy lib jars MUST be in the class path in order to work properly
echo "Main-Class: $(sed 's/\./\_/g'<<<${1%.*})
Class-Path: $(echo $GROOVY_HOME/lib/*.jar | sed 's/\s/\n /g')
" > manifest.txt
# Create the jar from the manifest and classes
jar cfm out.jar manifest.txt -C classes .

View file

@ -1,10 +0,0 @@
#!/bin/bash
# Groovy requires JAVA_HOME to be set
export JAVA_HOME=$PWD/java
# GROOVY_HOME needed to get the groovy libs
export GROOVY_HOME=$PWD/groovy-3.0.7
# Add java and groovy binaries to the path
export PATH=$PWD/java/bin:$PWD/groovy-3.0.7/bin:$PATH

View file

@ -1,5 +0,0 @@
{
"language": "groovy",
"version": "3.0.7",
"aliases": ["groovy", "gvy"]
}

View file

@ -1,5 +0,0 @@
#!/bin/bash
# Run the jar created during compile
shift
java -jar out.jar "$@"

View file

@ -1 +0,0 @@
println 'OK'