Skip to content

Commit

Permalink
add stacktrace to gensrc script.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe7s committed Aug 16, 2024
1 parent aa874c7 commit 049e4d8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 38 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ jobs:
- name: Generate Source
run: ./genSrc.sh --tjv="${{ vars.JAVA_VERSION }}" --log="INFO" --tl=2 --bdm=200 --nt=5 --sd="programs/src/main/java" --rpc="${{ secrets.RPC_URL }}"
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_ACTOR: ${{ secrets.GPR_USER }}
GITHUB_TOKEN: ${{ secrets.GPR_TOKEN }}
GITHUB_SAVA_USER: ${{ secrets.GPR_USER }}
GITHUB_SAVA_TOKEN: ${{ secrets.GPR_TOKEN }}

- name: Gradle Check
run: ./gradlew -PtargetJava=${{ vars.JAVA_VERSION }} check --stacktrace --no-daemon
run: ./gradlew -PtargetJava=${{ vars.JAVA_VERSION }} check --stacktrace
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
49 changes: 15 additions & 34 deletions genSrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,52 +80,33 @@ do
fi
done

javaArgs+=("-D$moduleName.baseDelayMillis=$baseDelayMillis")
javaArgs+=("-D$moduleName.basePackageName=$basePackageName")
javaArgs+=("-D$moduleName.outputModuleName=$outputModuleName")
javaArgs+=("-D$moduleName.numThreads=$numThreads")
javaArgs+=("-D$moduleName.programsCSV=$programsCSV")
javaArgs+=("-D$moduleName.rpc=$rpc")
javaArgs+=("-D$moduleName.sourceDirectory=$sourceDirectory")
javaArgs+=("-D$moduleName.tabLength=$tabLength")

javaVersion=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | grep -oEi '^[0-9]+')
readonly javaVersion
if [[ "$javaVersion" -ne "$targetJavaVersion" ]]; then
echo "Invalid Java version $javaVersion must be $targetJavaVersion."
exit 3
fi

osName="$(uname)"
readonly osName
if [[ "$osName" == "Linux" ]]; then
memTotalKB=$(grep MemTotal /proc/meminfo | awk '{print $2}')
readonly memTotalKB
if (( memTotalKB < 2000000 )); then
javaArgs+=(
'-Xms128M'
'-Xmx384M'
)
gradleArgs+=('--no-daemon')
./gradlew --no-daemon --stop
else
javaArgs+=(
'-Xms256M'
'-Xmx1024M'
)
fi
else
gradleArgs+=('clean')
fi

./gradlew --no-daemon "-PmainClassName=$mainClass" "${gradleArgs[@]}" ":$projectName:jlink"

javaArgs+=('-m' "$moduleName/$mainClass")
./gradlew --stacktrace "-PmainClassName=$mainClass" ":$projectName:jlink"

vcsRef="$(git rev-parse --short HEAD)"
readonly vcsRef
readonly javaExe="$projectDirectory/build/$vcsRef/bin/java"

javaArgs+=("-D$moduleName.baseDelayMillis=$baseDelayMillis")
javaArgs+=("-D$moduleName.basePackageName=$basePackageName")
javaArgs+=("-D$moduleName.outputModuleName=$outputModuleName")
javaArgs+=("-D$moduleName.numThreads=$numThreads")
javaArgs+=("-D$moduleName.programsCSV=$programsCSV")
javaArgs+=("-D$moduleName.rpc=$rpc")
javaArgs+=("-D$moduleName.sourceDirectory=$sourceDirectory")
javaArgs+=("-D$moduleName.tabLength=$tabLength")
javaArgs+=(
'-Xms256M'
'-Xmx1024M'
)
javaArgs+=('-m' "$moduleName/$mainClass")

if [[ "$screen" == 0 ]]; then
set -x
"$javaExe" "${javaArgs[@]}"
Expand Down

0 comments on commit 049e4d8

Please sign in to comment.