forked from sleeyax/burp-awesome-tls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·83 lines (66 loc) · 1.69 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
77
78
79
80
81
82
83
#!/bin/sh
# Simple shell script to copy resources and build jar files.
# Note that there's probably an easier way to do this, but i'm no Java or Gradle wizard ;)
# See https://github.com/sleeyax/burp-awesome-tls/issues/13 if you want to help out. Any help is appreciated!
buildJar() {
local targetPlatform="$1"
echo "building $targetPlatform jar"
./gradlew buildJar
mv ./build/libs/burp-awesome-tls.jar "./build/libs/Burp-Awesome-TLS-$targetPlatform.jar"
}
cleanup() {
rm --recursive --dir --verbose ./src/main/resources/*
}
copy() {
# params
local binary=$1
local resourceFolder=$2
local prefix=$3
local extension="${binary##*.}"
# locations to copy to and from
local binaryPath="./src-go/server/build/$binary"
local resourcePath="./src/main/resources/$resourceFolder/${prefix}server.$extension"
# perform copy
mkdir -p $(dirname "$resourcePath")
cp $binaryPath $resourcePath
echo "copied $binaryPath to $resourcePath"
}
copy_macos() {
copy "server-darwin-amd64.dylib" "darwin-x86-64" "lib"
}
copy_linux_386() {
copy "server-linux-386.so" "linux-x86"
}
copy_linux_amd64() {
copy "server-linux-amd64.so" "linux-x86-64"
}
copy_windows_amd64() {
copy "server-windows-amd64.dll" "win32-x86-64"
}
copy_windows_386() {
copy "server-windows-386.dll" "win32-x86"
}
# build separate jar files per platform
cleanup
copy_macos
buildJar "macos-amd64"
cleanup
copy_linux_386
buildJar "linux-i386"
cleanup
copy_linux_amd64
buildJar "linux-amd64"
cleanup
copy_windows_amd64
buildJar "windows-amd64"
cleanup
copy_windows_386
buildJar "windows-i386"
# build single cross-platform fat jar
cleanup
copy_macos
copy_linux_386
copy_linux_amd64
copy_windows_amd64
copy_windows_386
buildJar "fat"