Skip to content

Commit ba9a1aa

Browse files
committed
[XABT] Use a response file for D8 task.
1 parent 78f8863 commit ba9a1aa

File tree

1 file changed

+18
-7
lines changed
  • src/Xamarin.Android.Build.Tasks/Tasks

1 file changed

+18
-7
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/D8.cs

+18-7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.IO;
55
using Xamarin.Android.Tools;
66
using Microsoft.Android.Build.Tasks;
7+
using System.Text;
78

89
namespace Xamarin.Android.Tasks
910
{
@@ -43,10 +44,27 @@ public class D8 : JavaToolTask
4344
public string ExtraArguments { get; set; }
4445

4546
protected override string GenerateCommandLineCommands ()
47+
{
48+
var cmd = new CommandLineBuilder ();
49+
50+
if (!string.IsNullOrEmpty (JavaOptions)) {
51+
cmd.AppendSwitch (JavaOptions);
52+
}
53+
54+
cmd.AppendSwitchIfNotNull ("-Xmx", JavaMaximumHeapSize);
55+
cmd.AppendSwitchIfNotNull ("-classpath ", JarPath);
56+
cmd.AppendSwitch (MainClass);
57+
58+
return cmd.ToString ();
59+
}
60+
61+
protected override string GenerateResponseFileCommands ()
4662
{
4763
return GetCommandLineBuilder ().ToString ();
4864
}
4965

66+
protected override Encoding ResponseFileEncoding => Encoding.UTF8;
67+
5068
protected virtual string MainClass => "com.android.tools.r8.D8";
5169

5270
protected int MinSdkVersion { get; set; }
@@ -55,13 +73,6 @@ protected virtual CommandLineBuilder GetCommandLineBuilder ()
5573
{
5674
var cmd = new CommandLineBuilder ();
5775

58-
if (!string.IsNullOrEmpty (JavaOptions)) {
59-
cmd.AppendSwitch (JavaOptions);
60-
}
61-
cmd.AppendSwitchIfNotNull ("-Xmx", JavaMaximumHeapSize);
62-
cmd.AppendSwitchIfNotNull ("-classpath ", JarPath);
63-
cmd.AppendSwitch (MainClass);
64-
6576
if (!string.IsNullOrEmpty (ExtraArguments))
6677
cmd.AppendSwitch (ExtraArguments); // it should contain "--dex".
6778
if (Debug)

0 commit comments

Comments
 (0)