|
35 | 35 | CHIP_ROOT_DIR = os.path.realpath(
|
36 | 36 | os.path.join(os.path.dirname(__file__), '../..'))
|
37 | 37 |
|
| 38 | +# TODO: Can we share this constant definition with generate.py? |
| 39 | +DEFAULT_DATA_MODEL_DESCRIPTION_FILE = 'src/app/zap-templates/zcl/zcl.json' |
| 40 | + |
38 | 41 |
|
39 | 42 | class TargetType(Flag):
|
40 | 43 | """Type of targets that can be re-generated"""
|
@@ -108,6 +111,12 @@ def build_command(self, script: str) -> List[str]:
|
108 | 111 | """What command to execute for this zap input. """
|
109 | 112 | if self.zap_file:
|
110 | 113 | return [script, self.zap_file]
|
| 114 | + if self.properties_json == DEFAULT_DATA_MODEL_DESCRIPTION_FILE: |
| 115 | + # Omit the -z bits because that's the default generate.py |
| 116 | + # will use anyway, and this leads to nicer-looking command |
| 117 | + # lines if people need to run the regen manually and get |
| 118 | + # their command line from our --dry-run. |
| 119 | + return [script] |
111 | 120 | return [script, '-z', self.properties_json]
|
112 | 121 |
|
113 | 122 |
|
@@ -382,7 +391,7 @@ def getGlobalTemplatesTargets():
|
382 | 391 |
|
383 | 392 | targets.append(ZAPGenerateTarget.MatterIdlTarget(ZapInput.FromZap(filepath)))
|
384 | 393 |
|
385 |
| - targets.append(ZAPGenerateTarget.MatterIdlTarget(ZapInput.FromPropertiesJson('src/app/zap-templates/zcl/zcl.json'), |
| 394 | + targets.append(ZAPGenerateTarget.MatterIdlTarget(ZapInput.FromPropertiesJson(DEFAULT_DATA_MODEL_DESCRIPTION_FILE), |
386 | 395 | client_side=True, matter_file_name="src/controller/data_model/controller-clusters.matter"))
|
387 | 396 |
|
388 | 397 | return targets
|
@@ -414,7 +423,7 @@ def getGoldenTestImageTargets():
|
414 | 423 |
|
415 | 424 |
|
416 | 425 | def getSpecificTemplatesTargets():
|
417 |
| - zap_input = ZapInput.FromPropertiesJson('src/app/zap-templates/zcl/zcl.json') |
| 426 | + zap_input = ZapInput.FromPropertiesJson(DEFAULT_DATA_MODEL_DESCRIPTION_FILE) |
418 | 427 |
|
419 | 428 | # Mapping of required template and output directory
|
420 | 429 | templates = {
|
|
0 commit comments