-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall-jar-to-maven-local-repo.sh
executable file
·76 lines (59 loc) · 1.67 KB
/
install-jar-to-maven-local-repo.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# DOWNLOAD AND INSTALL asciidoctor-pdf-cjk-ext JAR TO LOCAL MAVEN REPO
# USEAGE:
# ./install-jar-to-maven-local-repo.sh
# YOU NEED CHANGE FONT_LANG=YOUR-LANG-CODE in this script file
# EX: FONT_LANG=tc
# OR
# ./install-jar-to-maven-local-repo.sh YOUR-LANG-CODE
# EX:
# ./install-jar-to-maven-local-repo.sh jp
#
DOWNLOAD_BASE=https://github.com/life888888/asciidoctor-pdf-cjk-ext/releases/download/v0.1.1
TMP_DIR=$(mktemp -d -t asciidoctor-pdf-cjk-ext-example-$(date +%Y%m%d%H%M%S)-XXXX)
# FONT LANGUAGE CODE
# sc (Simplified Chinese)
# tc (Traditional Chinese)
# hk (Hong Kong)
# jp (Japanese)
# kr (Korean)
FONT_LANG=tc
if [ -z "$1" ]
then
echo ""
else
FONT_LANG=$1
echo "SET FONT_LANG=$1"
fi
echo "FONT_LANG=$FONT_LANG"
NOTO_FONTS=("sans" "sansmono" "serif")
echo "cd $TMP_DIR"
cd $TMP_DIR
echo ""
for FONT_NAME in ${NOTO_FONTS[@]}; do
JAR_FILE=pdf-ext-noto${FONT_NAME}-cjk-${FONT_LANG}.jar
DOWNLOAD_JAR_FILE_URL=${DOWNLOAD_BASE}/${JAR_FILE}
if [[ $OSTYPE == 'darwin'* ]]; then
echo "macOS"
echo "curl -LJO $DOWNLOAD_JAR_FILE_URL"
curl -LJO $DOWNLOAD_JAR_FILE_URL
else
echo "linux"
echo "wget $DOWNLOAD_JAR_FILE_URL"
wget $DOWNLOAD_JAR_FILE_URL
fi
echo ""
echo "mvn install:install-file \\
-Dfile=${JAR_FILE} \\
-DgroupId=com.life888888.lab \\
-DartifactId=pdf-ext-noto${FONT_NAME}-cjk-${FONT_LANG} \\
-Dversion=0.1.0 \\
-Dpackaging=jar"
mvn install:install-file \
-Dfile=${JAR_FILE} \
-DgroupId=com.life888888.lab \
-DartifactId=pdf-ext-noto${FONT_NAME}-cjk-${FONT_LANG} \
-Dversion=0.1.0 \
-Dpackaging=jar
echo ""
done
echo "DONE!"