-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-processor.sh
executable file
·35 lines (29 loc) · 1.79 KB
/
test-processor.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
rm -fR classes/* &&
rm -fR generatedSources/* &&
find api/src/main/java/io/github/tivrfoa/mapresultset/ -name "*.java" > mapsources.txt &&
echo '--- Compiling API:' &&
echo '--------------' && cat mapsources.txt && echo '---------------' &&
javac -d classes/ @mapsources.txt &&
find processor/src/main/java/io/github/tivrfoa/mapresultset/ -name "*.java" > mapsources.txt &&
echo '--- Compiling Processor:' &&
echo '--------------' && cat mapsources.txt && echo '---------------' &&
javac -d classes/ @mapsources.txt &&
echo '--- Processing Annotations:' &&
find integrationtest/src/main/java/org/ -name "*.java" > sources.txt &&
echo '--------------' && cat sources.txt && echo '---------------' &&
## -proc:only does not work. It tries to compile anyways :(
javac -verbose -cp classes/ -Xlint:processing -proc:only -implicit:none -processor io.github.tivrfoa.mapresultset.MappingProcessor \
-s generatedSources @sources.txt
## Previous step fails because "-proc:only" is not respected.
## https://stackoverflow.com/questions/72795137/first-mvn-compile-fails-to-find-generated-sources
echo '--- Compiling Integration Test:' &&
find generatedSources -name "*.java" > sources.txt &&
find integrationtest/src/main/java/org/ -name "*.java" >> sources.txt &&
echo '--------------' && cat sources.txt && echo '---------------' &&
javac -cp classes/:lib/junit-jupiter-api-5.6.2.jar:lib/apiguardian-api-1.1.0.jar \
-d classes/ @sources.txt integrationtest/src/test/java/io/github/tivrfoa/mapresultset/TestProcessor.java &&
echo '--- Running TestProcessor' &&
java -cp classes/:lib/mysql-connector-java-8.0.29.jar:lib/junit-jupiter-5.6.2.jar:lib/junit-jupiter-api-5.6.2.jar:lib/opentest4j-1.2.0.jar \
-ea io.github.tivrfoa.mapresultset.TestProcessor
rm mapsources.txt
rm sources.txt