Przeglądaj źródła

package_prod2u: support README.md and src/ in SDK package gathering

Prod2U Recovery 2 miesięcy temu
rodzic
commit
e6d484ef95
1 zmienionych plików z 13 dodań i 12 usunięć
  1. 13 12
      tools/package_prod2u.py

+ 13 - 12
tools/package_prod2u.py

@@ -205,18 +205,19 @@ def product_delivery(product,output,td_receipt,gui_exe,gui_zip=None,status_json=
     wire='contracts/6400-wire.yaml' if product=='6400-front-rear' else 'contracts/mrdimm-wire.yaml'
     requirements='docs/prod2u-6400-front-back-protocol.zh-CN.md' if product=='6400-front-rear' else 'projects/mrdimm-chamber/requirements.zh-CN.md'
     add('contracts/wire.yaml',ROOT/wire);add('contracts/requirements.zh-CN.md',ROOT/requirements)
-    sdk_paths=['pyproject.toml','README.zh-CN.md']
-    # Include the source/examples invoked by the SDK guide, including existing
-    # Go consumers. Keep repository-level verification orchestration outside it.
-    for name in ('go.mod','golden-vectors.json','manual-uart-contract.json','host-i2c-register-map.json','send_uart_hex_debug.sh'):
-        if (sdk/name).is_file():sdk_paths.append(name)
-    for directory in ('python','cmd','internal','pkg','examples','tools'):
-        for path in sorted((sdk/directory).rglob('*')):
-            relative=path.relative_to(sdk).as_posix()
-            if (path.is_file() and path.suffix in ('.py','.go','.c','.sh','.json') and
-                '__pycache__' not in path.parts and relative!='tools/verify_consumers.py'):
-                sdk_paths.append(relative)
-    for name in sdk_paths:add('SDK/'+name,sdk/name)
+    sdk_paths = ['pyproject.toml']
+    for name in ('README.zh-CN.md', 'README.md', 'go.mod', 'golden-vectors.json', 'manual-uart-contract.json', 'send_uart_hex_debug.sh'):
+        if (sdk / name).is_file():
+            sdk_paths.append(name)
+    for directory in ('src', 'python', 'cmd', 'internal', 'pkg', 'examples', 'tools'):
+        if (sdk / directory).is_dir():
+            for path in sorted((sdk / directory).rglob('*')):
+                relative = path.relative_to(sdk).as_posix()
+                if (path.is_file() and path.suffix in ('.py', '.go', '.c', '.sh', '.json') and
+                    '__pycache__' not in path.parts and relative != 'tools/verify_consumers.py'):
+                    sdk_paths.append(relative)
+    for name in sdk_paths:
+        add('SDK/' + name, sdk / name)
     if sdk_wheel:
         with zipfile.ZipFile(sdk_wheel) as wheel:
             names=wheel.namelist()