-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilemakexd
More file actions
72 lines (58 loc) · 2.27 KB
/
filemakexd
File metadata and controls
72 lines (58 loc) · 2.27 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#
# makefile
#
# input file for 'make' build tool ( /usr/bin/make )
# to build solution for JUnit sample
#
# @author Dr. Fenwick
# @version Summer 2018
#
JUNIT4_JAR = /usr/share/java/junit-4.10.jar
JUNIT4_RUNNER = org.junit.runner.JUnitCore
HAMCREST_JAR = /usr/share/java/hamcrest/core-1.1.jar
JUNIT5_JAR = junit-platform-console-standalone-1.2.0.jar
JUNIT5_RUNNER = org.junit.platform.console.ConsoleLauncher
CKSTYLE_COMMAND = -jar /usr/local/checkstyle-5.5/checkstyle-5.5-all.jar
CKSTYLE_XML = cs_appstate_checks.xml
default:
@echo "USAGE: make target"
@echo "EXAMPLE: make help"
@echo "EXAMPLE: make targetlist"
targetlist:
@echo "7 available targets: clean - removes editor tmpfiles and .class files"
@echo "____________________ compile, test - builds JUnit5 tests, runs all (4 and 5)"
@echo "____________________ compile4, test4 - builds/runs JUnit4 tests"
@echo "____________________ defchk, customchk - default or custom checkstyle"
help:
@echo "Just starting with make? Try these 4 make commands successively:"
@echo "________ make clean ; make compile ; make test ; make defchk"
# makefile syntax
#target-name: files dependent on (can use multiple lines by ending
# lines with \
#<TAB char>Unix command-line command
#<TAB char>Unix command-line command
#etc.
#Essential that command lines start with single TAB character
compile4: Calculator.java Calculator4Test.java \
$(JUNIT4_JAR)
javac -cp .:$(JUNIT4_JAR) Calculator4Test.java
javac Calculator.java
compile: Calculator.java Calculator5Test.java $(JUNIT5_JAR)
javac -cp .:$(JUNIT5_JAR) Calculator5Test.java
javac Calculator.java
clean:
rm -f *~
rm -f Calculator*.class
test4: Calculator.class Calculator4Test.class
java -cp .:$(JUNIT4_JAR):$(HAMCREST_JAR) $(JUNIT4_RUNNER) Calculator4Test
test: $(JUNIT5_JAR)
java -cp .:$(JUNIT5_JAR) $(JUNIT5_RUNNER) --scan-class-path
defchk: Calculator.java $(CKSTYLE_XML)
# checkstyle Calculator.java
java $(CKSTYLE_COMMAND) -c $(CKSTYLE_XML) Calculator.java
customchk: Calculator.java style.xml
java $(CKSTYLE_COMMAND) -c style.xml Calculator.java
style.xml:
@echo "Custom checkstyle needs a local style.xml file."
@echo "Copy cs_appstate_checks.xml into style.xml and edit as needed."
@echo "--------------------------------------------------------------"