pkg(scala-3.0.0): use compile (#257)

This commit is contained in:
Dan Vargas 2021-05-14 23:24:37 -05:00 committed by GitHub
parent 00bd298665
commit c7764161a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 18 deletions

15
packages/scala/3.0.0/compile vendored Normal file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Compile scala classes into a jar file
scalac "$@" -d out.jar
# Create the Manifest and include scala lib jars:
# NOTE: - entry point will only consider @main and App traits from the main file
# - scala lib jars will be added to the class path in order to run the jar properly
echo "Main-Class: $(grep -oP '\@main\s+def\s+\K[a-zA-Z][a-zA-Z0-9]*|object\s+\K[a-zA-Z][a-zA-Z0-9]*(?=\s+extends\s+App)' $1)
Class-Path: $(echo $JAVA_HOME/lib/*.jar | sed 's/\s/\n /g')
" > manifest.txt
# Update the jar with the manifest
jar ufm out.jar manifest.txt