-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathenv.sh
More file actions
executable file
·133 lines (133 loc) · 4.77 KB
/
Copy pathenv.sh
File metadata and controls
executable file
·133 lines (133 loc) · 4.77 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
# This file is generated by build.xml
if [[ "${BASH_SOURCE%/*}" == "." || "${BASH_SOURCE%/*}" == */* ]]; then
FR_DIR="`pwd`/${BASH_SOURCE%/*}/"
else
# No ./ or /path/to/ being used but for example 'bash restart.sh' or 'source env.sh' (instead of 'source ./env.sh' or 'source /path/to/env.sh')
FR_DIR="`pwd`/"
fi
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=OpenJDK25U-jdk_x64_linux_hotspot_25.0.3_9.tar.gz
URL=https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.3+9/OpenJDK25U-jdk_x64_linux_hotspot_25.0.3_9.tar.gz
DIR=build/jdk-25.0.3+9
SUB=
if [[ "$OSTYPE" == "darwin"* ]]; then
ZIP=OpenJDK25U-jdk_x64_mac_hotspot_25.0.3_9.tar.gz
URL=https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.3+9/OpenJDK25U-jdk_x64_mac_hotspot_25.0.3_9.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}"
chmod +x "${FR_DIR}${DIR}/lib/jspawnhelper"
RUN_INSTALL="true"
fi
ZIP=apache-ant-1.10.17-bin.tar.gz
URL=https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.17-bin.tar.gz
DIR=build/apache-ant-1.10.17
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
ZIP=rhino-1.7.15.zip
URL=https://github.com/mozilla/rhino/releases/download/Rhino1_7_15_Release/rhino-1.7.15.zip
DIR=build/rhino1.7.15
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
unzip "${FR_DIR}download/${ZIP}" -d "${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
if [[ ! -f "${FR_DIR}build/apache-ant-1.10.17/lib/rhino-1.7.15.jar" ]]; then
rm "${FR_DIR}build/apache-ant-1.10.17/lib/rhino-"*.jar
cp "${FR_DIR}build/rhino1.7.15/lib/rhino-"*.jar "${FR_DIR}build/apache-ant-1.10.17/lib/"
fi
if [[ ! -f "${FR_DIR}build/apache-ant-1.10.17/lib/progressbarget.jar" ]]; then
cp "${FR_DIR}extensions/progress-bar/progressbarget"*.jar "${FR_DIR}build/apache-ant-1.10.17/lib/"
fi
JDK_8_DIR="${FR_DIR}build/jdk8u492-b09"
JDK_11_DIR="${FR_DIR}build/jdk-11.0.31+11"
JDK_17_DIR="${FR_DIR}build/jdk-17.0.19+10"
JDK_21_DIR="${FR_DIR}build/jdk-21.0.11+10"
JDK_25_DIR="${FR_DIR}build/jdk-25.0.3+9"
if [[ ! -d "${JDK_8_DIR}" ]]; then
RUN_INSTALL="true"
fi
if [[ ! -d "${JDK_11_DIR}" ]]; then
RUN_INSTALL="true"
fi
if [[ ! -d "${JDK_17_DIR}" ]]; then
RUN_INSTALL="true"
fi
if [[ ! -d "${JDK_21_DIR}" ]]; then
RUN_INSTALL="true"
fi
if [[ ! -d "${FR_DIR}build/apache-maven-3.9.16" ]]; then
RUN_INSTALL="true"
fi
export JAVA_HOME="${JDK_25_DIR}"
export ANT_HOME="${FR_DIR}build/apache-ant-1.10.17"
if [[ "$RUN_INSTALL" == "true" ]]; then
"${FR_DIR}build/apache-ant-1.10.17/bin/ant" -emacs -buildfile "${FR_DIR}build.xml" install
fi
export PATH="${JAVA_HOME}/bin:${ANT_HOME}/bin:${FR_DIR}build/apache-maven-3.9.16/bin:${PATH}"
echo "JAVA : ${JAVA_HOME}"
echo "ANT : ${ANT_HOME}"
echo "MAVEN: ${FR_DIR}build/apache-maven-3.9.16"