forked from AdoptOpenJDK/jdk9-jigsaw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·49 lines (42 loc) · 1.5 KB
/
run.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
#!/bin/bash
set -eu
source ../../common-functions.sh
echo
echo "${info} *** Running from within the mods folder without arguments. *** ${normal}"
echo
if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] ; then
java --module-path "mods/main;lib" \
--module com.greetings/com.greetings.Main
else
java --module-path mods/main:lib \
--module com.greetings/com.greetings.Main
fi
echo
echo "${info} *** Running from within the mods folder with arguments. *** ${normal}"
echo
if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] ; then
java --module-path "mods/main;lib" \
--module com.greetings/com.greetings.Main \
Alice Bob Charlie
else
java --module-path mods/main:lib \
--module com.greetings/com.greetings.Main \
Alice Bob Charlie
fi
echo
echo "${info} *** Running tests *** ${normal}"
echo
# Instead of running the compiled test code directly (which we could do), we're running it as a patch to the original code.
if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] ; then
java --module-path "mods/main;lib" \
--add-modules com.greetings \
--patch-module com.greetings=mods/test/com.greetings \
--module junit/org.junit.runner.JUnitCore \
com.greetings.GreetTest
else
java --module-path mods/main:lib \
--add-modules com.greetings \
--patch-module com.greetings=mods/test/com.greetings \
--module junit/org.junit.runner.JUnitCore \
com.greetings.GreetTest
fi