forked from AdoptOpenJDK/jdk9-jigsaw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.sh
executable file
·49 lines (38 loc) · 1.49 KB
/
compile.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
# Escape code
esc=$(echo -en "\033")
info="${esc}[0;33m"
normal=$(echo -en "${esc}[m\017")
runTree()
{
if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] ; then
cmd //c "tree /f /a $1"
else
tree -fl $1
fi
}
COM_GREETINGS_FOLDER="mods/com.greetings"
ORG_ASTRO_FOLDER="mods/org.astro"
echo ""
echo "${info} *** Compiling modules in $ORG_ASTRO_FOLDER (with 'exports' commented out) *** ${normal}"
javac -d $ORG_ASTRO_FOLDER \
src/org.astro/module-info.java \
src/org.astro/org/astro/World.java
echo ""
echo "${info} *** Displaying the contents (modules) of the '$ORG_ASTRO_FOLDER' folder *** ${normal}"
runTree "$ORG_ASTRO_FOLDER"
echo ""
echo "${info} *** Compiling modules in $COM_GREETINGS_FOLDER (fails with an error due to module 'org.astro' not being visible) *** ${normal}"
javac --module-path mods \
-d $COM_GREETINGS_FOLDER \
src/com.greetings/module-info.java \
src/com.greetings/com/greetings/Main.java
# ********************************************************************************
# Compilation does not finish due to compilation error, no artifacts are created.
# Execution does not proceed further, script exists at this point.
# ********************************************************************************
echo ""
echo "${info} *** Displaying the contents (modules) of the '$COM_GREETINGS_FOLDER' folder *** ${normal}"
runTree "$COM_GREETINGS_FOLDER"
# See ../01_Greetings/compile.sh for explanations to above commands