2025-07-07 03:27:26 +00:00
|
|
|
import os.path
|
|
|
|
|
|
|
|
from scripts.task import Task
|
|
|
|
from utils import SystemUtils, CommandUtils
|
|
|
|
from utils.logger_utils import app_logger
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectBuild(Task):
|
|
|
|
"""
|
|
|
|
assembleLawnWithQuickstepPlay
|
|
|
|
bundleLawnWithQuickstepPlayRelease
|
|
|
|
"""
|
|
|
|
|
|
|
|
def gradlew(self):
|
|
|
|
gradlew = os.path.abspath(os.path.join(self.context.temp_project_path, "gradlew"))
|
|
|
|
if SystemUtils.is_windows():
|
|
|
|
gradlew += ".bat"
|
|
|
|
return gradlew
|
|
|
|
|
|
|
|
def build_apk(self):
|
2025-07-07 05:40:23 +00:00
|
|
|
cmd = f"{self.gradlew()} -p {self.context.temp_project_path} assembleLawnWithQuickstepPlay"
|
2025-07-07 03:27:26 +00:00
|
|
|
app_logger().debug(f"build apk cmd = {cmd}")
|
|
|
|
return_code, stdout, stderr = CommandUtils.execute(cmd)
|
2025-07-07 05:40:23 +00:00
|
|
|
app_logger().debug(f"build apk return_code = {return_code} stdout = {stdout} stderr = {stderr}")
|
2025-07-07 03:27:26 +00:00
|
|
|
|
|
|
|
def build_aab(self):
|
2025-07-07 05:40:23 +00:00
|
|
|
cmd = f"{self.gradlew()} -p {self.context.temp_project_path} bundleLawnWithQuickstepPlayRelease"
|
2025-07-07 03:27:26 +00:00
|
|
|
app_logger().debug(f"build aab cmd = {cmd}")
|
|
|
|
return_code, stdout, stderr = CommandUtils.execute(cmd)
|
2025-07-07 05:40:23 +00:00
|
|
|
app_logger().debug(f"build aab return_code = {return_code} stdout = {stdout} stderr = {stderr}")
|
2025-07-07 03:27:26 +00:00
|
|
|
|
|
|
|
def execute(self):
|
|
|
|
self.build_apk()
|
|
|
|
self.build_aab()
|
|
|
|
|
|
|
|
pass
|