Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

A special target for testing local nuget builds

Open kekekeks opened this issue 1 year ago • 2 comments

It is sometimes needed to quickly test local changes against an app that consumes nuget packages.

This PR allows to quickly update 9999.0.0-localbuild version in nuget cache from the current source.

(incremental build)

═══════════════════════════════════════════════════════
Target                             Status      Duration
───────────────────────────────────────────────────────
GenerateCppHeaders                 Skipped                // SkipReason: skipping CompileNative
Clean                              Skipped                // SkipReason: via --skip parameter
CompileNative                      Skipped                // SkipReason: EnvironmentInfo.IsOsx
CompileHtmlPreviewer               Skipped                // SkipReason: via --skip parameter
Compile                            Skipped                // SkipReason: via --skip parameter
CreateIntermediateNugetPackages    Succeeded       0:31
CreateNugetPackages                Succeeded       0:09
BuildToNuGetCache                  Succeeded     < 1sec
───────────────────────────────────────────────────────
Total                                              0:41
═══════════════════════════════════════════════════════

kekekeks avatar Feb 01 '24 19:02 kekekeks

You can test this PR using the following package version. 11.1.999-cibuild0044309-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-bot avatar Feb 01 '24 19:02 avaloniaui-bot

You can test this PR using the following package version. 11.1.999-cibuild0044733-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-bot avatar Feb 09 '24 18:02 avaloniaui-bot

You can test this PR using the following package version. 11.1.999-cibuild0045477-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

avaloniaui-bot avatar Mar 01 '24 05:03 avaloniaui-bot

@kekekeks:

  • does this allow to locally debug into Avalonia code?
  • how would I run this locally to have the version in the local nuget cache?
  • The app itself - I guess - I would then target to 9999.0.0-localbuild, right?

llfab avatar Mar 01 '24 12:03 llfab

@llfab

You need to run nuke BuildToNuGetCache in the repository root to get these packages. After that - just include Avalonia as you usually do from nuget, but with 9999.0.0-localbuild version.

The main point of this feature is to be able to quickly debug local Avalonia code changes, without waiting for Nightly NuGet builds. Debugging experience shouldn't be really different from typical NuGet (though, not sure how SourceLink symbols would work here).

maxkatz6 avatar Mar 01 '24 20:03 maxkatz6

Updated build instructions to include this command https://github.com/AvaloniaUI/Avalonia/blob/master/Documentation/build.md

maxkatz6 avatar Mar 01 '24 21:03 maxkatz6

Indeed I am looking for an Option to debug into Avalonia code and set breakpoints there. Seems this would not be possible with this option right?

I also thought about .props magic to easily switch between nuget packs and Avalonia repo csproj. That would be easy but then the Avalonia csproj would need to be "injected" into the solution. Not sure if that can be done.

So: would the above local packs option allow for setting breakpoints into Av code?

llfab avatar Mar 02 '24 11:03 llfab

You can debug your app directly from Avalonia solution that way.

  1. open avalonia desktop slnf
  2. build to nuget cache
  3. add your executable like this: image
  4. remove "build solution": image
  5. run

Breakpoints should work.

kekekeks avatar Mar 02 '24 12:03 kekekeks

I came up with this here which works nicely for me: https://github.com/AvaloniaUI/Avalonia/discussions/14819

llfab avatar Mar 05 '24 08:03 llfab