Skip to content

Commit

Permalink
MOAR LOGGING
Browse files Browse the repository at this point in the history
Context: #8681 (comment)

For some reason we see `crc641855b07eca6dcc03/GenericHolder_1.java`
in the log output, part of `@(_JavaStubFiles)`, but as far as we can
tell it *isn't* being compiled.

Which makes no sense.

My best conjecture is that `@(_JavaBindingSource)` doesn't include
everything within `@(_JavaStubFiles)`.

Update the `<Javac/>` task to print out the paths of all files that
at added to the response file, so that we can see what `javac`
is *actually* compiling.
  • Loading branch information
jonpryor committed Jan 30, 2024
1 parent 8dc95b5 commit eacd356
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Xamarin.Android.Build.Tasks/Tasks/JavaCompileToolTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ private void GenerateResponseFile ()
WriteOptionsToResponseFile (sw);
// Include any user .java files
if (JavaSourceFiles != null)
foreach (var file in JavaSourceFiles.Where (p => Path.GetExtension (p.ItemSpec) == ".java"))
sw.WriteLine (string.Format ("\"{0}\"", file.ItemSpec.Replace (@"\", @"\\")));
foreach (var file in JavaSourceFiles.Where (p => Path.GetExtension (p.ItemSpec) == ".java")) {
var path = file.ItemSpec.Replace (@"\", @"\\");
sw.WriteLine (string.Format ("\"{0}\"", path));
Log.LogDebugMessage ($"javac source: {path}");
}

if (string.IsNullOrEmpty (StubSourceDirectory))
return;
Expand All @@ -86,8 +89,10 @@ private void GenerateResponseFile ()
// Solution:
// Since '\' is an escape character, we need to escape it.
// [0] http://download.oracle.com/javase/1.4.2/docs/api/java/io/StreamTokenizer.html#quoteChar(int)
var path = file.Replace (@"\", @"\\").Normalize (NormalizationForm.FormC);
sw.WriteLine (string.Format ("\"{0}\"",
file.Replace (@"\", @"\\").Normalize (NormalizationForm.FormC)));
path));
Log.LogDebugMessage ($"javac source: {path}");
}
}
}
Expand Down

0 comments on commit eacd356

Please sign in to comment.