Skip to content

Commit

Permalink
Merge branch 'master' into remove-interation
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored Dec 5, 2022
2 parents e78c013 + 0a765c6 commit 2567f80
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/examples-linux-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
linux debug all-clusters-app \
out/linux-x64-all-clusters/chip-all-clusters-app \
/tmp/bloat_reports/
- name: Build example Standalone All Clusters Mininal Server
- name: Build example Standalone All Clusters Minimal Server
timeout-minutes: 10
run: |
./scripts/run_in_build_env.sh \
Expand All @@ -124,7 +124,7 @@ jobs:
build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
linux debug all-clusters-minimal-app \
out/linux-x64-all-clusters-minimal/chip-all-clusters-app \
out/linux-x64-all-clusters-minimal/chip-all-clusters-minimal-app \
/tmp/bloat_reports/
- name: Build example TV app
timeout-minutes: 10
Expand Down
27 changes: 14 additions & 13 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"featureLevel": 81,
"featureLevel": 87,
"creator": "zap",
"keyValuePairs": [
{
Expand All @@ -16,19 +16,19 @@
}
],
"package": [
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json",
"type": "zcl-properties",
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data with some extensions"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
}
],
"endpointTypes": [
Expand Down Expand Up @@ -8058,7 +8058,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -8110,7 +8110,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "server",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -9709,7 +9709,7 @@
"code": 15,
"mfgCode": null,
"side": "server",
"type": "bitmap8",
"type": "LevelControlOptions",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down Expand Up @@ -19162,7 +19162,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -19334,7 +19334,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [
Expand Down Expand Up @@ -24740,5 +24740,6 @@
"endpointVersion": 1,
"deviceIdentifier": 61442
}
]
],
"log": []
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"featureLevel": 81,
"featureLevel": 87,
"creator": "zap",
"keyValuePairs": [
{
Expand All @@ -16,19 +16,19 @@
}
],
"package": [
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl.json",
"type": "zcl-properties",
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
}
],
"endpointTypes": [
Expand Down Expand Up @@ -8058,7 +8058,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -8110,7 +8110,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "server",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -9559,7 +9559,7 @@
"code": 15,
"mfgCode": null,
"side": "server",
"type": "bitmap8",
"type": "LevelControlOptions",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down Expand Up @@ -18954,7 +18954,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -19126,7 +19126,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [
Expand Down Expand Up @@ -24516,5 +24516,6 @@
"endpointVersion": 1,
"deviceIdentifier": 61442
}
]
],
"log": []
}
24 changes: 12 additions & 12 deletions examples/thermostat/thermostat-common/thermostat.zap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"featureLevel": 85,
"featureLevel": 87,
"creator": "zap",
"keyValuePairs": [
{
Expand All @@ -16,19 +16,19 @@
}
],
"package": [
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl.json",
"type": "zcl-properties",
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
}
],
"endpointTypes": [
Expand Down Expand Up @@ -7014,7 +7014,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -7066,7 +7066,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "server",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -8335,7 +8335,7 @@
"code": 15,
"mfgCode": null,
"side": "server",
"type": "bitmap8",
"type": "LevelControlOptions",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down Expand Up @@ -14132,7 +14132,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -14176,7 +14176,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "server",
"enabled": 0,
"commands": [
Expand Down
27 changes: 14 additions & 13 deletions examples/tv-app/tv-common/tv-app.zap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"featureLevel": 81,
"featureLevel": 87,
"creator": "zap",
"keyValuePairs": [
{
Expand All @@ -16,19 +16,19 @@
}
],
"package": [
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl.json",
"type": "zcl-properties",
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data"
},
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/app-templates.json",
"type": "gen-templates-json",
"version": "chip-v1"
}
],
"endpointTypes": [
Expand Down Expand Up @@ -6924,7 +6924,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -6976,7 +6976,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "server",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -9222,7 +9222,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -9274,7 +9274,7 @@
"name": "Unit Testing",
"code": 4294048773,
"mfgCode": null,
"define": "TEST_CLUSTER",
"define": "UNIT_TESTING_CLUSTER",
"side": "server",
"enabled": 0,
"commands": [
Expand Down Expand Up @@ -9977,7 +9977,7 @@
"code": 15,
"mfgCode": null,
"side": "server",
"type": "bitmap8",
"type": "LevelControlOptions",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
Expand Down Expand Up @@ -12364,5 +12364,6 @@
"endpointVersion": 1,
"deviceIdentifier": 36
}
]
],
"log": []
}
14 changes: 13 additions & 1 deletion scripts/tools/zap/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import json
import os
from pathlib import Path
import tempfile
import subprocess
import sys
import urllib.request
Expand Down Expand Up @@ -268,7 +269,18 @@ def main():
# Parallel-compatible runs will need separate state
os.environ["ZAP_TEMPSTATE"] = "1"

runGeneration(cmdLineArgs.zapFile, cmdLineArgs.zclFile, cmdLineArgs.templateFile, cmdLineArgs.outputDir)
# `zap-cli` may extract things into a temporary directory. ensure extraction
# does not conflict.
with tempfile.TemporaryDirectory(prefix='zap') as temp_dir:
old_temp = os.environ['TEMP'] if 'TEMP' in os.environ else None
os.environ['TEMP'] = temp_dir

runGeneration(cmdLineArgs.zapFile, cmdLineArgs.zclFile, cmdLineArgs.templateFile, cmdLineArgs.outputDir)

if old_temp:
os.environ['TEMP'] = old_temp
else:
del os.environ['TEMP']

prettifiers = [
runClangPrettifier,
Expand Down
Loading

0 comments on commit 2567f80

Please sign in to comment.