def fromJenkins(self, args): action = args.action from py_script.FUtil import FUtil from py_script.FLog import FLog from FApp import theApp FLog.setLogLv(theApp.GetEnv().getLogLevel()) out = args.out if args.out else theApp.GetEnv().getAppPath( ) + "/project" newargs = [] newargs.extend(["-project", fixed_param(args.project)]) newargs.extend(["-channel", fixed_param(args.channel)]) newargs.extend(["-out", out]) newargs.extend(["-executor", args.executor]) newargs.extend(["-icon", args.icon]) newargs.extend(["-keystore", args.keystore]) if FUtil.toUTF8(action) == "生成渠道参数": result = self.__parseChannelParams(args) elif FUtil.toUTF8(action) == "设置签名文件": result = self.__parseKeyStoreParams(args) else: result = None newargs.extend(["-params", result]) from py_config_script import ProjectConfigGenMain from py_config_script.UniClientConfig import UniClientConfig UniClientConfig.Instance().init({ "template_path": theApp.GetEnv().getAppPath(), "project_path": theApp.GetEnv().getProjectRootPath(), }) ProjectConfigGenMain.build(newargs) return newargs
def getKeyStoreConfig(self, project_name, channel_name): from FApp import theApp theApp.GetEnv().setProjectName(project_name) project_path = theApp.GetEnv().getProjectRootPath() config_path = os.path.join(project_path, channel_name, "keystore", "config.txt") if not os.path.exists(config_path): return with open(config_path, "r") as f: return json.load(f)
def __genBuildConfig(self): versioninfo = GroupField("buildconfig", description="buildconfig", fields=[]) versioninfo += SelectField( "build_target", description="安卓编译版本", options=["17", "18", "19", "20", "21", "22", "23", "24"], init_value="19") from FApp import theApp svn_path = theApp.GetEnv().getChannelSvnPath(self.channel_name) selects = gen_jenkins_version_option(svn_path) default = selects[0] if len(selects) > 0 else None versioninfo += SelectField("version", description="SDK版本号", options=selects, init_value=default) self.fields.append(versioninfo) # 签名文件 self._keystoreFields = GroupField("keystore", description="签名文件信息", fields=[]) self._keystoreFields += InputFiled("storepass", description="签名文件密码") self._keystoreFields += InputFiled("alias", description="签名文件别名") self._keystoreFields += InputFiled("keypass", description="别名密码") # 角标 self._iconField = GroupField("icon", description="角标展示", fields=[]) self._iconField += ImageField("icon", description="角标")
def __init_iconField(self, project_name): from FApp import theApp url = theApp.GetEnv().getChannelConfigSvnPath( project_name, self.channel_name) + "/icon/drawable-xxxhdpi/app_icon.png" for field in self._iconField.Fields: def __getDefault(fd): if not url: return fd.init_value return url field.init_func = lambda fd: __getDefault(fd)