Julkaistu lähde
Lataa lähde ZIP
CH-J SM Mobile
Selaile hakemistoja ja tiedostoja tietyn sovelluksen julkaisua varten.
CH-J / SM Mobile
134 tiedostot
sm-mobile-20261016T050549Z-3678f2a05fa9
Lisätty: · Rakennettu:
1
#!/usr/bin/env python32
"""Bundle exact resolved package licenses; no network or parent-project dependency."""3
import json,pathlib,urllib.parse4
root=pathlib.Path(__file__).resolve().parents[1]5
config=root/'.dart_tool/package_config.json'6
packages=json.loads(config.read_text())['packages']7
sections=[]; index=[]8
for package in sorted(packages,key=lambda p:p['name']):9
if package['name']=='sm_mobile': continue10
uri=urllib.parse.urljoin(config.as_uri(),package['rootUri'])11
path=pathlib.Path(urllib.parse.unquote(urllib.parse.urlparse(uri).path))12
texts=[]13
for file in sorted(path.iterdir()):14
if file.is_file() and file.name.upper().split('.')[0] in ['LICENSE','LICENCE','COPYING','NOTICE']:15
texts.append(file.name+'\n'+file.read_text(errors='replace'))16
if not texts and package['name'] in ['flutter_driver','flutter_test','integration_test','flutter_localizations','flutter_web_plugins','flutter','fuchsia_remote_debug_protocol']:17
for parent in path.parents:18
license_file=parent/'LICENSE'19
if license_file.is_file():20
texts.append('Flutter SDK LICENSE\n'+license_file.read_text());break21
if not texts: raise SystemExit('Missing license: '+package['name'])22
version='SDK'23
pubspec=path/'pubspec.yaml'24
if pubspec.exists():25
import re26
m=re.search(r'^version:\s*([^\n]+)',pubspec.read_text(),re.M)27
if m: version=m.group(1)28
index.append(f"| {package['name']} | {version} |")29
sections.append('\n'+'='*72+'\n'+package['name']+' '+version+'\n'+'\n'.join(texts))30
(root/'assets/legal/third_party_notices.txt').write_text('SM Mobile — licenses of resolved Dart/Flutter components\n'+''.join(sections))31
(root/'docs/RESOLVED_COMPONENTS.md').write_text('# Resolved Dart and Flutter components\n\nGenerated from package_config.json and the exact package license files.\nFull texts: `assets/legal/third_party_notices.txt`. Flutter also embeds NOTICES.Z in each build.\n\n| Component | Version |\n| --- | --- |\n'+'\n'.join(index)+'\n')32
print(f'Collected {len(sections)} component license notices.')SHA-256
89c6a6aad51e46a4fdf3eece5149e823bfe1569094de7d30811a7570b8678b98CH-J Proprietary Software License 1.14 · Lähde ilmoitetaan CH-J Proprietary Software License 1.14-koodilla. Sen saatavuus ei muuta lisenssiehtoja eikä myönnä lisäoikeuksia.
Arkisto SHA-256
c486a807e4828998b9c57ab0f2e760f7980b31965fe118e89d3e1a5a2b65be65