Build.py adapted to new platformio version
This commit is contained in:
		
							parent
							
								
									4d6e590d0c
								
							
						
					
					
						commit
						12be3b3558
					
				
							
								
								
									
										21
									
								
								build.py
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								build.py
									
									
									
									
									
								
							@ -10,16 +10,15 @@ from platformio import util
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Import("env")
 | 
					Import("env")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import os.path
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# get platformio environment variables
 | 
					# get platformio environment variables
 | 
				
			||||||
project_config = util.load_project_config()
 | 
					project_config = util.load_project_config()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# get platformio source path
 | 
					# get platformio source path
 | 
				
			||||||
srcdir = env.get("PROJECTSRC_DIR").lower()
 | 
					srcdir = env.get("PROJECTSRC_DIR").replace("\\", "/")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# check if lmic config file is present in source directory
 | 
					# check if lmic config file is present in source directory
 | 
				
			||||||
lmicconfigfile = os.path.join (srcdir, project_config.get("common", "lmicconfigfile"))
 | 
					lmicconfig = project_config.get("common", "lmicconfigfile")
 | 
				
			||||||
 | 
					lmicconfigfile = os.path.join (srcdir, lmicconfig)
 | 
				
			||||||
if os.path.isfile(lmicconfigfile) and os.access(lmicconfigfile, os.R_OK):
 | 
					if os.path.isfile(lmicconfigfile) and os.access(lmicconfigfile, os.R_OK):
 | 
				
			||||||
    print "Parsing LMIC configuration from " + lmicconfigfile
 | 
					    print "Parsing LMIC configuration from " + lmicconfigfile
 | 
				
			||||||
else:
 | 
					else:
 | 
				
			||||||
@ -61,12 +60,14 @@ env.Replace(BINTRAY_REPO=repository)
 | 
				
			|||||||
env.Replace(BINTRAY_API_TOKEN=apitoken)
 | 
					env.Replace(BINTRAY_API_TOKEN=apitoken)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# get runtime credentials and put them to compiler directive
 | 
					# get runtime credentials and put them to compiler directive
 | 
				
			||||||
env.Replace(CPPDEFINES=[
 | 
					env.Append(BUILD_FLAGS=[
 | 
				
			||||||
    ('WIFI_SSID', '\\"' + mykeys["OTA_WIFI_SSID"] + '\\"'), 
 | 
					    u'-DWIFI_SSID=\\"' + mykeys["OTA_WIFI_SSID"] + '\\"', 
 | 
				
			||||||
    ('WIFI_PASS', '\\"' + mykeys["OTA_WIFI_PASS"] + '\\"'),
 | 
					    u'-DWIFI_PASS=\\"' + mykeys["OTA_WIFI_PASS"] + '\\"', 
 | 
				
			||||||
    ('BINTRAY_USER', '\\"' + mykeys["BINTRAY_USER"] + '\\"'),
 | 
					    u'-DBINTRAY_USER=\\"' + mykeys["BINTRAY_USER"] + '\\"', 
 | 
				
			||||||
    ('BINTRAY_REPO', '\\"' + mykeys["BINTRAY_REPO"] + '\\"'),
 | 
					    u'-DBINTRAY_REPO=\\"' + mykeys["BINTRAY_REPO"] + '\\"', 
 | 
				
			||||||
    ('ARDUINO_LMIC_PROJECT_CONFIG_H', '\"' + lmicconfigfile + '\"')
 | 
					    u'-DBINTRAY_PACKAGE=\\"$PIOENV\\"',
 | 
				
			||||||
 | 
					    u'-DARDUINO_LMIC_PROJECT_CONFIG_H=' + lmicconfig,
 | 
				
			||||||
 | 
					    u'-I \"' + srcdir + '\"'
 | 
				
			||||||
    ])
 | 
					    ])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# function for pushing new firmware to bintray storage using API
 | 
					# function for pushing new firmware to bintray storage using API
 | 
				
			||||||
 | 
				
			|||||||
@ -79,7 +79,6 @@ build_flags_basic =
 | 
				
			|||||||
    -w
 | 
					    -w
 | 
				
			||||||
    '-DCORE_DEBUG_LEVEL=${common.debug_level}'
 | 
					    '-DCORE_DEBUG_LEVEL=${common.debug_level}'
 | 
				
			||||||
    '-DLOG_LOCAL_LEVEL=${common.debug_level}'
 | 
					    '-DLOG_LOCAL_LEVEL=${common.debug_level}'
 | 
				
			||||||
    '-DBINTRAY_PACKAGE="$PIOENV"'
 | 
					 | 
				
			||||||
    '-DPROGVERSION="${common.release_version}"'
 | 
					    '-DPROGVERSION="${common.release_version}"'
 | 
				
			||||||
build_flags_sensors =
 | 
					build_flags_sensors =
 | 
				
			||||||
    -Llib/Bosch-BSEC/src/esp32/
 | 
					    -Llib/Bosch-BSEC/src/esp32/
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user