mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
system proxy & build_windows script
This commit is contained in:
28
build_windows.py
Normal file
28
build_windows.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
fontUse = '''
|
||||
fonts:
|
||||
- family: font
|
||||
fonts:
|
||||
- asset: assets/SourceHanSansSC-Regular.otf
|
||||
'''
|
||||
|
||||
file = open('pubspec.yaml', 'r')
|
||||
content = file.read()
|
||||
file.close()
|
||||
file = open('pubspec.yaml', 'a')
|
||||
file.write(fontUse)
|
||||
file.close()
|
||||
|
||||
subprocess.run(["flutter", "build", "windows"], shell=True)
|
||||
|
||||
file = open('pubspec.yaml', 'w')
|
||||
file.write(content)
|
||||
|
||||
if os.path.exists("build/app-windows.zip"):
|
||||
os.remove("build/app-windows.zip")
|
||||
|
||||
# 压缩build/windows/x64/runner/Release, 生成app-windows.zip, 使用tar命令
|
||||
subprocess.run(["tar", "-a", "-c", "-f", "build/app-windows.zip", "-C", "build/windows/x64/runner/Release", "."]
|
||||
, shell=True)
|
Reference in New Issue
Block a user