Skip to content

Commit 2d666a1

Browse files
committed
Revert "Skip writing unchanged JCW Java files for faster incremental builds"
This reverts commit ac4227b.
1 parent ac4227b commit 2d666a1

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/JcwJavaSourceGenerator.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,8 @@ public IReadOnlyList<string> Generate (IReadOnlyList<JavaPeerInfo> types, string
6767
Directory.CreateDirectory (dir);
6868
}
6969

70-
using var stringWriter = new StringWriter ();
71-
stringWriter.NewLine = "\n";
72-
Generate (type, stringWriter);
73-
string newContent = stringWriter.ToString ();
74-
75-
// Skip writing if content hasn't changed — avoids unnecessary javac recompilation
76-
if (File.Exists (filePath) && File.ReadAllText (filePath) == newContent) {
77-
generatedFiles.Add (filePath);
78-
continue;
79-
}
80-
81-
File.WriteAllText (filePath, newContent);
70+
using var writer = new StreamWriter (filePath);
71+
Generate (type, writer);
8272
generatedFiles.Add (filePath);
8373
}
8474

0 commit comments

Comments
 (0)