Updated to Scala 3.2.2

This commit is contained in:
RVG|lory 2023-04-08 18:21:15 +02:00 committed by GitHub
parent 86d897d580
commit 334e7820ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 0 deletions

14
packages/scala/3.2.2/compile vendored Normal file
View file

@ -0,0 +1,14 @@
#!/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