File tree Expand file tree Collapse file tree 1 file changed +37
-1
lines changed
Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -7,4 +7,40 @@ if [[ -z "${OPERATOR_ID:-}" || -z "${OPERATOR_KEY:-}" ]]; then
77 exit 2
88fi
99
10- ./gradlew -q run --stacktrace | tee java-output.txt
10+ OUTFILE=" java-output.txt"
11+ : > " $OUTFILE " # truncate/create
12+
13+ echo " === Java Examples Runner ===" | tee -a " $OUTFILE "
14+ echo " Timestamp (UTC): $( date -u +' %Y-%m-%d %H:%M:%SZ' ) " | tee -a " $OUTFILE "
15+ echo " Network: ${HEDERA_NETWORK:- <unset>} " | tee -a " $OUTFILE "
16+ echo " Mirror: ${MIRROR_NODE_URL:- <unset>} " | tee -a " $OUTFILE "
17+ echo " " | tee -a " $OUTFILE "
18+
19+ # If you pass an example FQN as an argument, run just that one:
20+ # ./.github/scripts/run-java.sh examples.CreateAccountDemo
21+ if [[ $# -gt 0 ]]; then
22+ FQN=" $1 "
23+ echo " ▶️ Running single example: $FQN " | tee -a " $OUTFILE "
24+ set +e
25+ ./gradlew -q runExample -PexampleClass=" $FQN " --stacktrace --console=plain | tee -a " $OUTFILE "
26+ STATUS=${PIPESTATUS[0]}
27+ set -e
28+ exit $STATUS
29+ fi
30+
31+ # Otherwise run ALL discovered examples
32+ echo " ▶️ Running all examples…" | tee -a " $OUTFILE "
33+ set +e
34+ ./gradlew -q runAllExamples --stacktrace --console=plain | tee -a " $OUTFILE "
35+ STATUS=${PIPESTATUS[0]}
36+ set -e
37+
38+ if [[ $STATUS -ne 0 ]]; then
39+ echo " " | tee -a " $OUTFILE "
40+ echo " ❌ One or more examples failed." | tee -a " $OUTFILE "
41+ else
42+ echo " " | tee -a " $OUTFILE "
43+ echo " ✅ All examples passed." | tee -a " $OUTFILE "
44+ fi
45+
46+ exit $STATUS
You can’t perform that action at this time.
0 commit comments