mirror of
				https://github.com/davidgiven/fluxengine.git
				synced 2025-10-31 11:17:01 -07:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			535 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			535 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from build.ab import (
 | |
|     Rule,
 | |
|     simplerule,
 | |
|     TargetsMap,
 | |
|     filenameof,
 | |
| )
 | |
| 
 | |
| 
 | |
| @Rule
 | |
| def zip(
 | |
|     self, name, flags="", items: TargetsMap = {}, extension="zip", label="ZIP"
 | |
| ):
 | |
|     cs = ["$(PYTHON) build/_zip.py -z $[outs]"]
 | |
| 
 | |
|     ins = []
 | |
|     for k, v in items.items():
 | |
|         cs += [f"-f {k} {filenameof(v)}"]
 | |
|         ins += [v]
 | |
| 
 | |
|     simplerule(
 | |
|         replaces=self,
 | |
|         ins=ins,
 | |
|         deps=["build/_zip.py"],
 | |
|         outs=[f"={self.localname}." + extension],
 | |
|         commands=[" ".join(cs)],
 | |
|         label=label,
 | |
|     )
 |