Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Elastic.Markdown/DocumentationGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ private bool CompilationNotNeeded(GenerationState? generationState, out HashSet<
outputSeenChanges = generationState?.LastSeenChanges ?? DateTimeOffset.MinValue;
if (generationState == null)
return false;
if (Context.Force)
{
_logger.LogInformation($"Full compilation: --force was specified");
return false;
}

if (Context.Git != generationState.Git)
{
Expand All @@ -144,7 +149,6 @@ private bool CompilationNotNeeded(GenerationState? generationState, out HashSet<
_logger.LogInformation($"Incremental compilation. since: {generationState.LastSeenChanges}");
else if (DocumentationSet.LastWrite <= outputSeenChanges)
{
_logger.LogInformation($"No compilation: no changes since last observed: {generationState.LastSeenChanges}");
_logger.LogInformation($"No compilation: no changes since last observed: {generationState.LastSeenChanges} "
+ "Pass --force to force a full regeneration");
return true;
Expand All @@ -157,6 +161,7 @@ private async Task GenerateLinkReference(Cancel ctx)
{
var file = DocumentationSet.LinkReferenceFile;
var state = LinkReference.Create(DocumentationSet);

var bytes = JsonSerializer.SerializeToUtf8Bytes(state, SourceGenerationContext.Default.LinkReference);
await DocumentationSet.OutputPath.FileSystem.File.WriteAllBytesAsync(file.FullName, bytes, ctx);
}
Expand Down
Loading