Browse Source

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 3 years ago
parent
commit
3eddbc7286
No account linked to committer's email address
1 changed files with 24 additions and 0 deletions
  1. 24
    0
      buildroot/share/PlatformIO/scripts/common-dependencies.py

+ 24
- 0
buildroot/share/PlatformIO/scripts/common-dependencies.py View File

@@ -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())

Loading…
Cancel
Save