Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/run_shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ base_dir="$( cd "$(dirname "$0")/../.." >/dev/null 2>&1 ; pwd -P )"
shellcheck --enable=all --severity=warning --check-sourced --color=auto \
"$base_dir/.github/workflows/run_shellcheck.sh" \
"$base_dir/.github/workflows/github_release.sh" \
"$base_dir/product/oftw.sh" \
"$base_dir/oft" \
"$base_dir/oft-self-trace.sh"

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ doc/**/*.html
*.iml
pom.xml.versionsBackup
.DS_Store
/.serena/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ If you just want to run OFT:

## Running OpenFastTrace

### Run JAR File

The most basic variant to run OpenFastTrace is directly from the JAR file via the command line:

```sh
Expand All @@ -107,6 +109,10 @@ If you want to run OFT automatically as part of a continuous build, we recommend

For more details about how to run OFT please consult the [user guide](doc/user_guide.md).

### Download and Execute in Continuous Integration

If you want to run OFT in a CI build, you can use the OFT wrapper script [oftw.sh](product/oftw.sh). The script only requires Java 17 and Maven and downloads the OFT JAR from Maven Central if it is not yet available in the local Maven repository `$HOME/.m2/repository`.

## Development

If you want to learn how to build OpenFastTrace, please check our [Developer Guide](doc/developer_guide.md).
Expand Down
25 changes: 25 additions & 0 deletions product/oftw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

set -o errexit
set -o nounset

readonly version="4.4.0"
readonly default_local_repo="${HOME}/.m2/repository"

if [ -d "$default_local_repo" ]; then
local_repo="$default_local_repo"
else
echo "Default local Maven repository not found at $default_local_repo. Attempting to determine it from Maven settings..."
local_repo=$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout)
fi
readonly local_repo
readonly jar_file="$local_repo/org/itsallcode/openfasttrace/openfasttrace/$version/openfasttrace-$version.jar"

if [ ! -f "$jar_file" ]; then
echo "JAR file $jar_file not found in local Maven repository. Downloading it..."
mvn --batch-mode org.apache.maven.plugins:maven-dependency-plugin:3.10.0:get \
-Dartifact=org.itsallcode.openfasttrace:openfasttrace:"$version" \
-Dtransitive=false
fi

exec java -jar "$jar_file" "$@"
Loading