Closed rcasia closed 7 months ago
Using mvn and gradle CLIs as build tools works, but it is slow especially for big projects.
I tried a different strategy that could be implemented instead:
#!/bin/bash MVN_CLASSPATH=$(mvn -q dependency:build-classpath -Dmdep.outputFile=/dev/stdout) CLASSPATH="./target/classes/:./target/test-classes/:$MVN_CLASSPATH" STANDALONE_JAR="/home/user/Downloads/junit-platform-console-standalone-1.10.1.jar" FILEPATH="./src/test/java/com/example/ExampleApplicationTests.java" ARGS="-m=com.example.ExampleApplicationTests#test --reports-dir=tmp" javac -d target -cp $CLASSPATH:$STANDALONE_JAR $FILEPATH && java -jar $STANDALONE_JAR -cp $CLASSPATH $ARGS
Using mvn and gradle CLIs as build tools works, but it is slow especially for big projects.
I tried a different strategy that could be implemented instead: