public Template(ExecuteParams parameters) { BundleToolPath = parameters.BundleToolPath; BundlePath = parameters.BundlePath; ApksPath = parameters.ApksPath; OverwriteOutput = parameters.OverwriteOutput; KeystorePath = parameters.KeystorePath; }
private static void BuildForApksInstall(StringBuilder sb, ExecuteParams executeParams) { SetCommand(sb, CommandInstallApks); AddFlag(sb, ApksPath, executeParams.ApksPath); if (!string.IsNullOrWhiteSpace(executeParams.DeviceId)) { AddFlag(sb, DeviceId, executeParams.DeviceId); } }
private static void AddKeystoreFlags(StringBuilder sb, ExecuteParams executeParams) { if (string.IsNullOrWhiteSpace(executeParams.KeystorePath)) { return; } AddFlag(sb, KeystorePath, executeParams.KeystorePath); AddFlag(sb, KeystorePassword, QualifierPassword, executeParams.KeystorePassword); AddFlag(sb, KeystoreAlias, executeParams.KeystoreAlias); AddFlag(sb, AliasPassword, QualifierPassword, executeParams.AliasPassword); }
private static void BuildForApksBuild(StringBuilder sb, ExecuteParams executeParams) { SetCommand(sb, CommandBuildApks); AddFlag(sb, BundlePath, executeParams.BundlePath); AddFlag(sb, OutputPath, executeParams.ApksPath); if (executeParams.OverwriteOutput) { AddFlag(sb, OverwriteOutput); } AddKeystoreFlags(sb, executeParams); if (executeParams.ApkWithDeviceTarget) { AddFlag(sb, ApkWithDeviceTarget); } if (!string.IsNullOrWhiteSpace(executeParams.DeviceId)) { AddFlag(sb, DeviceId, executeParams.DeviceId); } }
public string Build(string bundleToolPath, ExecuteParams executeParams) { if (string.IsNullOrEmpty(bundleToolPath) || executeParams == null) { return(string.Empty); } var sb = new StringBuilder(); sb.Append("java -jar").Append(' ').Append(executeParams.BundleToolPath).Append(' '); switch (executeParams.ExecuteMode) { case ExecuteMode.BuildApks: BuildForApksBuild(sb, executeParams); break; case ExecuteMode.InstallApks: BuildForApksInstall(sb, executeParams); break; case ExecuteMode.ShowApkSize: BuildForShowApkSize(sb, executeParams); break; } return(sb.ToString()); }
private static void BuildForShowApkSize(StringBuilder sb, ExecuteParams executeParams) { SetCommand(sb, CommandShowApkSize); AddFlag(sb, ApksPath, executeParams.ApksPath); }