Quellcode durchsuchen

Require minimum PlatformIO version (#20361)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Co-authored-by: Jason Smith <jason.inet@gmail.com>
Victor Oliveira vor 3 Jahren
Ursprung
Commit
3eddbc7286
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
1 geänderte Dateien mit 24 neuen und 0 gelöschten Zeilen
  1. 24
    0
      buildroot/share/PlatformIO/scripts/common-dependencies.py

+ 24
- 0
buildroot/share/PlatformIO/scripts/common-dependencies.py Datei anzeigen

@@ -16,6 +16,30 @@ except ImportError:
16 16
 	# PIO >= 4.4
17 17
 	from platformio.package.meta import PackageSpec as PackageManager
18 18
 
19
+PIO_VERSION_MIN = (5, 0, 3)
20
+try:
21
+	from platformio import VERSION as PIO_VERSION
22
+	weights = (1000, 100, 1)
23
+	version_min = sum([x[0] * float(re.sub(r'[^0-9]', '.', str(x[1]))) for x in zip(weights, PIO_VERSION_MIN)])
24
+	version_cur = sum([x[0] * float(re.sub(r'[^0-9]', '.', str(x[1]))) for x in zip(weights, PIO_VERSION)])
25
+	if version_cur < version_min:
26
+		print()
27
+		print("**************************************************")
28
+		print("******      An update to PlatformIO is      ******")
29
+		print("******  required to build Marlin Firmware.  ******")
30
+		print("******                                      ******")
31
+		print("******      Minimum version: ", PIO_VERSION_MIN, "    ******")
32
+		print("******      Current Version: ", PIO_VERSION, "    ******")
33
+		print("******                                      ******")
34
+		print("******   Update PlatformIO and try again.   ******")
35
+		print("**************************************************")
36
+		print()
37
+		exit(1)
38
+except SystemExit:
39
+	exit(1)
40
+except:
41
+	print("Can't detect PlatformIO Version")
42
+
19 43
 Import("env")
20 44
 
21 45
 #print(env.Dump())

Laden…
Abbrechen
Speichern