Skip to content

Commit

Permalink
Fresh build
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRappl committed Dec 23, 2023
1 parent 14dcac3 commit ae6389a
Showing 1 changed file with 3 additions and 30 deletions.
33 changes: 3 additions & 30 deletions src/Piral.Blazor.Tools/tasks/PublishPiletTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,33 +105,9 @@ private void RunPublish()
Directory.Delete(outdir, true);
}

// Build the pilet
RunPiralCli(target, $"pilet build");

// Replace with files from publish
// -- ignored for now as published artifacts might behave weird:
// -- https://github.com/smapiot/Piral.Blazor/issues/128
// CompareAndReplace(outdir, root);

// Pack and publish
RunPiralCli(target, $"pilet pack");
RunPiralCli(target, $"pilet publish --url {FeedUrl} {auth}");
}
}

private void CompareAndReplace(string outdir, string root)
{
var files = Directory.GetFiles(outdir, "*", SearchOption.AllDirectories);

foreach (var file in files)
{
var relName = file.Replace(outdir, "");
var newName = root + relName;

if (File.Exists(newName))
{
File.Copy(newName, file, true);
}
// Publish with a fresh build to prevent weird behavior as in
// https://github.com/smapiot/Piral.Blazor/issues/128
RunPiralCli(target, $"pilet publish --fresh --url {FeedUrl} {auth}");
}
}

Expand All @@ -150,9 +126,6 @@ private void RunPiralCli(string cwd, string arguments)
RedirectStandardOutput = true,
};

// Prevents running dotnet build unnecessarily
startInfo.EnvironmentVariables["PIRAL_BLAZOR_LAST_BUILD"] = "1";

var proc = new Process
{
StartInfo = startInfo,
Expand Down

0 comments on commit ae6389a

Please sign in to comment.