void GenerateMainDexListBuilderCommands(CommandLineBuilder cmd)
        {
            var jars = JavaLibraries.Select(i => i.ItemSpec).Concat(new string [] { ClassesOutputDirectory });

            cmd.AppendSwitchIfNotNull("-Djava.ext.dirs=", Path.Combine(AndroidSdkBuildToolsPath, "lib"));
            cmd.AppendSwitch("com.android.multidex.MainDexListBuilder");
            cmd.AppendSwitch(tempJar);
            cmd.AppendSwitchUnquotedIfNotNull("", "\"" + string.Join($"{Path.PathSeparator}", jars) + "\"");
            writeOutputToKeepFile = true;
        }
        void GenerateMainDexListBuilderCommands(CommandLineBuilder cmd)
        {
            var enclosingChar = OS.IsWindows ? "\"" : "'";
            var jars          = JavaLibraries.Select(i => i.ItemSpec).Concat(new string [] { Path.Combine(ClassesOutputDirectory, "classes.zip") });

            cmd.AppendSwitchIfNotNull("-Djava.ext.dirs=", Path.Combine(AndroidSdkBuildToolsPath, "lib"));
            cmd.AppendSwitch("com.android.multidex.MainDexListBuilder");
            cmd.AppendSwitchUnquotedIfNotNull("", $"{enclosingChar}{tempJar}{enclosingChar}");
            cmd.AppendSwitchUnquotedIfNotNull("", enclosingChar + string.Join($"{enclosingChar}{Path.PathSeparator}{enclosingChar}", jars) + enclosingChar);
            writeOutputToKeepFile = true;
        }
Пример #3
0
        void GenerateProguardCommands(CommandLineBuilder cmd)
        {
            var enclosingChar = OS.IsWindows ? "\"" : string.Empty;
            var jars          = JavaLibraries.Select(i => i.ItemSpec).Concat(new string [] { ClassesOutputDirectory });

            cmd.AppendSwitchIfNotNull("-jar ", ProguardJarPath);
            cmd.AppendSwitchUnquotedIfNotNull("-injars ", $"{enclosingChar}'" + string.Join($"'{Path.PathSeparator}'", jars) + $"'{enclosingChar}");
            cmd.AppendSwitch("-dontwarn");
            cmd.AppendSwitch("-forceprocessing");
            cmd.AppendSwitchIfNotNull("-outjars ", tempJar);
            cmd.AppendSwitchIfNotNull("-libraryjars ", $"'{Path.Combine (AndroidSdkBuildToolsPath, "lib", "shrinkedAndroid.jar")}'");
            cmd.AppendSwitch("-dontoptimize");
            cmd.AppendSwitch("-dontobfuscate");
            cmd.AppendSwitch("-dontpreverify");
            cmd.AppendSwitchIfNotNull("-include ", $"'{Path.Combine (AndroidSdkBuildToolsPath, "mainDexClasses.rules")}'");
        }
        void GenerateMainDexListBuilderCommands(CommandLineBuilder cmd)
        {
            var enclosingDoubleQuote = OS.IsWindows ? "\"" : string.Empty;
            var enclosingQuote       = OS.IsWindows ? string.Empty : "'";
            var jars = JavaLibraries.Select(i => i.ItemSpec).Concat(new string [] { Path.Combine(ClassesOutputDirectory, "..", "classes.zip") });

            cmd.AppendSwitchIfNotNull("-Djava.ext.dirs=", Path.Combine(AndroidSdkBuildToolsPath, "lib"));
            cmd.AppendSwitch("com.android.multidex.MainDexListBuilder");
            if (!string.IsNullOrWhiteSpace(ExtraArgs))
            {
                cmd.AppendSwitch(ExtraArgs);
            }
            cmd.AppendSwitch($"{enclosingDoubleQuote}{tempJar}{enclosingDoubleQuote}");
            cmd.AppendSwitchUnquotedIfNotNull("", $"{enclosingDoubleQuote}{enclosingQuote}" +
                                              string.Join($"{enclosingQuote}{Path.PathSeparator}{enclosingQuote}", jars) +
                                              $"{enclosingQuote}{enclosingDoubleQuote}");
            writeOutputToKeepFile = true;
        }
Пример #5
0
        protected override string GenerateCommandLineCommands()
        {
            var cmd = new CommandLineBuilder();

            cmd.AppendSwitch("--output");
            cmd.AppendFileNameIfNotNull(MultiDexMainDexListFile);

            var    jars  = JavaLibraries.Select(i => i.ItemSpec).Concat(new string [] { ClassesOutputDirectory });
            string files = string.Join(Path.PathSeparator.ToString(), jars.Select(s => '\'' + s + '\''));

            if (OS.IsWindows)
            {
                cmd.AppendSwitch('"' + files + '"');
            }
            else
            {
                cmd.AppendSwitch(files);
            }

            return(cmd.ToString());
        }