-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1995 from lf-lang/no-util
More robust dev scripts and removed util directory
- Loading branch information
Showing
12 changed files
with
231 additions
and
139 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
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
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
This file was deleted.
Oops, something went wrong.
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,59 @@ | ||
#!/bin/bash | ||
|
||
#============================================================================ | ||
# Description: Build and run the Lingua Franca compiler (lfc). | ||
# Authors: Marten Lohstroh | ||
# Christian Menard | ||
# Usage: Usage: lfc-dev [options] files... | ||
#============================================================================ | ||
|
||
#============================================================================ | ||
# Preamble | ||
#============================================================================ | ||
|
||
# Find the directory in which this script resides in a way that is compatible | ||
# with MacOS, which has a `readlink` implementation that does not support the | ||
# necessary `-f` flag to canonicalize by following every symlink in every | ||
# component of the given name recursively. | ||
# This solution, adapted from an example written by Geoff Nixon, is POSIX- | ||
# compliant and robust to symbolic links. If a chain of more than 1000 links | ||
# is encountered, we return. | ||
set -euo pipefail | ||
|
||
find_base_dir() ( | ||
start_dir=$PWD | ||
cd "$(dirname "$1")" | ||
link=$(readlink "$(basename "$1")") | ||
count=0 | ||
while [ "${link}" ]; do | ||
if [[ "${count}" -lt 1000 ]]; then | ||
cd "$(dirname "${link}")" | ||
link=$(readlink "$(basename "${link}")") | ||
((count++)) | ||
else | ||
return | ||
fi | ||
done | ||
real_path="${PWD}" | ||
cd "${start_dir}" | ||
echo "$(dirname "${real_path}")" | ||
) | ||
|
||
# Report fatal error and exit. | ||
function fatal_error() { | ||
1>&2 echo -e "\e[31mfatal error: \e[0m$1" | ||
exit 1 | ||
} | ||
|
||
base="$(find_base_dir "$0")" | ||
|
||
if [[ -z "${base}" ]]; then | ||
fatal_error "Unable to determine base path of $0." | ||
fi | ||
#============================================================================ | ||
|
||
gradlew="${base}/gradlew" | ||
|
||
# Launch the tool. | ||
"${gradlew}" --quiet -p "${base}" assemble ":cli:lfc:assemble" | ||
"${base}/build/install/lf-cli/bin/lfc" "$@" |
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
#========================================================== | ||
# Description: Run the lfc compiler. | ||
#============================================================================ | ||
# Description: Build and run the Lingua Franca compiler (lfc). | ||
# Authors: Ruomu Xu | ||
# Usage: Usage: lfc [options] files... | ||
#========================================================== | ||
# Christian Menard | ||
# Usage: Usage: lfc-dev [options] files... | ||
#============================================================================ | ||
|
||
$launchScript="$PSScriptRoot\..\util\scripts\launch.ps1" | ||
# PS requires spattling: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Splatting?view=powershell-7.2 | ||
. $launchScript @args | ||
|
||
# This script is in $base\bin | ||
$base="$PSScriptRoot\..\" | ||
$gradlew="${base}/gradlew.bat" | ||
|
||
# invoke script | ||
& "${gradlew}" --quiet -p "${base}" assemble ":cli:lfc:assemble" | ||
& "${base}/build/install/lf-cli/bin/lfc" @args |
This file was deleted.
Oops, something went wrong.
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,59 @@ | ||
#!/bin/bash | ||
|
||
#============================================================================ | ||
# Description: Build and run the Lingua Franca diagram generator (lfd). | ||
# Authors: Marten Lohstroh | ||
# Christian Menard | ||
# Usage: Usage: lfd-dev [options] files... | ||
#============================================================================ | ||
|
||
#============================================================================ | ||
# Preamble | ||
#============================================================================ | ||
|
||
# Find the directory in which this script resides in a way that is compatible | ||
# with MacOS, which has a `readlink` implementation that does not support the | ||
# necessary `-f` flag to canonicalize by following every symlink in every | ||
# component of the given name recursively. | ||
# This solution, adapted from an example written by Geoff Nixon, is POSIX- | ||
# compliant and robust to symbolic links. If a chain of more than 1000 links | ||
# is encountered, we return. | ||
set -euo pipefail | ||
|
||
find_base_dir() ( | ||
start_dir=$PWD | ||
cd "$(dirname "$1")" | ||
link=$(readlink "$(basename "$1")") | ||
count=0 | ||
while [ "${link}" ]; do | ||
if [[ "${count}" -lt 1000 ]]; then | ||
cd "$(dirname "${link}")" | ||
link=$(readlink "$(basename "${link}")") | ||
((count++)) | ||
else | ||
return | ||
fi | ||
done | ||
real_path="${PWD}" | ||
cd "${start_dir}" | ||
echo "$(dirname "${real_path}")" | ||
) | ||
|
||
# Report fatal error and exit. | ||
function fatal_error() { | ||
1>&2 echo -e "\e[31mfatal error: \e[0m$1" | ||
exit 1 | ||
} | ||
|
||
base="$(find_base_dir "$0")" | ||
|
||
if [[ -z "${base}" ]]; then | ||
fatal_error "Unable to determine base path of $0." | ||
fi | ||
#============================================================================ | ||
|
||
gradlew="${base}/gradlew" | ||
|
||
# Launch the tool. | ||
"${gradlew}" --quiet -p "${base}" assemble ":cli:lfd:assemble" | ||
"${base}/build/install/lf-cli/bin/lfd" "$@" |
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
#========================================================== | ||
# Description: Run the lff compiler. | ||
#============================================================================ | ||
# Description: Build and run the Lingua Franca diagram generator (lfd). | ||
# Authors: Ruomu Xu | ||
# Usage: Usage: lff [options] files... | ||
#========================================================== | ||
# Christian Menard | ||
# Usage: Usage: lfd-dev [options] files... | ||
#============================================================================ | ||
|
||
$launchScript="$PSScriptRoot\..\util\scripts\launch.ps1" | ||
# PS requires spattling: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Splatting?view=powershell-7.2 | ||
. $launchScript @args | ||
|
||
# This script is in $base\bin | ||
$base="$PSScriptRoot\..\" | ||
$gradlew="${base}/gradlew.bat" | ||
|
||
# invoke script | ||
& "${gradlew}" --quiet -p "${base}" assemble ":cli:lfd:assemble" | ||
& "${base}/build/install/lf-cli/bin/lfd" @args |
This file was deleted.
Oops, something went wrong.
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,59 @@ | ||
#!/bin/bash | ||
|
||
#============================================================================ | ||
# Description: Build and run the Lingua Franca code formatter (lff). | ||
# Authors: Marten Lohstroh | ||
# Christian Menard | ||
# Usage: Usage: lff-dev [options] files... | ||
#============================================================================ | ||
|
||
#============================================================================ | ||
# Preamble | ||
#============================================================================ | ||
|
||
# Find the directory in which this script resides in a way that is compatible | ||
# with MacOS, which has a `readlink` implementation that does not support the | ||
# necessary `-f` flag to canonicalize by following every symlink in every | ||
# component of the given name recursively. | ||
# This solution, adapted from an example written by Geoff Nixon, is POSIX- | ||
# compliant and robust to symbolic links. If a chain of more than 1000 links | ||
# is encountered, we return. | ||
set -euo pipefail | ||
|
||
find_base_dir() ( | ||
start_dir=$PWD | ||
cd "$(dirname "$1")" | ||
link=$(readlink "$(basename "$1")") | ||
count=0 | ||
while [ "${link}" ]; do | ||
if [[ "${count}" -lt 1000 ]]; then | ||
cd "$(dirname "${link}")" | ||
link=$(readlink "$(basename "${link}")") | ||
((count++)) | ||
else | ||
return | ||
fi | ||
done | ||
real_path="${PWD}" | ||
cd "${start_dir}" | ||
echo "$(dirname "${real_path}")" | ||
) | ||
|
||
# Report fatal error and exit. | ||
function fatal_error() { | ||
1>&2 echo -e "\e[31mfatal error: \e[0m$1" | ||
exit 1 | ||
} | ||
|
||
base="$(find_base_dir "$0")" | ||
|
||
if [[ -z "${base}" ]]; then | ||
fatal_error "Unable to determine base path of $0." | ||
fi | ||
#============================================================================ | ||
|
||
gradlew="${base}/gradlew" | ||
|
||
# Launch the tool. | ||
"${gradlew}" --quiet -p "${base}" assemble ":cli:lff:assemble" | ||
"${base}/build/install/lf-cli/bin/lff" "$@" |
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
#========================================================== | ||
# Description: Run the lff compiler. | ||
#============================================================================ | ||
# Description: Build and run the Lingua Franca code formatter (lff). | ||
# Authors: Ruomu Xu | ||
# Usage: Usage: lff [options] files... | ||
#========================================================== | ||
# Christian Menard | ||
# Usage: Usage: lff-dev [options] files... | ||
#============================================================================ | ||
|
||
$launchScript="$PSScriptRoot\..\util\scripts\launch.ps1" | ||
# PS requires spattling: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Splatting?view=powershell-7.2 | ||
. $launchScript @args | ||
|
||
# This script is in $base\bin | ||
$base="$PSScriptRoot\..\" | ||
$gradlew="${base}/gradlew.bat" | ||
|
||
# invoke script | ||
& "${gradlew}" --quiet -p "${base}" assemble ":cli:lff:assemble" | ||
& "${base}/build/install/lf-cli/bin/lff" @args |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.