-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·76 lines (61 loc) · 2.31 KB
/
build.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
76
#!/bin/bash
set -e
# MADE BY DOUBLE STAR FOR PERSONAL COMPILING USAGE. COULD BE MADE BETTER ONE DAY... (makefile)
# THIS IS THE RELEASE SCRIPT!
# HAVE WINE INSTALLED OR NO WINDOWS!
buildfolder="work"
releasefolder="releases"
blue="\e[34m"
yellow="\e[36m"
clear="\e[39m"
mkdir -p ./"${releasefolder}"
build_images(){
# $1 is FlashLib name.
# $2 is the npm command
# $3 is the final file format.
# $4 is the archtecture, if it needs to change, and if exists.
local flashFile="${1}"
local npmCommand="${2}"
local fileFormat="${3}"
local targetArch="";
if ! [ -z "$4" ]; then
targetArch="${4}";
fi
# Processing done, prepare the folder. --------------------------------------------------
echo -e "$blue --> Rebuilding the folder... $clear"
rm -rf ./"${buildfolder}"
mkdir -p ./"${buildfolder}"
cp -r Icon/ LICENSE.md node_modules res main.js package*.json "${buildfolder}"/
echo -e "$yellow --> Rebuilding the folder -> DONE! $clear"
if ! [ -z "$targetArch" ]; then
echo -e "\e[33m Target Arch has changed. $clear Now it has $targetArch."
sed -i "s|x64|$targetArch|g" "${buildfolder}"/package.json
fi
echo -e "$blue --> Copying the correct flash player... $clear"
mkdir -p "./${buildfolder}/FlashPlayer"
cp "FlashPlayer/$flashFile" "${buildfolder}/FlashPlayer/"
echo -e "$yellow --> Copying the correct flash player -> DONE!$clear"
cd $buildfolder
echo -e "$blue --> Running npm build... $clear"
npm run $npmCommand
echo -e "$yellow --> Running npm build -> DONE!$clear"
echo -e "$blue --> Copying the builded app... $clear"
mkdir -p "../${releasefolder}/$targetArch"
cp dist/AquaStar*."$fileFormat" "../$releasefolder/$targetArch"
echo -e "$yellow --> Copying the builded app -> DONE!$clear"
cd ..
}
# Linux x64
build_images "libpepflashplayer.so" "dist-l" "AppImage"
# Linux x32
build_images "libpepflashplayer32bits.so" "dist-l" "AppImage" "ia32"
# Linux ARM
build_images "libpepflashplayerARM.so" "dist-l" "AppImage" "armv7l"
# Windows x64
build_images "pepflashplayer.dll" "dist-w" "exe"
# Windows x32
build_images "pepflashplayer32bits.dll" "dist-w" "exe" "ia32"
# EXPERIMENTAL -
# MacOS - can only be builded on macos!
#build_images "PepperFlashPlayer.plugin" "dist-m" "dmg"
exit