Preserve existing proto files instead of overwriting
All checks were successful
Publish NuGets / build (release) Successful in 39s
All checks were successful
Publish NuGets / build (release) Successful in 39s
If a proto file already exists (committed to repo), don't overwrite it with a placeholder. This allows first-time builds to work correctly when the proto file is already in the repository. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
05449b9a28
commit
03041721ca
@ -67,6 +67,16 @@ public class WriteProtoFileTask : Task
|
|||||||
"GeneratedProtoFile.g.cs"
|
"GeneratedProtoFile.g.cs"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Check if proto file already exists (committed to repo or from previous build)
|
||||||
|
var existingProtoPath = Path.Combine(ProjectDirectory, OutputDirectory, ProtoFileName);
|
||||||
|
if (File.Exists(existingProtoPath) && !File.Exists(generatedFilePath))
|
||||||
|
{
|
||||||
|
Log.LogMessage(MessageImportance.High,
|
||||||
|
$"Svrnty.CQRS.Grpc: Using existing proto file at {existingProtoPath}. " +
|
||||||
|
"To regenerate, delete the file and build twice.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!File.Exists(generatedFilePath))
|
if (!File.Exists(generatedFilePath))
|
||||||
{
|
{
|
||||||
Log.LogWarning(
|
Log.LogWarning(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user