You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					31 lines
				
				701 B
			
		
		
			
		
	
	
					31 lines
				
				701 B
			| 
								 
											2 months ago
										 
									 | 
							
								Import("env")
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								from pathlib import Path
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								generator = File("generator/generator.py")
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								source_files = [
							 | 
						||
| 
								 | 
							
								  File(str(f))
							 | 
						||
| 
								 | 
							
								  for f in Path("generator").rglob("*")
							 | 
						||
| 
								 | 
							
								  if f.is_file() and f.suffix in {".py", ".dbc"}
							 | 
						||
| 
								 | 
							
								]
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								output_files = [
							 | 
						||
| 
								 | 
							
								  f.name.replace(".dbc", "_generated.dbc")
							 | 
						||
| 
								 | 
							
								  for f in Path("generator").rglob("*.dbc")
							 | 
						||
| 
								 | 
							
								  if not f.name.startswith("_")
							 | 
						||
| 
								 | 
							
								]
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# include DBCs generated by python scripts
							 | 
						||
| 
								 | 
							
								output_files += [
							 | 
						||
| 
								 | 
							
								  f.name.replace(".py", "_generated.dbc")
							 | 
						||
| 
								 | 
							
								  for f in Path("generator").rglob("*.py")
							 | 
						||
| 
								 | 
							
								  if not f.name.startswith(("_", "test_")) and f.name != "generator.py"
							 | 
						||
| 
								 | 
							
								]
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								generated = env.Command(
							 | 
						||
| 
								 | 
							
								  target=list(set(output_files)),
							 | 
						||
| 
								 | 
							
								  source=[generator] + source_files,
							 | 
						||
| 
								 | 
							
								  action="python3 ${SOURCES[0]}",
							 | 
						||
| 
								 | 
							
								)
							 |