graphql-java: Fix dependency jars discovery (#10790)

Fix dependency inclusion for the graphql-java project fuzzer.

Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
This commit is contained in:
Arthur Chan 2023-08-03 22:21:08 +01:00 committed by GitHub
parent df8c7cf6f3
commit 1bbf13c1e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 3 deletions

View File

@ -22,15 +22,28 @@ cp -r jdk-11.0.0.1 $OUT/
JAVA_HOME=$OUT/jdk-11.0.0.1
PATH=$JAVA_HOME/bin:$PATH
# Add task for copy dependency jars
echo "
task copyToLib(type: Copy) {
into \"\${buildDir}/dependencies\"
from configurations.runtimeClasspath
}" >> ./build.gradle
# Gradle build with gradle wrapper
rm -rf $HOME/.gradle/caches/
./gradlew clean build shadowJar -x test
./gradlew clean build shadowJar copyToLib -x test -x javadoc -x sources
./gradlew --stop
cp "./build/libs/$(basename ./build/tmp/jar/*.jar)" $OUT/graphql-java.jar
cp $(find ~/.gradle/caches/modules-2/files-2.1/ -name "slf4j-api-2.0.7.jar") $OUT/slf4j-api.jar
ALL_JARS="graphql-java.jar slf4j-api.jar"
ALL_JARS="graphql-java.jar"
# Copy dependency jars
for JARFILE in $(ls ./build/dependencies/*.jar)
do
cp $JARFILE $OUT/
ALL_JARS=$ALL_JARS" $(basename $JARFILE)"
done
# The classpath at build-time includes the project jars in $OUT as well as the
# Jazzer API.