forked from nipafx/demo-java-x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
switch-default.sh
executable file
·54 lines (46 loc) · 1.48 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
source executables.sh
echo -e "\n# COMPILING WITH OLD BOOL\n"
rm -rf target/*
cp \
src/switch_default/java/org/codefx/demo/java14/lang/switch_/OldBool.java \
src/switch_default/java/org/codefx/demo/java14/lang/switch_/Bool.java
$javac \
-d target/classes \
src/switch_default/java/org/codefx/demo/java14/lang/switch_/Switch.java \
src/switch_default/java/org/codefx/demo/java14/lang/switch_/Bool.java
rm src/switch_default/java/org/codefx/demo/java14/lang/switch_/Bool.java
echo -e "\n# RUNNING WITH OLD BOOL\n"
echo -e "# Argument: \"TRUE\""
$java \
-cp target/classes \
--enable-preview \
org.codefx.demo.java14.lang.switch_.Switch \
TRUE
echo -e "# Argument: \"FILE_NOT_FOUND\""
$java \
-cp target/classes \
--enable-preview \
org.codefx.demo.java14.lang.switch_.Switch \
FILE_NOT_FOUND
echo -e "\n# REPLACING OLD WITH NEW BOOL\n"
cp \
src/switch_default/java/org/codefx/demo/java14/lang/switch_/NewBool.java \
src/switch_default/java/org/codefx/demo/java14/lang/switch_/Bool.java
$javac \
-d target/classes \
src/switch_default/java/org/codefx/demo/java14/lang/switch_/Bool.java
rm src/switch_default/java/org/codefx/demo/java14/lang/switch_/Bool.java
echo -e "# RUNNING WITH NEW BOOL\n"
echo -e "# Argument: \"TRUE\""
$java \
-cp target/classes \
--enable-preview \
org.codefx.demo.java14.lang.switch_.Switch \
TRUE
echo -e "# Argument: \"FILE_NOT_FOUND\""
$java \
-cp target/classes \
--enable-preview \
org.codefx.demo.java14.lang.switch_.Switch \
FILE_NOT_FOUND