Beispiel #1
0
 public Template(ExecuteParams parameters)
 {
     BundleToolPath  = parameters.BundleToolPath;
     BundlePath      = parameters.BundlePath;
     ApksPath        = parameters.ApksPath;
     OverwriteOutput = parameters.OverwriteOutput;
     KeystorePath    = parameters.KeystorePath;
 }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
            }
        }
Beispiel #5
0
        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());
        }
Beispiel #6
0
        private static void BuildForShowApkSize(StringBuilder sb, ExecuteParams executeParams)
        {
            SetCommand(sb, CommandShowApkSize);

            AddFlag(sb, ApksPath, executeParams.ApksPath);
        }