-
Notifications
You must be signed in to change notification settings - Fork 82
/
switch-default.sh
executable file
·54 lines (46 loc) · 1.49 KB
/
switch-default.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# no `set -e` to see expected errors
echo -e "\n# COMPILING WITH OLD BOOL\n"
rm -rf target/*
cp \
src/switch_default/java/dev/nipafx/demo/java14/lang/switch_/OldBool.java \
src/switch_default/java/dev/nipafx/demo/java14/lang/switch_/Bool.java
javac \
-d target/classes \
src/switch_default/java/dev/nipafx/demo/java14/lang/switch_/Switch.java \
src/switch_default/java/dev/nipafx/demo/java14/lang/switch_/Bool.java
rm src/switch_default/java/dev/nipafx/demo/java14/lang/switch_/Bool.java
echo -e "\n# RUNNING WITH OLD BOOL\n"
echo -e "# Argument: \"TRUE\""
java \
-cp target/classes \
--enable-preview \
dev.nipafx.demo.java14.lang.switch_.Switch \
TRUE
echo -e "# Argument: \"FILE_NOT_FOUND\""
java \
-cp target/classes \
--enable-preview \
dev.nipafx.demo.java14.lang.switch_.Switch \
FILE_NOT_FOUND
echo -e "\n# REPLACING OLD WITH NEW BOOL\n"
cp \
src/switch_default/java/dev/nipafx/demo/java14/lang/switch_/NewBool.java \
src/switch_default/java/dev/nipafx/demo/java14/lang/switch_/Bool.java
javac \
-d target/classes \
src/switch_default/java/dev/nipafx/demo/java14/lang/switch_/Bool.java
rm src/switch_default/java/dev/nipafx/demo/java14/lang/switch_/Bool.java
echo -e "# RUNNING WITH NEW BOOL\n"
echo -e "# Argument: \"TRUE\""
java \
-cp target/classes \
--enable-preview \
dev.nipafx.demo.java14.lang.switch_.Switch \
TRUE
echo -e "# Argument: \"FILE_NOT_FOUND\""
java \
-cp target/classes \
--enable-preview \
dev.nipafx.demo.java14.lang.switch_.Switch \
FILE_NOT_FOUND