#!/usr/bin/env python3
"""Build four native offline utilities with the shared PureApp signing and SDK."""
import os,sys,subprocess
from pathlib import Path
root=Path(__file__).resolve().parents[1]
env=os.environ.copy();env.setdefault('ANDROID_HOME',str(Path.home()/'.local/share/android-sdk'))
if not env.get('PUREAPP_SDK_PUBLIC_KEY'):sys.exit('请设置可信 PUREAPP_SDK_PUBLIC_KEY')
gradle=env.get('PUREAPP_GRADLE',str(Path.home()/'.local/share/gradle-9.1.0/bin/gradle'))
sys.exit(subprocess.call([gradle,':app:assembleRelease',':app:assembleDebug',':app:lintWebpRelease',':app:lintMetronomeRelease',':app:lintMeasureRelease',':app:lintScannerRelease','--console=plain',*sys.argv[1:]],cwd=root/'apps/local-tools',env=env))
