-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
75 lines (53 loc) · 3.24 KB
/
Makefile
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
72
73
74
75
help:
@echo "NOTE - this makefile is mostly unix aliases. Use 'mvn install' to build."
@grep -iE "^(#.+|[a-zA-Z0-9_-]+:.*(#.+)?)$$" Makefile | sed -r "s/^# /\n/g; s/:.+#/#/g; s/^/ /g; s/#/\\n /g; s/:$$//g"
clean:
mvn clean
rm -f *timestamp */*timestamp
rm -r ~/.m2/repository/edu/berkeley/cs/sketch
# pom management utilities
set_version: # args: current=<version> next=<version>
( [ "$(current)" ] && [ "$(next)" ] ) || { echo "please set current and next."; exit 1; }
sed -i "s/$(current)/$(next)/g" pom.xml
sed -i "s/$(current)/$(next)/g" skalch-plugin/pom.xml
sed -i "s/$(current)/$(next)/g" skalch-base/pom.xml
kate: # open various config files in Kate
kate -u Makefile pom.xml */pom.xml */db/*.xml
# other
bitonic_plugin: # build the plugin and compile the bitonic sort test
cd skalch-plugin; mvn compile install
cd skalch-base; export TRANSLATE_SKETCH=true; touch src/test/skalch_old/BitonicSortTest.scala; mvn test-compile -Dmaven.scala.displayCmd=true
plugin_dev: # build the plugin and compile the a test given by $(testfile)
cd skalch-plugin; mvn compile install
cd skalch-base; export TRANSLATE_SKETCH=true; touch src/test/$(testfile); mvn test-compile -Dmaven.scala.displayCmd=true
# tests
bitonic_test: # run the bitonic sort test
cd skalch-base; mvn exec:java -Dexec.classpathScope=test -Dexec.mainClass=test.BitonicSortTest -Dexec.args="--array_length 4 --num_steps 10"
completed_test: # run the completed test
cd skalch-base; mvn compile test-compile exec:java -Dexec.classpathScope=test -Dexec.mainClass=test.CompletedTest -Dexec.args=""
# developer-specific commands
gatoatigrado-clean-other: clean # clean relative paths in gatoatigrado's project
rm -rf ../SKETCH/target ../SKETCH/mvn-bin ../sketch-util/target
gatoatigrado-build-plugin-deps: # build dependencies for the plugin, use skipdeps=1 to skip
ifndef skipdeps
# maven is messed up, or maybe this is Eclipse's build system
rm -rf ~/sandbox/eclipse/sketch/target/classes/SKETCH/util
cd ../sketch-util; mvn install
cd ../SKETCH; mvn install
endif
gatoatigrado-plugin-dev: gatoatigrado-build-plugin-deps # gatoatigrado's plugin development (bitonic sort sketch)
@make bitonic_plugin
gatoatigrado-plugin-rbtree: gatoatigrado-build-plugin-deps # gatoatigrado's plugin development trying the red-black tree sketch
@make plugin_dev testfile=RedBlackTreeTest.scala
gatoatigrado-plugin-dws: gatoatigrado-build-plugin-deps # dws sketch (lots of syntax)
@make plugin_dev testfile=Dfs.scala
gatoatigrado-plugin-roman-numeral: gatoatigrado-build-plugin-deps # roman numerals (match stmt)
@make plugin_dev testfile=RomanNumerals.scala
gatoatigrado-plugin-rev-list: gatoatigrado-build-plugin-deps # rev list test (catch stmt)
@make plugin_dev testfile=RevListTest.scala
g: gatoatigrado-plugin-dev # whatever gatoatigrado's currently working on
gatoatigrado-remove-whitespace: # trim trailing whitespace on all files
bash -c "source build_util/bash_functions.sh; cd skalch-plugin; trim_whitespace src"
bash -c "source build_util/bash_functions.sh; cd skalch-base; trim_whitespace src"
gatoatigrado-set-test-package-decls: # hack to use sed and rename all java package declarations in the tests directory
bash -c "source build_util/bash_functions.sh; cd skalch-base/src; set_package_decls test"