-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathpackaging.sh
executable file
·53 lines (42 loc) · 1.9 KB
/
packaging.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
#!/bin/bash
set -eu
source ../../common-functions.sh
echo ""
echo "${info} *** Creating folder 'mlib' for the packages (jar files) to be created *** ${normal}"
mkdir -p mlib # this must be created in order for the jar commands below to be successful
echo ""
echo "${info} *** Creating module org.astro as a package file (jar) *** ${normal}"
jar --create \
[parameter to specify file, in the mlib folder, specify module name, with @1.0 and .jar extension*] \
[parameter to specify module, set it to version 1.0] \
-C mods/org.astro .
echo ""
echo "${info} *** Creating module com.greetings as a package file (jar) *** ${normal}"
jar --create \
--file mlib/com.greetings.jar \
[parameter to specify the main class, and name the fully qualified main class] \
-C mods/com.greetings .
echo ""
echo "${info} *** Displaying the contents (package files created) of the 'mlib' folder *** ${normal}"
runTree mlib
echo ""
echo "${info} *** Printing module description for org.astro as recorded in the module-info.class file in the package (jar) *** ${normal}"
jar [verbose mode] \
[module description param] \
--file=mlib/[email protected]
echo ""
echo "${info} *** Displaying contents of the module package [email protected] *** ${normal}"
jar [verbose mode] \
[list contents of jar param] \
--file=mlib/[email protected]
echo ""
echo "${info} *** Printing module description for com.greetings as recorded in the module-info.class file in the package (jar) *** ${normal}"
jar [verbose mode] \
[module description param] \
--file=mlib/com.greetings.jar
echo ""
echo "${info} *** Displaying contents of the module package com.greetings *** ${normal}"
jar [verbose mode] \
[list contents of jar param] \
--file=mlib/com.greetings.jar
# Run 'jar --help' and 'jar --help-extra' to learn about all the above parameters used to create package files (jar) and also read their descriptions