Advertisement
Stranck

MiniBASIC compile process FIX

May 24th, 2020
1,680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.68 KB | None | 0 0
  1. folder=<cartella_studente> #student folder
  2.  
  3. #Sets up the classPath. If something breaks, probably the problem it's there
  4. classPath="${folder}/src:../org.apiguardian_1.1.0.v20190826-0900.jar:../org.junit.platform.commons_1.5.1.v20190826-0900.jar:../org.opentest4j_1.2.0.v20190826-0900.jar:../org.hamcrest.core_1.3.0.v20180420-1519.jar:../org.junit.platform.engine_1.5.1.v20190826-0900.jar:../org.junit.jupiter.api_5.5.1.v20190826-0900.jar:../org.junit.platform.launcher_1.5.1.v20190826-0900.jar:../org.junit.jupiter.engine_5.5.1.v20190826-0900.jar:../org.junit.platform.runner_1.5.1.v20190826-0900.jar:../org.junit.jupiter.migrationsupport_5.5.1.v20190826-0900.jar:../org.junit.platform.suite.api_1.5.1.v20190826-0900.jar:../junit.jar:../org.junit.jupiter.params_5.5.1.v20190826-0900.jar:../org.junit.vintage.engine_5.5.1.v20190826-0900.jar"
  5.  
  6. #Cleans the project
  7. rm it/uniroma1/metodologie/MiniBASICTest.class
  8. find ${folder}/src/ -type f -name "*.class" -exec rm {} \;
  9. #Recompile from MiniBASICTest
  10. echo "Compiling it/uniroma1/metodologie/MiniBASICTest.java"
  11. jdk-14.0.1/bin/javac -encoding iso-8859-1 -classpath "${classPath}" it/uniroma1/metodologie/MiniBASICTest.java
  12. #If there's any class left behind, compile it manually
  13. find ${folder}/src/it/uniroma1/metodologie/ -type f -name "*.java" -exec bash -c 'fullName={}; baseName=${fullName::-4}; if [ ! -f "${baseName}class" ]; then echo "Manually compiling ${fullName}"; jdk-14.0.1/bin/javac -encoding iso-8859-1 -classpath "'${classPath}'" ${fullName}; fi' \;
  14.  
  15.  
  16. #BONUS: run the tests (not actually tested lol)
  17. jdk-14.0.1/bin/java --enable-preview -jar junit-platform-console-standalone-1.6.2.jar -cp ".:${folder}/src" -c it.uniroma1.metodologie.MiniBASICTest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement