Compare commits
2 Commits
2a5812d404
...
de271eb6b4
Author | SHA1 | Date |
---|---|---|
|
de271eb6b4 | |
|
6c774a4a4d |
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"repo_url": "http://192.168.0.200:3000/Faxing/Lawnchair.git",
|
||||||
|
"repo_branch": "touka-dev-3.0",
|
||||||
|
"repo_commit": "",
|
||||||
|
"package_name": "com.emoticon.diy.znfav.launcher.free",
|
||||||
|
"game_type": "unity_native",
|
||||||
|
"version_display_name": "1.0.4",
|
||||||
|
"version_code": 4
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18
main.py
18
main.py
|
@ -1,4 +1,6 @@
|
||||||
import os
|
import os
|
||||||
|
import argparse
|
||||||
|
import sys
|
||||||
|
|
||||||
from scripts.build import run
|
from scripts.build import run
|
||||||
from scripts.context import Context
|
from scripts.context import Context
|
||||||
|
@ -6,7 +8,21 @@ from utils import SystemUtils
|
||||||
from utils.logger_utils import init
|
from utils.logger_utils import init
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
context = Context.from_json(open("build_config.json", "r").read())
|
parser = argparse.ArgumentParser(description='构建脚本')
|
||||||
|
parser.add_argument('--config', type=str, help='配置文件', default='build_config.json')
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
config_path = args.config
|
||||||
|
if not config_path.endswith('.json'):
|
||||||
|
config_path += '.json'
|
||||||
|
|
||||||
|
print(config_path)
|
||||||
|
|
||||||
|
if not os.path.exists(config_path):
|
||||||
|
print(f"输入的配置文件不存在 {config_path}")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
context = Context.from_json(open(config_path, "r").read())
|
||||||
|
|
||||||
if SystemUtils.is_windows():
|
if SystemUtils.is_windows():
|
||||||
context.project_original_path = context.project_original_path.replace("/", os.sep)
|
context.project_original_path = context.project_original_path.replace("/", os.sep)
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
@echo off
|
||||||
|
set HTTP_PROXY=http://127.0.0.1:7897
|
||||||
|
set HTTPS_PROXY=http://127.0.0.1:7897
|
||||||
|
python main.py --config com.emoticon.diy.znfav.launcher.free.json
|
||||||
|
pause
|
|
@ -45,6 +45,7 @@ class ProjectInit(Task):
|
||||||
|
|
||||||
# 拉取最新代码
|
# 拉取最新代码
|
||||||
repo.remotes.origin.pull()
|
repo.remotes.origin.pull()
|
||||||
|
print("当前分支:" + repo.active_branch.name)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise Exception(f"No commit to {self.context.repo_commit}")
|
raise Exception(f"No commit to {self.context.repo_commit}")
|
||||||
|
|
|
@ -94,7 +94,9 @@ def update_gradle_property(content, key, new_value):
|
||||||
return updated_content
|
return updated_content
|
||||||
|
|
||||||
|
|
||||||
|
LAUNCHER_CODE_PATH = f"LauncherCode/src/com/launchercode".replace("/", os.sep)
|
||||||
GAME_ACTIVITY_PATH = f"LauncherCode/src/com/launchercode/GameActivity.kt".replace("/", os.sep)
|
GAME_ACTIVITY_PATH = f"LauncherCode/src/com/launchercode/GameActivity.kt".replace("/", os.sep)
|
||||||
|
GAME_ACTIVITY_PATH_2 = f"LauncherCode/src/com/launchercode/activity/GameActivity.kt".replace("/", os.sep)
|
||||||
ANDROID_MANIFEST_PATH = f"lawnchair/AndroidManifest.xml".replace("/", os.sep)
|
ANDROID_MANIFEST_PATH = f"lawnchair/AndroidManifest.xml".replace("/", os.sep)
|
||||||
STRING_PATH = f"LauncherCode/res/values/strings.xml".replace("/", os.sep)
|
STRING_PATH = f"LauncherCode/res/values/strings.xml".replace("/", os.sep)
|
||||||
LAUNCER_STRING_PATH = f"LauncherCode/src/com/launchercode/LauncherStringsValue.kt".replace("/", os.sep)
|
LAUNCER_STRING_PATH = f"LauncherCode/src/com/launchercode/LauncherStringsValue.kt".replace("/", os.sep)
|
||||||
|
@ -178,7 +180,8 @@ storePassword=123456
|
||||||
|
|
||||||
dst_path = os.path.join(self.context.temp_project_path, f"lawnchair{os.sep}assets")
|
dst_path = os.path.join(self.context.temp_project_path, f"lawnchair{os.sep}assets")
|
||||||
|
|
||||||
for file in list(filter(lambda f: not (f == "google_fonts.json" or f == "pag_wallpaper_slide.pag"), os.listdir(dst_path))):
|
for file in list(filter(lambda f: not (f == "google_fonts.json" or f == "pag_wallpaper_slide.pag"),
|
||||||
|
os.listdir(dst_path))):
|
||||||
FileUtils.delete(os.path.join(dst_path, file), True)
|
FileUtils.delete(os.path.join(dst_path, file), True)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -297,6 +300,8 @@ plugins {
|
||||||
image_list = list(map(lambda f: Path(f).stem, os.listdir(target_root_path)))
|
image_list = list(map(lambda f: Path(f).stem, os.listdir(target_root_path)))
|
||||||
|
|
||||||
for file in os.listdir(dst):
|
for file in os.listdir(dst):
|
||||||
|
if file == ".DS_Store":
|
||||||
|
continue
|
||||||
temp_tar = os.path.join(dst, file)
|
temp_tar = os.path.join(dst, file)
|
||||||
temp_dst = os.path.join(target_root_path, file)
|
temp_dst = os.path.join(target_root_path, file)
|
||||||
file_name = Path(file).stem
|
file_name = Path(file).stem
|
||||||
|
@ -355,7 +360,20 @@ plugins {
|
||||||
open(os.path.join(self.context.temp_project_path, LAUNCER_STRING_PATH), "w", encoding="utf-8").write(text)
|
open(os.path.join(self.context.temp_project_path, LAUNCER_STRING_PATH), "w", encoding="utf-8").write(text)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def update_code_dir(self):
|
||||||
|
# code_path = os.path.join(self.context.temp_project_path, GAME_ACTIVITY_PATH)
|
||||||
|
# for i in os.listdir(code_path):
|
||||||
|
# os
|
||||||
|
pass
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
|
self.update_code_dir()
|
||||||
|
global GAME_ACTIVITY_PATH
|
||||||
|
path = os.path.join(self.context.temp_project_path, GAME_ACTIVITY_PATH)
|
||||||
|
if not os.path.exists(path):
|
||||||
|
GAME_ACTIVITY_PATH = GAME_ACTIVITY_PATH_2
|
||||||
|
# GAME_ACTIVITY_PATH = GAME_ACTIVITY_PATH_2
|
||||||
|
pass
|
||||||
self.build_gradle_path = os.path.join(self.context.temp_project_path, "build.gradle")
|
self.build_gradle_path = os.path.join(self.context.temp_project_path, "build.gradle")
|
||||||
self.init_sdk_version()
|
self.init_sdk_version()
|
||||||
self.update_package_name()
|
self.update_package_name()
|
||||||
|
|
Loading…
Reference in New Issue