-
Notifications
You must be signed in to change notification settings - Fork 332
Build: Support referencing GirCore via project reference #1403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build: Support referencing GirCore via project reference #1403
Conversation
|
@cameronwhite: This would be the first solution that I could figure out to easily switch between package and project references. The code is not complete and only done for libadwaita. Additionally I purposely left the path to my local GirCore source inside This should result in project references be used (which breaks the build as no source is available under the given path). If you remove the path from the tag the package reference should be used instead, including CentralPackageManagement. This approach creates one target file for each GirCore package. Each project which wants to have a certain GirCore package must import this target. An alternative would be to define the code of the targets file in each csproj file. I don't know what I like better but I think this shows the idea best as it deduplicates code but adds a little complexity to the build as the Additionally I added |
|
Thanks for looking into this! No problem with adding extra items to the |
|
I wonder if the name of the targets file should be And the target inside would match the filename? |
|
Yeah the |
a7ecc43 to
c020197
Compare
|
I just saw that you only reference 4 packages from GirCore: adwaita, Gtk, GObject-2.0.Integration, PaingoCairo-1.0 But you are using some implicit dependencies which get pulled into the project from the nugets like: Gdk and GLib. For this to work with project references those would need to be added explicitly. Is this OK for you? |
|
I think that's okay to make the dependencies more explicit 👍 |
3e4ada3 to
7ddf2c4
Compare
To enable easy debugging of GirCore libraries, the msbuild property "GirCoreSource" can be set to a path where the GirCore source is located. If this property is set the GirCore package references will be replaced by project references which point to the local GirCore source.
7ddf2c4 to
242c190
Compare
|
The usage of targets made more problems than it helped. The files now got even simpler and just define package / project references as project properties. So the files got renamed to reflect this change. What do you think? Remark: In Rider I could not fluently switch from the nuget packages to the local repository. I had to do a manual compile on the commandline first ( |
|
Thanks, I'm good with the updated approach! Agreed that seems a bit simpler. 👍 |
|
No it looks like it is not needed. When I added all implicit dependencies the errors went away in the source files of rider. But compiling on the command line and in rider failed nevertheless. Afterwards I removed all the target stuff and it worked without defining all dependencies. So I removed it again as it was quite a bit of files and a lot of changes. From my point of view you could test if this PR works for you. |
|
Thanks! I've tested building against my local copy of gir.core and it worked well for me, so I think this should be good to merge 🎉 |
To enable easy debugging of GirCore libraries, the msbuild property "GirCoreSource" can be set to a path where the GirCore source is located.
If this property is set the GirCore package references will be replaced by project references which point to the local GirCore source.