Skip to content

Commit 91fbc63

Browse files
committed
Merge branch 'contrib/github_pr_387' into 'master'
change(launchpad): change launchpad program (GitHub PR) Closes AEGHB-752 See merge request ae_group/esp-iot-solution!1054
2 parents 00fcb25 + 9604dfc commit 91fbc63

File tree

3 files changed

+92
-15
lines changed

3 files changed

+92
-15
lines changed

.gitlab/ci/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,13 @@ pack-upload_files:
8989
image: espressif/idf:release-v5.3
9090
tags: ['build']
9191
needs:
92+
- job: "build_example_keyboard: [espressif/idf:release-v5.3]"
9293
- job: "build_example_usb_device_usb_dual_uvc_device: [espressif/idf:release-v5.3]"
9394
- job: "build_example_usb_device_usb_webcam: [espressif/idf:release-v5.3]"
9495
- job: "build_example_usb_host_usb_camera_lcd_display: [espressif/idf:release-v5.1]"
9596
- job: "build_example_usb_host_usb_camera_mic_spk: [espressif/idf:release-v5.1]"
97+
- job: "build_example_usb_host_usb_cdc_4g_module: [espressif/idf:release-v5.1]"
98+
- job: "build_example_usb_host_usb_cdc_basic: [espressif/idf:release-v5.1]"
9699
artifacts:
97100
when: always
98101
paths:

tools/ci/launchpad/generateFiles.py

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5+
from itertools import count
56
import re
67
import sys
78
import subprocess
@@ -34,6 +35,10 @@ def __init__(self, app):
3435
self.app_version = ''
3536
# App readme
3637
self.readme = ''
38+
# App description
39+
self.description = ''
40+
# App SDK count
41+
self.sdkcount = ''
3742

3843
current_app = App(None)
3944

@@ -118,26 +123,39 @@ def remove_app_from_config(apps):
118123
new_apps = []
119124
for app in apps:
120125
# remove './' in string
121-
app_dir = app['app_dir'][2:]
126+
if app['app_dir'].startswith('./'):
127+
app_dir = app['app_dir'][2:]
128+
else:
129+
app_dir = app['app_dir']
130+
122131
if app_dir not in config_apps:
123132
continue
124133

125134
example = config_apps[app_dir]
126135
matched_build_info = []
136+
sdkcount = {}
127137
for build_info in app['build_info']:
128138
target = build_info.get('target')
129139
if (
130140
example.get(target) and
131141
build_info.get('sdkconfig') in example.get(target, {}).get('sdkconfig', [])
132142
):
143+
if build_info.get('sdkconfig') == 'defaults':
144+
build_info['sdkconfig'] = target + '_generic'
133145
matched_build_info.append(build_info)
146+
147+
if not sdkcount.get(f'developKits.{target}'):
148+
sdkcount[f'developKits.{target}'] = 1
149+
else:
150+
sdkcount[f'developKits.{target}'] += 1
134151
if matched_build_info:
135152
app['build_info'] = matched_build_info
153+
app['sdkcount'] = sdkcount
136154
if config_apps[app_dir].get('readme'):
137-
print(config_apps[app_dir]['readme'])
138155
app['readme'] = config_apps[app_dir]['readme']
156+
if config_apps[app_dir].get('description'):
157+
app['description'] = config_apps[app_dir]['description']
139158
new_apps.append(app)
140-
141159
return new_apps
142160

143161
# Squash the json into a list of apps
@@ -183,6 +201,9 @@ def merge_binaries(apps):
183201
build_dirs = build_info['build_dir']
184202
idf_version = build_info['idf_version']
185203
app_version = app['app_version']
204+
sdkcount = app['sdkcount']
205+
if sdkcount.get(f'developKits.{target}') == 1:
206+
sdkconfig = ''
186207
bin_name = f'{app["name"]}-{target}' + (f'-{sdkconfig}' if sdkconfig else '') + (f'-{app_version}' if app_version else '') + (f'-{idf_version}' if idf_version else '') + '.bin'
187208
cmd = ['esptool.py', '--chip', target, 'merge_bin', '-o', bin_name, '@flash_args']
188209
cwd = os.path.join(app.get('app_dir'), build_dirs)
@@ -204,22 +225,38 @@ def merge_binaries(apps):
204225
def write_app(app):
205226
# If we are working with kits
206227
for build_info in app['build_info']:
228+
target = build_info['target']
229+
sdkconfig = build_info['sdkconfig']
207230
idf_version = build_info['idf_version']
208231
app_version = app['app_version']
209-
sdkconfig = build_info['sdkconfig']
210-
bin_name = f'{app["name"]}-{build_info["target"]}' + (f'-{sdkconfig}' if sdkconfig else '') + (f'-{app_version}' if app_version else '') + (f'-{idf_version}' if idf_version else '') + '.bin'
232+
sdkcount = app['sdkcount']
233+
if sdkcount.get(f'developKits.{target}') == 1:
234+
sdkconfig = ''
235+
bin_name = f'{app["name"]}-{target}' + (f'-{sdkconfig}' if sdkconfig else '') + (f'-{app_version}' if app_version else '') + (f'-{idf_version}' if idf_version else '') + '.bin'
211236
support_app = f'{app["name"]}'
212237
if not toml_obj.get(support_app):
213238
toml_obj[support_app] = {}
214239
toml_obj[support_app]['android_app_url'] = ''
215240
toml_obj[support_app]['ios_app_url'] = ''
216241
if app.get('readme'):
217242
toml_obj[support_app]['readme.text'] = app['readme']
243+
if app.get('description'):
244+
toml_obj[support_app]['description'] = app['description']
245+
218246
if not toml_obj[support_app].get('chipsets'):
219-
toml_obj[support_app]['chipsets'] = [f'{build_info["target"]}-{build_info["sdkconfig"]}']
247+
toml_obj[support_app]['chipsets'] = [f'{target}']
248+
elif f'{target}' not in toml_obj[support_app]['chipsets']:
249+
toml_obj[support_app]['chipsets'].append(f'{target}')
250+
251+
if sdkcount.get(f'developKits.{target}') > 1:
252+
if not toml_obj[support_app].get(f'developKits.{target}'):
253+
toml_obj[support_app][f'developKits.{target}'] = [f'{sdkconfig}']
254+
else:
255+
toml_obj[support_app][f'developKits.{target}'].append(f'{sdkconfig}')
256+
if sdkcount.get(f'developKits.{target}') == 1:
257+
toml_obj[support_app][f'image.{target}'] = bin_name
220258
else:
221-
toml_obj[support_app]['chipsets'].append(f'{build_info["target"]}-{build_info["sdkconfig"]}')
222-
toml_obj[support_app][f'image.{build_info["target"]}-{build_info["sdkconfig"]}'] = bin_name
259+
toml_obj[support_app][f'image.{sdkconfig}'] = bin_name
223260

224261
# Create the config.toml file
225262
def create_config_toml(apps):
@@ -232,14 +269,14 @@ def create_config_toml(apps):
232269

233270
# This is a workaround to remove the quotes around the image.<string> in the config.toml file as dot is not allowed in the key by default
234271
with open('binaries/config.toml', 'r') as toml_file:
235-
fixed = replace_image_and_readme_string(toml_file.read())
272+
fixed = unquote_config_keys(toml_file.read())
236273

237274
with open('binaries/config.toml', 'w') as toml_file:
238275
toml_file.write(fixed)
239276

240-
def replace_image_and_readme_string(text):
277+
def unquote_config_keys(text):
241278
# Define the regular expression pattern to find "image.<string>"
242-
pattern = r'"((image|readme)\.[\w-]+)"'
279+
pattern = r'"((image|readme|developKits)\.[\w-]+)"'
243280
# Use re.sub() to replace the matched pattern with image.<string>
244281
result = re.sub(pattern, r'\1', text)
245282
return result

tools/ci/launchpad/upload_project_config.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,51 @@
22
# target: esp32 // target name
33
# sdkconfig: // sdkconfig name
44
# - a // sdkconfig.ci.a
5-
# - default // sdkconfig.default
5+
# - default // sdkconfig.default (will be renamed to {target}_generic)
66
# target: esp32s3 // target name
77
# sdkconfig: // sdkconfig name
8-
# - b // sdkconfig.ci.a
9-
# - default // sdkconfig.default
10-
# readme: // readme url must point a README.md link
8+
# - b // sdkconfig.ci.b
9+
# - default // sdkconfig.default (will be renamed to {target}_generic)
10+
# description: // Description of the example (optional)
11+
# <description>
12+
# readme: // readme url must point a README.md link (optional)
1113
# <URL>
1214

15+
examples/keyboard:
16+
esp32s3:
17+
sdkconfig:
18+
- defaults
19+
description: A full key anti-ghosting keyboard powered by the ESP32S3. https://github.com/espressif/esp-iot-solution/tree/master/examples/keyboard
20+
readme: https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/keyboard/README.md
21+
1322
examples/usb/device/usb_dual_uvc_device:
1423
esp32s3:
1524
sdkconfig:
1625
- esp32s3_usb_otg
26+
- defaults
1727
esp32p4:
1828
sdkconfig:
1929
- defaults
30+
description:
31+
This is the USB dual UVC device example
2032
readme:
2133
https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/usb/device/usb_dual_uvc_device/README.md
2234

2335
examples/usb/device/usb_webcam:
2436
esp32s3:
2537
sdkconfig:
2638
- esp32s3_eye
39+
description:
40+
This is the USB webcam example
2741
readme:
2842
https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/usb/device/usb_webcam/README.md
2943

3044
examples/usb/host/usb_camera_lcd_display:
3145
esp32s3:
3246
sdkconfig:
3347
- esp32s3_lcd_ev_board
48+
description:
49+
This is the USB camera LCD display example
3450
readme:
3551
https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/usb/host/usb_camera_lcd_display/README.md
3652

@@ -39,5 +55,26 @@ examples/usb/host/usb_camera_mic_spk:
3955
sdkconfig:
4056
- esp32s3_usb_otg
4157
- defaults
58+
description:
59+
This is the USB camera microphone speaker example
4260
readme:
4361
https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/usb/host/usb_camera_mic_spk/README.md
62+
63+
examples/usb/host/usb_cdc_4g_module:
64+
esp32s3:
65+
sdkconfig:
66+
- esp32s3_usb_otg
67+
- defaults
68+
description:
69+
This is the USB CDC 4G module example
70+
readme:
71+
https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/usb/host/usb_cdc_4g_module/README.md
72+
73+
examples/usb/host/usb_cdc_basic:
74+
esp32s3:
75+
sdkconfig:
76+
- esp32s3_usb_otg
77+
description:
78+
This is the USB CDC basic example
79+
readme:
80+
https://raw.githubusercontent.com/espressif/esp-iot-solution/master/examples/usb/host/sb_cdc_basic/README.md

0 commit comments

Comments
 (0)