testing on sigplace

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
sigonasr2, Sig, Sigo 2022-08-02 13:23:37 +00:00
parent 769849b11f
commit 8ce19b6377
12 changed files with 76 additions and 19 deletions

17
Java/scripts/build.sh Executable file
View File

@ -0,0 +1,17 @@
#Builds and runs the project.
#Java
source ${LANGUAGE}/scripts/version_info
javac -source ${SOURCE_VERSION} -target ${TARGET_VERSION} -Xlint:unchecked -cp ${CLASS_PATH} -d ${OUT_DIR} ${PROJECT_DIR}/*.java
printf "\n\n\nRunning Program...\n\n"
ORIGINAL_LOC=$(pwd)
cd $OUT_DIR
if java ${CUSTOM_PARAMS} -cp .:../lib/bin/ -XX:+UseZGC -Djava.library.path="${LIBRARY_PATH}" ${MAIN_CLASS} "$@"; then
${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh
exit
fi
if java ${CUSTOM_PARAMS} -cp .:../lib/bin/ -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Djava.library.path="${LIBRARY_PATH}" ${MAIN_CLASS} "$@"; then
${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh
exit
fi
java ${CUSTOM_PARAMS} -cp .:../lib/bin/ -XX:+PrintCommandLineFlags -Djava.library.path="${LIBRARY_PATH}" ${MAIN_CLASS} "$@"
${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh

4
Java/scripts/clean.sh Executable file
View File

@ -0,0 +1,4 @@
#Cleans up and removes unused files.
#Java
find -type f -name *.class -delete
find -type f -name manifest -delete

20
Java/scripts/commit.sh Executable file
View File

@ -0,0 +1,20 @@
#Adds a commit message and pushes project to github repository.
#Java
COMMIT_MESSAGE="$*"
FIRST_LINE=true
while IFS= read -r line
do
if [ "$FIRST_LINE" = true ]; then
COMMIT_MESSAGE+="
Co-authored-by: $line"
FIRST_LINE=false
else
COMMIT_MESSAGE+="
Co-authored-by: $line"
fi
done < utils/.coauthors
git add -u
git add *
git commit -m "$COMMIT_MESSAGE"
git push

17
Java/scripts/jar.sh Executable file
View File

@ -0,0 +1,17 @@
#Builds a runnable jar file using ${MAIN_CLASS} as an entry point and then runs the newly generated jar.
#Java
source ${LANGUAGE}/scripts/version_info
rm -Rf bin/*
javac -source ${SOURCE_VERSION} -target ${TARGET_VERSION} -Xlint:unchecked -cp ${CLASS_PATH} -d ${OUT_DIR} ${PROJECT_DIR}/${PROJECT_NAME}.java
printf "\n\n\nGenerating Manifest...\n\n"
touch manifest
echo "Main-Class: ${MAIN_CLASS}" > manifest
printf "\n\n\nCreating Jar...\n\n"
ORIGINAL_LOC=$(pwd)
cd ${OUT_DIR}
jar cfm ${PROJECT_NAME}.jar ${ORIGINAL_LOC}/manifest sig
jar uf ${PROJECT_NAME}.jar -C ../lib/bin/ .
printf "\n\n\nRunning Program...\n\n"
java ${CUSTOM_PARAMS} -cp .:../lib/bin -Djava.library.path="${LIBRARY_PATH}" -jar ${PROJECT_NAME}.jar "$@"
${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh
cd ..

1
Java/scripts/jar2.sh Normal file
View File

@ -0,0 +1 @@
404: Not Found

1
Java/scripts/lean.sh Normal file
View File

@ -0,0 +1 @@
404: Not Found

5
Java/scripts/md5 Normal file
View File

@ -0,0 +1,5 @@
build.sh:a833e7598ad65672a9c01306d244b49f -
clean.sh:96ce35f2d2dcb555421e00a6afda23ca -
commit.sh:21af1fa6f09d01679c9e11408967264a -
jar.sh:2ac636f584c43a1124affb9ea6bdc7bf -
lean.sh:3be7b8b182ccd96e48989b4e57311193 -

1
Java/scripts/release.sh Normal file
View File

@ -0,0 +1 @@
404: Not Found

3
Java/scripts/update.sh Normal file
View File

@ -0,0 +1,3 @@
#Pulls the latest version of the repository.
#
git pull

1
Java/scripts/zip.sh Normal file
View File

@ -0,0 +1 @@
404: Not Found

View File

@ -37,17 +37,18 @@ public class client {
System.out.println(((HttpResponse<String>)res.run()).body()); System.out.println(((HttpResponse<String>)res.run()).body());
*/ */
/*
//Regular POST request with body: //Regular POST request with body:
POSTRequest postRes = new POSTRequest("https://postman-echo.com/post","Test body"); POSTRequest postRes = new POSTRequest("https://8080-sigonasr2-sigplace-5j5fknii87n.ws-us54.gitpod.io/","Test a longer body\nwith much more\nlines now.\n\n");
System.out.println(((HttpResponse<String>)postRes.run()).body()); System.out.println(((HttpResponse<String>)postRes.run()).body());
/*
//POST request with body and headers: //POST request with body and headers:
postRes = new POSTRequest("https://postman-echo.com/post","Test body", 30000, "header1","value1", "header2","value2"); postRes = new POSTRequest("https://postman-echo.com/post","Test body", 30000, "header1","value1", "header2","value2");
System.out.println(((HttpResponse<String>)postRes.run()).body());*/ System.out.println(((HttpResponse<String>)postRes.run()).body());*/
POSTRequest postRes = new POSTRequest("https://postman-echo.com/post",Path.of("..",".gitignore")); //POST request with a file.
System.out.println(((HttpResponse<String>)postRes.run()).body()); //POSTRequest postRes = new POSTRequest("https://postman-echo.com/post",Path.of("..",".gitignore"));
//System.out.println(((HttpResponse<String>)postRes.run()).body());
} catch (FailedResponseException e) { } catch (FailedResponseException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -6,18 +6,4 @@ function define() {
eval export "$1"='$value' eval export "$1"='$value'
} }
if [[ $(pwd) != *"SigScript" ]]; then
source utils/search.sh
find . -type f -name md5 -delete
#Check for hashes
FILES=$(cat utils/.updateDirectories)
for f in $FILES
do
search $f
check $f
done
else
echo "Dev build, no checks required." echo "Dev build, no checks required."
fi