-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_packages.py
41 lines (35 loc) · 1.93 KB
/
make_packages.py
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
import time
import git
import subprocess
import shutil
import os
# "STM32F0", "STM32F1", "STM32F3", "STM32F4", "STM32H7"
repositories = {
("https://github.com/STMicroelectronics/stm32f0xx-hal-driver.git", "STM32F0", "armv6"),
("https://github.com/STMicroelectronics/stm32f1xx_hal_driver.git", "STM32F1", "armv7"),
("https://github.com/STMicroelectronics/stm32f3xx_hal_driver", "STM32F3", "armv7"),
("https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git", "STM32F4", "armv7"),
("https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git", "STM32H7", "armv7"),
}
for url, device, arch in repositories:
if os.path.exists("./hal"):
shutil.rmtree("./hal")
# time.sleep(5)
repo = git.Repo.clone_from(url, "./hal")
tags = repo.tags
print("tag: ", tags)
for tag in tags:
comand = f"export URL=\"{url}\" && export TAG=\"{tag}\" && conan create . --name=hal_{device.lower()} --version={str(tag).lower()} -pr:h=./profiles/{arch}"
print(comand)
result = subprocess.run(comand, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if result.returncode == 0:
comand = f" conan upload hal_{device.lower()}/{tag} -r=arm-tools"
result = subprocess.run(comand, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
print("Команда завершилась успешно")
print("Вывод команды:", result.stdout)
if result.returncode !=0:
print("Команда завершилась с ошибкой")
print("Ошибка:", result.stderr)
raise ValueError(f"сборка пакета не удалась, почините скрипт сборки")
# time.sleep(5)
#export URL="https://oauth2:[email protected]/breo_mcu/drivers/CMSIS_5.git" && export TAG="5.9.1-dev" && conan create . --version=5.9.1-dev --build-require