-
Notifications
You must be signed in to change notification settings - Fork 13.3k
/
Copy pathbuild_board_manager_package.sh
executable file
·173 lines (161 loc) · 5.47 KB
/
build_board_manager_package.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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/bin/bash
#
# for platform in windows linux macosx; do pushd $platform; ls -l esptool-*; shasum -a 256 esptool-*; popd; done;
#
#
ver=`git describe --tags`
outdir=esp8266-$ver
srcdir=../hardware/esp8266com/esp8266/
mkdir -p $outdir
cp -R $srcdir/* $outdir/
cp -R ../libraries/SD $outdir/libraries/
cp -R ../libraries/Adafruit_ILI9341 $outdir/libraries/
cp -R ../libraries/OneWire $outdir/libraries/
cat $srcdir/platform.txt | \
gsed 's/runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-lx106-elf//g' | \
gsed 's/runtime.tools.esptool.path={runtime.platform.path}\/tools//g' | \
gsed 's/tools.esptool.path={runtime.platform.path}\/tools/tools.esptool.path=\{runtime.tools.esptool.path\}/g' \
> $outdir/platform.txt
zip -r $outdir.zip $outdir
rm -rf $outdir
sha=`shasum -a 256 $outdir.zip | cut -f 1 -d ' '`
size=`/bin/ls -l $outdir.zip | awk '{print $5}'`
echo Size: $size
echo SHA-256: $sha
if [ "$upload" == "prod" ]; then
remote="http://arduino.esp8266.com"
path=""
elif [ "$upload" == "stag" ]; then
remote="http://arduino.esp8266.com"
path="staging/"
else
upload=""
remote="http://localhost:8000"
fi
cat << EOF > package_esp8266com_index.json
{
"packages": [ {
"name":"esp8266",
"maintainer":"ESP8266 Community",
"websiteURL":"https://github.com/esp8266/Arduino",
"email":"[email protected]",
"help":{
"online":"http://esp8266.com"
},
"platforms": [ {
"name":"esp8266",
"architecture":"esp8266",
"version":"$ver",
"category":"ESP8266",
"url":"$remote/$path/$outdir.zip",
"archiveFileName":"$outdir.zip",
"checksum":"SHA-256:$sha",
"size":"$size",
"help":{
"online":"http://esp8266.com"
},
"boards":[
{
"name":"Generic ESP8266 Module"
},
{
"name":"Olimex MOD-WIFI-ESP8266(-DEV)"
},
{
"name":"NodeMCU 0.9 (ESP-12 Module)"
},
{
"name":"NodeMCU 1.0 (ESP-12E Module)"
},
{
"name":"Adafruit HUZZAH ESP8266 (ESP-12)"
}
],
"toolsDependencies":[ {
"packager":"esp8266",
"name":"esptool",
"version":"0.4.5"
},
{
"packager":"esp8266",
"name":"xtensa-lx106-elf-gcc",
"version":"1.20.0-26-gb404fb9"
} ]
} ],
"tools": [ {
"name":"esptool",
"version":"0.4.5",
"systems": [
{
"host":"i686-mingw32",
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.5/esptool-0.4.5-win32.zip",
"archiveFileName":"esptool-0.4.5-win32.zip",
"checksum":"SHA-256:1b0a7d254e74942d820a09281aa5dc2af1c8314ae5ee1a5abb0653d0580e531b",
"size":"17408"
},
{
"host":"x86_64-apple-darwin",
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.5/esptool-0.4.5-osx.tar.gz",
"archiveFileName":"esptool-0.4.5-osx.tar.gz",
"checksum":"SHA-256:924d31c64f4bb9f748e70806dafbabb15e5eb80afcdde33715f3ec884be1652d",
"size":"11359"
},
{
"host":"x86_64-pc-linux-gnu",
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.5/esptool-0.4.5-linux64.tar.gz",
"archiveFileName":"esptool-0.4.5-linux64.tar.gz",
"checksum":"SHA-256:4ce799e13fbd89f8a8f08a08db77dc3b1362c4486306fe1b3801dee80cfa3203",
"size":"12789"
},
{
"host":"i686-pc-linux-gnu",
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.5/esptool-0.4.5-linux32.tar.gz",
"archiveFileName":"esptool-0.4.5-linux32.tar.gz",
"checksum":"SHA-256:4aa81b97a470641771cf371e5d470ac92d3b177adbe8263c4aae66e607b67755",
"size":"12044"
}
]
},
{
"name":"xtensa-lx106-elf-gcc",
"version":"1.20.0-26-gb404fb9",
"systems": [
{
"host":"i686-mingw32",
"url":"http://arduino.esp8266.com/win32-xtensa-lx106-elf-gb404fb9.tar.gz",
"archiveFileName":"win32-xtensa-lx106-elf-gb404fb9.tar.gz",
"checksum":"SHA-256:1561ec85cc58cab35cc48bfdb0d0087809f89c043112a2c36b54251a13bf781f",
"size":"153807368"
},
{
"host":"x86_64-apple-darwin",
"url":"http://arduino.esp8266.com/osx-xtensa-lx106-elf-gb404fb9-2.tar.gz",
"archiveFileName":"osx-xtensa-lx106-elf-gb404fb9-2.tar.gz",
"checksum":"SHA-256:0cf150193997bd1355e0f49d3d49711730035257bc1aee1eaaad619e56b9e4e6",
"size":"35385382"
},
{
"host":"x86_64-pc-linux-gnu",
"url":"http://arduino.esp8266.com/linux64-xtensa-lx106-elf-gb404fb9.tar.gz",
"archiveFileName":"linux64-xtensa-lx106-elf-gb404fb9.tar.gz",
"checksum":"SHA-256:46f057fbd8b320889a26167daf325038912096d09940b2a95489db92431473b7",
"size":"30262903"
},
{
"host":"i686-pc-linux-gnu",
"url":"http://arduino.esp8266.com/linux32-xtensa-lx106-elf.tar.gz",
"archiveFileName":"linux32-xtensa-lx106-elf.tar.gz",
"checksum":"SHA-256:b24817819f0078fb05895a640e806e0aca9aa96b47b80d2390ac8e2d9ddc955a",
"size":"32734156"
}
]
} ]
} ]
}
EOF
if [ ! -z "$upload" ]; then
scp $outdir.zip dl:apps/download_files/download/$path
scp package_esp8266com_index.json dl:apps/download_files/download/$path
else
python -m SimpleHTTPServer
fi