-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
75 lines (74 loc) · 2.89 KB
/
start.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
#!/bin/bash
# This file is generated by build.xml
FR_DIR="`pwd`/${BASH_SOURCE%/*}/"
if [[ ${BASH_SOURCE:0:1} == "/" ]]; then
# Workaround for VSCode Task Explorer on Mac and Linux
FR_DIR="${BASH_SOURCE%/*}/"
fi
if [[ ! -d "${FR_DIR}download/" ]]; then
mkdir "${FR_DIR}download/"
fi
if [[ ! -d "${FR_DIR}build/tmp/build" ]]; then
mkdir -p "${FR_DIR}build/tmp/build"
fi
ZIP=OpenJDK21U-jdk_x64_linux_hotspot_21.0.1_12.tar.gz
URL=https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1+12/OpenJDK21U-jdk_x64_linux_hotspot_21.0.1_12.tar.gz
DIR=build/jdk-21.0.1+12
SUB=
if [[ "$OSTYPE" == "darwin"* ]]; then
ZIP=OpenJDK21U-jdk_x64_mac_hotspot_21.0.1_12.tar.gz
URL=https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1+12/OpenJDK21U-jdk_x64_mac_hotspot_21.0.1_12.tar.gz
SUB=Contents/Home
fi
DOWNLOAD_HELP="download ${URL} manually, move it to ${FR_DIR}download and restart this script"
if [[ ! -f "${FR_DIR}download/${ZIP}" ]]; then
echo In case of errors ${DOWNLOAD_HELP}
curl -f -o "${FR_DIR}download/${ZIP}.tmp" -L ${URL}
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "Please ${DOWNLOAD_HELP}"
exit $retVal
fi
mv "${FR_DIR}download/${ZIP}.tmp" "${FR_DIR}/download/${ZIP}"
fi
if [[ ! -d "${FR_DIR}${DIR}/" ]]; then
tar --exclude=*/demo --exclude=*/sample --exclude=*/manual --exclude=*/src.zip -xzvf "${FR_DIR}download/${ZIP}" -C "${FR_DIR}build/tmp/build"
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "Please ${DOWNLOAD_HELP}"
exit $retVal
fi
mv "${FR_DIR}build/tmp/${DIR}//${SUB}" "${FR_DIR}${DIR}"
fi
ZIP=apache-ant-1.10.10-bin.tar.gz
URL=https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.10-bin.tar.gz
DIR=build/apache-ant-1.10.10
SUB=
DOWNLOAD_HELP="download ${URL} manually, move it to ${FR_DIR}download and restart this script"
if [[ ! -f "${FR_DIR}download/${ZIP}" ]]; then
echo In case of errors ${DOWNLOAD_HELP}
curl -f -o "${FR_DIR}download/${ZIP}.tmp" -L ${URL}
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "Please ${DOWNLOAD_HELP}"
exit $retVal
fi
mv "${FR_DIR}download/${ZIP}.tmp" "${FR_DIR}/download/${ZIP}"
fi
if [[ ! -d "${FR_DIR}${DIR}/" ]]; then
tar --exclude=*/demo --exclude=*/sample --exclude=*/manual --exclude=*/src.zip -xzvf "${FR_DIR}download/${ZIP}" -C "${FR_DIR}build/tmp/build"
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "Please ${DOWNLOAD_HELP}"
exit $retVal
fi
mv "${FR_DIR}build/tmp/${DIR}//${SUB}" "${FR_DIR}${DIR}"
fi
JDK_8_DIR="${FR_DIR}build/jdk8u392-b08"
JDK_11_DIR="${FR_DIR}build/jdk-11.0.21+9"
JDK_17_DIR="${FR_DIR}build/jdk-17.0.8+7"
JDK_21_DIR="${FR_DIR}build/jdk-21.0.1+12"
export JAVA_HOME="${JDK_21_DIR}"
chmod +x "${JDK_21_DIR}/lib/jspawnhelper"
export ANT_HOME="${FR_DIR}build/apache-ant-1.10.10"
"${FR_DIR}build/apache-ant-1.10.10/bin/ant" -Dfr.jdk.8.dir="${JDK_8_DIR}" -Dfr.jdk.11.dir="${JDK_11_DIR}" -Dfr.jdk.17.dir="${JDK_17_DIR}" -Dfr.jdk.21.dir="${JDK_21_DIR}" -emacs -buildfile "${FR_DIR}build.xml" "$@" start